Skip to content

Commit 35875be

Browse files
authored
Merge pull request #178 from curveball/prep-v1
Dropping CommonJS and releasing 1.0
2 parents d8d287b + ada0435 commit 35875be

File tree

16 files changed

+259
-278
lines changed

16 files changed

+259
-278
lines changed

.github/workflows/bun.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ jobs:
2020
- name: Use Bun
2121
uses: antongolub/action-setup-bun@v1
2222
- run: bun install
23-
- run: make build
23+
- run: bun run build
2424
- run: bun run mocha

.github/workflows/node.yml

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ on:
1111

1212
jobs:
1313
node-test:
14-
name: Node.js tests (ESM)
14+
name: Node.js tests
1515

1616
runs-on: ubuntu-latest
1717
timeout-minutes: 10
1818

1919
strategy:
2020
matrix:
21-
node-version: [16.x, 18.x]
21+
node-version: [18.x, 20.x, 21.x]
2222
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2323

2424
steps:
@@ -31,27 +31,6 @@ jobs:
3131
- run: npm run build --if-present
3232
- run: npm test
3333

34-
cjs-test:
35-
name: Node.js tests (CommonJS)
36-
37-
runs-on: ubuntu-latest
38-
timeout-minutes: 10
39-
40-
strategy:
41-
matrix:
42-
node-version: [16.x, 18.x]
43-
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
44-
45-
steps:
46-
- uses: actions/checkout@v3
47-
- name: Use Node.js ${{ matrix.node-version }} (CommonJS)
48-
uses: actions/setup-node@v3
49-
with:
50-
node-version: ${{ matrix.node-version }}
51-
- run: npm ci
52-
- run: npm run build --if-present
53-
- run: make test-cjs
54-
5534
lint:
5635
name: Lint
5736

.github/workflows/npm-publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v3
1515
- uses: actions/setup-node@v3
1616
with:
17-
node-version: 16
17+
node-version: 18
1818
- run: npm ci
1919
- run: npm test
2020

@@ -25,7 +25,7 @@ jobs:
2525
- uses: actions/checkout@v3
2626
- uses: actions/setup-node@v3
2727
with:
28-
node-version: 16
28+
node-version: 18
2929
registry-url: https://registry.npmjs.org/
3030
- run: npm ci
3131
- run: npm publish
@@ -39,11 +39,11 @@ jobs:
3939
- uses: actions/checkout@v3
4040
- uses: actions/setup-node@v3
4141
with:
42-
node-version: 16
42+
node-version: 18
4343
- run: npm ci
4444
- uses: actions/setup-node@v3
4545
with:
46-
node-version: 16
46+
node-version: 18
4747
registry-url: 'https://npm.pkg.github.com'
4848
scope: '@curveball'
4949
- run: npm publish

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
/node_modules
33

44
# typescript output
5-
/esm
6-
/cjs
5+
/dist
76

87
# Directory used for running tests in CommonJS mode
98
/cjs-test

Makefile

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,12 @@ SOURCE_FILES:=$(shell find src/ -type f -name '*.ts')
44
all: build
55

66
.PHONY:build
7-
build: cjs/build esm/build assets
7+
build: dist/build assets
88

99
.PHONY:test
1010
test:
1111
npx nyc mocha
1212

13-
.PHONY:test-cjs
14-
test-cjs:
15-
mkdir -p cjs-test
16-
cd test; npx tsc --module commonjs --outdir ../cjs-test
17-
echo '{"type": "commonjs"}' > cjs-test/package.json
18-
cd cjs-test; npx mocha --no-package
19-
2013
.PHONY:lint
2114
lint:
2215
npx eslint --quiet 'src/**/*.ts' 'test/**/*.ts'
@@ -37,34 +30,22 @@ start: build
3730

3831
.PHONY:clean
3932
clean:
40-
rm -rf dist esm cjs cjs-test
41-
42-
cjs/build: $(SOURCE_FILES)
43-
npx tsc --module commonjs --outDir cjs/
44-
echo '{"type": "commonjs"}' > cjs/package.json
45-
@# Creating a small file to keep track of the last build time
46-
touch cjs/build
47-
48-
49-
esm/build: $(SOURCE_FILES)
50-
npx tsc --module es2022 --outDir esm/
51-
echo '{"type": "module"}' > esm/package.json
52-
@# Creating a small file to keep track of the last build time
53-
touch esm/build
33+
rm -rf dist
5434

5535

36+
dist/build: $(SOURCE_FILES)
37+
npx tsc
38+
touch dist/build
5639

5740
.PHONY:assets
5841
assets: assets/js/html-form-enhancer.js assets/js/serialize-json-form.js
5942

6043
assets/js/html-form-enhancer.js: node_modules/html-form-enhancer/dist/html-form-enhancer.js
6144
mkdir -p assets/js
6245
cp node_modules/html-form-enhancer/dist/html-form-enhancer.* assets/js
63-
touch cjs/build
6446

6547
assets/js/serialize-json-form.js: node_modules/html-form-enhancer/dist/serialize-json-form.js
6648
cp node_modules/html-form-enhancer/dist/serialize-json-form.* assets/js
6749

68-
6950
src/data/iana-links.json:
7051
node util/fetch-link-relation-data.mjs > src/data/iana-links.json

changelog.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
Changelog
22
=========
33

4+
1.0.0 (????-??-??)
5+
------------------
6+
7+
* Finally! Curveball v1. Only took 6 years.
8+
* CommonJS support has been dropped. The previous version of this library
9+
supported both CommonJS and ESM. The effort of this no longer feels worth it.
10+
ESM is the future, so we're dropping CommonJS.
11+
* Now requires Node 18.
12+
* Upgraded to Typescript 5.3.
13+
14+
415
0.20.5 (2024-01-14)
516
-------------------
617

0 commit comments

Comments
 (0)