Skip to content

Commit

Permalink
fix: no TLA, no bundling for library (#2)
Browse files Browse the repository at this point in the history
TLA prevents polyfilling to CJS, and so does bundling due to the
top-level shim.
  • Loading branch information
ctjlewis committed May 24, 2023
2 parents cf8ecbb + ae68e71 commit 044964c
Show file tree
Hide file tree
Showing 6 changed files with 1,454 additions and 1,193 deletions.
50 changes: 35 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: CI
name: Test changes

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
- push
- pull_request_target

env:
GITHUB_TOKEN: ${{ secrets.OVERRIDE_GITHUB_TOKEN }}

jobs:
test:
Expand All @@ -15,16 +14,37 @@ jobs:
timeout-minutes: 10
strategy:
matrix:
nodejs: [14, 16, "lts/*"]
os: [ubuntu-latest, windows-latest, macos-latest]
nodejs: [
18,
# 16,
# "lts/*"
]
os: [
ubuntu-latest,
macos-latest,
# windows-latest,
]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2

- name: Use Git checkout with submodules
uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.OVERRIDE_GITHUB_TOKEN }}

- name: Use PNPM
uses: pnpm/action-setup@v2
with:
version: latest

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.nodejs }}
cache: pnpm
node-version: ${{ matrix.node-version }}

- name: Install and link
run: yarn install --frozen-lockfile && yarn link
- name: Install
run: pnpm i

- name: Test
run: yarn test
run: pnpm test
69 changes: 69 additions & 0 deletions .github/workflows/release.canary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Release (canary)

env:
GITHUB_TOKEN: ${{ secrets.OVERRIDE_GITHUB_TOKEN }}

on:
workflow_dispatch: {}

pull_request_target:
types:
- closed

branches:
- canary

jobs:
Release:
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true

name: Node.js v${{ matrix.nodejs }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 10

strategy:
matrix:
nodejs: [18]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.nodejs }}

- name: Authenticate with private NPM package
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- name: git config
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Use Git checkout with submodules
uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.OVERRIDE_GITHUB_TOKEN }}

- name: Use PNPM
uses: pnpm/action-setup@v2
with:
version: latest

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
cache: pnpm
node-version: ${{ matrix.node-version }}

- name: Install
run: pnpm i

- name: Configure Git
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Test Production Bundle & Release
run: npx release-it --preRelease=canary --ci -VV
69 changes: 69 additions & 0 deletions .github/workflows/release.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Release (production)

on:
workflow_dispatch: {}

pull_request_target:
types:
- closed

branches:
- master

env:
GITHUB_TOKEN: ${{ secrets.OVERRIDE_GITHUB_TOKEN }}

jobs:
Release:
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true

name: Node.js v${{ matrix.nodejs }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 10

strategy:
matrix:
nodejs: [18]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.nodejs }}

- name: Authenticate with private NPM package
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- name: git config
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Use Git checkout with submodules
uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.OVERRIDE_GITHUB_TOKEN }}

- name: Use PNPM
uses: pnpm/action-setup@v2
with:
version: latest

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
cache: pnpm
node-version: ${{ matrix.node-version }}

- name: Install
run: pnpm i

- name: Configure Git
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Test Production Bundle & Release
run: npx release-it minor --ci -VV
27 changes: 18 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
"./*": "./dist/*/index.js"
},
"scripts": {
"build": "tsmodule build -b",
"dev": "tsmodule dev",
"pretest": "tsmodule build -r",
"test": "ava",
"lint": "eslint src --fix",
"prepare": "tsmodule build -r",
"prepublishOnly": "tsmodule build -b"
"export": "tsmodule build",
"build": "pnpm export",
"test": "pnpm export && ava",
"retest": "ava",
"prepublishOnly": "pnpm test",
"lint": "eslint src --fix"
},
"dependencies": {},
"devDependencies": {
"@tsmodule/log": "^2.2.1",
"@tsmodule/tsmodule": "^41.21.0",
Expand All @@ -37,5 +36,15 @@
"exec",
"child_process",
"cross-platform"
]
}
],
"release-it": {
"git": {
"commitMessage": "release: v${version}",
"tagAnnotation": "v${version}"
},
"github": {
"release": true,
"releaseName": "v${version}"
}
}
}

0 comments on commit 044964c

Please sign in to comment.