Skip to content

Commit 044964c

Browse files
authored
fix: no TLA, no bundling for library (#2)
TLA prevents polyfilling to CJS, and so does bundling due to the top-level shim.
2 parents cf8ecbb + ae68e71 commit 044964c

6 files changed

Lines changed: 1454 additions & 1193 deletions

File tree

.github/workflows/ci.yml

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
name: CI
1+
name: Test changes
22

33
on:
4-
push:
5-
branches:
6-
- '**'
7-
pull_request:
8-
branches:
9-
- '**'
4+
- push
5+
- pull_request_target
6+
7+
env:
8+
GITHUB_TOKEN: ${{ secrets.OVERRIDE_GITHUB_TOKEN }}
109

1110
jobs:
1211
test:
@@ -15,16 +14,37 @@ jobs:
1514
timeout-minutes: 10
1615
strategy:
1716
matrix:
18-
nodejs: [14, 16, "lts/*"]
19-
os: [ubuntu-latest, windows-latest, macos-latest]
17+
nodejs: [
18+
18,
19+
# 16,
20+
# "lts/*"
21+
]
22+
os: [
23+
ubuntu-latest,
24+
macos-latest,
25+
# windows-latest,
26+
]
2027
steps:
21-
- uses: actions/checkout@v2
22-
- uses: actions/setup-node@v2
28+
29+
- name: Use Git checkout with submodules
30+
uses: actions/checkout@v3
31+
with:
32+
submodules: recursive
33+
token: ${{ secrets.OVERRIDE_GITHUB_TOKEN }}
34+
35+
- name: Use PNPM
36+
uses: pnpm/action-setup@v2
37+
with:
38+
version: latest
39+
40+
- name: Use Node.js ${{ matrix.node-version }}
41+
uses: actions/setup-node@v3
2342
with:
24-
node-version: ${{ matrix.nodejs }}
43+
cache: pnpm
44+
node-version: ${{ matrix.node-version }}
2545

26-
- name: Install and link
27-
run: yarn install --frozen-lockfile && yarn link
46+
- name: Install
47+
run: pnpm i
2848

2949
- name: Test
30-
run: yarn test
50+
run: pnpm test
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Release (canary)
2+
3+
env:
4+
GITHUB_TOKEN: ${{ secrets.OVERRIDE_GITHUB_TOKEN }}
5+
6+
on:
7+
workflow_dispatch: {}
8+
9+
pull_request_target:
10+
types:
11+
- closed
12+
13+
branches:
14+
- canary
15+
16+
jobs:
17+
Release:
18+
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true
19+
20+
name: Node.js v${{ matrix.nodejs }} (${{ matrix.os }})
21+
runs-on: ${{ matrix.os }}
22+
timeout-minutes: 10
23+
24+
strategy:
25+
matrix:
26+
nodejs: [18]
27+
os: [ubuntu-latest]
28+
29+
steps:
30+
- uses: actions/checkout@v2
31+
- uses: actions/setup-node@v3
32+
with:
33+
node-version: ${{ matrix.nodejs }}
34+
35+
- name: Authenticate with private NPM package
36+
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
37+
38+
- name: git config
39+
run: |
40+
git config user.name "${GITHUB_ACTOR}"
41+
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
42+
43+
- name: Use Git checkout with submodules
44+
uses: actions/checkout@v3
45+
with:
46+
submodules: recursive
47+
token: ${{ secrets.OVERRIDE_GITHUB_TOKEN }}
48+
49+
- name: Use PNPM
50+
uses: pnpm/action-setup@v2
51+
with:
52+
version: latest
53+
54+
- name: Use Node.js ${{ matrix.node-version }}
55+
uses: actions/setup-node@v3
56+
with:
57+
cache: pnpm
58+
node-version: ${{ matrix.node-version }}
59+
60+
- name: Install
61+
run: pnpm i
62+
63+
- name: Configure Git
64+
run: |
65+
git config user.name "${GITHUB_ACTOR}"
66+
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
67+
68+
- name: Test Production Bundle & Release
69+
run: npx release-it --preRelease=canary --ci -VV

.github/workflows/release.prod.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Release (production)
2+
3+
on:
4+
workflow_dispatch: {}
5+
6+
pull_request_target:
7+
types:
8+
- closed
9+
10+
branches:
11+
- master
12+
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.OVERRIDE_GITHUB_TOKEN }}
15+
16+
jobs:
17+
Release:
18+
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true
19+
20+
name: Node.js v${{ matrix.nodejs }} (${{ matrix.os }})
21+
runs-on: ${{ matrix.os }}
22+
timeout-minutes: 10
23+
24+
strategy:
25+
matrix:
26+
nodejs: [18]
27+
os: [ubuntu-latest]
28+
29+
steps:
30+
- uses: actions/checkout@v2
31+
- uses: actions/setup-node@v3
32+
with:
33+
node-version: ${{ matrix.nodejs }}
34+
35+
- name: Authenticate with private NPM package
36+
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
37+
38+
- name: git config
39+
run: |
40+
git config user.name "${GITHUB_ACTOR}"
41+
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
42+
43+
- name: Use Git checkout with submodules
44+
uses: actions/checkout@v3
45+
with:
46+
submodules: recursive
47+
token: ${{ secrets.OVERRIDE_GITHUB_TOKEN }}
48+
49+
- name: Use PNPM
50+
uses: pnpm/action-setup@v2
51+
with:
52+
version: latest
53+
54+
- name: Use Node.js ${{ matrix.node-version }}
55+
uses: actions/setup-node@v3
56+
with:
57+
cache: pnpm
58+
node-version: ${{ matrix.node-version }}
59+
60+
- name: Install
61+
run: pnpm i
62+
63+
- name: Configure Git
64+
run: |
65+
git config user.name "${GITHUB_ACTOR}"
66+
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
67+
68+
- name: Test Production Bundle & Release
69+
run: npx release-it minor --ci -VV

package.json

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@
1414
"./*": "./dist/*/index.js"
1515
},
1616
"scripts": {
17-
"build": "tsmodule build -b",
1817
"dev": "tsmodule dev",
19-
"pretest": "tsmodule build -r",
20-
"test": "ava",
21-
"lint": "eslint src --fix",
22-
"prepare": "tsmodule build -r",
23-
"prepublishOnly": "tsmodule build -b"
18+
"export": "tsmodule build",
19+
"build": "pnpm export",
20+
"test": "pnpm export && ava",
21+
"retest": "ava",
22+
"prepublishOnly": "pnpm test",
23+
"lint": "eslint src --fix"
2424
},
25-
"dependencies": {},
2625
"devDependencies": {
2726
"@tsmodule/log": "^2.2.1",
2827
"@tsmodule/tsmodule": "^41.21.0",
@@ -37,5 +36,15 @@
3736
"exec",
3837
"child_process",
3938
"cross-platform"
40-
]
41-
}
39+
],
40+
"release-it": {
41+
"git": {
42+
"commitMessage": "release: v${version}",
43+
"tagAnnotation": "v${version}"
44+
},
45+
"github": {
46+
"release": true,
47+
"releaseName": "v${version}"
48+
}
49+
}
50+
}

0 commit comments

Comments
 (0)