Skip to content

Commit 03c2f6f

Browse files
committed
Dropping CommonJS and releasing 1.0
1 parent 5c76eec commit 03c2f6f

11 files changed

+752
-3807
lines changed

.eslintrc.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"env": {
33
"browser": true,
44
"node": true,
5-
"es6": true
5+
"es6": true,
6+
"mocha": true
67
},
78
"extends": [
89
"eslint:recommended",
@@ -61,7 +62,6 @@
6162
"args": "none"
6263
}],
6364
"@typescript-eslint/prefer-for-of": ["error"],
64-
"@typescript-eslint/prefer-optional-chain": ["error"],
6565
"@typescript-eslint/prefer-ts-expect-error": ["error"]
6666
}
6767
}

.github/workflows/node.yml

+2-23
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

+4-4
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

+1-2
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

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021-2023 Bad Gateway Inc.
3+
Copyright (c) 2021-2024 Bad Gateway Inc.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

+5-21
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
7+
build: dist/build
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,17 +30,8 @@ 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-
33+
rm -rf dist
4834

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
35+
dist/build: $(SOURCE_FILES)
36+
npx tsc
37+
touch dist/build

changelog.md

+11
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.11.0 (2023-02-15)
516
-------------------
617

0 commit comments

Comments
 (0)