File tree 6 files changed +15
-9
lines changed
6 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,12 @@ This project adheres to [Semantic Versioning][semver].
6
6
The format of this changelog is [ a variant] [ lib9-versionning ] of [ Keep a Changelog] [ keep-changelog ] .
7
7
New entries must be placed in a section entitled ` Unreleased ` .
8
8
9
+ ## Unreleased
10
+
11
+ - BREAKING CHANGES: require Node.js 20.10.0 or above
12
+
13
+ This allows us to use [ import attributes] ( https://nodejs.org/api/esm.html#import-attributes ) .
14
+
9
15
## 0.16.0 (2024-11-02)
10
16
11
17
- BREAKING CHANGES: require Node.js 20.0.0 or above
Original file line number Diff line number Diff line change
1
+ " 0.16.0"
Original file line number Diff line number Diff line change 23
23
"url" : " https://github.com/bare-ts/bare/issues"
24
24
},
25
25
"engines" : {
26
- "node" : " >=20.0 .0"
26
+ "node" : " >=20.10 .0"
27
27
},
28
28
"type" : " module" ,
29
29
"bin" : {
Original file line number Diff line number Diff line change @@ -3,16 +3,15 @@ set -eu
3
3
4
4
# https://node.green/#ES2022
5
5
# https://kangax.github.io/compat-table/es2016plus
6
- TARGET=' node16.9.0'
7
- VERSION=\" " $npm_package_version " \"
6
+ TARGET=' node20.10.0'
8
7
9
8
# build .d.ts
10
9
tsc --build src/
11
10
12
11
cp -f dist/index.d.ts dist/index.d.cts
13
12
14
13
# build ESM
15
- esbuild ' src/**/*.ts' --target=$TARGET --define:VERSION= $VERSION -- outdir=dist --log-level=warning
14
+ esbuild ' src/**/*.ts' --target=$TARGET --outdir=dist --log-level=warning
16
15
17
16
# build CommonJS (fallback)
18
17
esbuild src/index.ts --bundle --target=$TARGET --platform=node > dist/index.cjs
Original file line number Diff line number Diff line change @@ -9,4 +9,6 @@ DATE="$(date -u +%Y-%m-%d)"
9
9
# set version and current date
10
10
sed -i " s/^## Unreleased$/## $npm_package_version ($DATE )/" CHANGELOG.md
11
11
12
- git add CHANGELOG.md
12
+ echo " \" $npm_package_version \" " > | VERSION.json
13
+
14
+ git add CHANGELOG.md VERSION.json
Original file line number Diff line number Diff line change 6
6
import * as fs from "node:fs"
7
7
import * as process from "node:process"
8
8
import * as util from "node:util"
9
+ import packageVersion from "../../VERSION.json" with { type : "json" }
9
10
import { CompilerError , Config , transform } from "../index.js"
10
11
11
- // WARNING: This constant MUST be defined at build time.
12
- declare const VERSION: string
13
-
14
12
const HELP_TEXT = `
15
13
Usage: bare [options] [schema]
16
14
@@ -82,7 +80,7 @@ function main(): void {
82
80
if ( values . help ) {
83
81
console . info ( HELP_TEXT )
84
82
} else if ( values . version ) {
85
- console . info ( VERSION )
83
+ console . info ( packageVersion )
86
84
} else {
87
85
if ( positionals . length > 1 && positionals [ 0 ] === "compile" ) {
88
86
positionals . pop ( )
You can’t perform that action at this time.
0 commit comments