Skip to content

Commit 81ded09

Browse files
chore: Rework publish script (#5240)
* Start reworking publish script * Nearly done * All code copied * Fix missing dependencies * fix: Script running successfully * Add scripts folder to root tsconfig include * Add tag option to CI * Mark root as ESM, explicitly add CJS to packages * Remove ts-node
1 parent 785f542 commit 81ded09

26 files changed

Lines changed: 625 additions & 1128 deletions

.github/workflows/ci.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: ci
22

33
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: override release tag
8+
required: false
49
push:
510
branches: ['main', 'alpha', 'beta', 'rc']
611

@@ -27,12 +32,17 @@ jobs:
2732
cache: pnpm
2833
- name: Install dependencies
2934
run: pnpm install --frozen-lockfile
30-
- run: |
35+
- name: Run Tests
36+
run: pnpm run test:ci
37+
- name: Publish
38+
run: |
3139
git config --global user.name 'Tanner Linsley'
3240
git config --global user.email 'tannerlinsley@users.noreply.github.com'
41+
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
3342
pnpm run cipublish
3443
env:
3544
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
3645
GH_TOKEN: ${{ secrets.GH_TOKEN }}
3746
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3847
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
48+
TAG: ${{ inputs.tag }}
File renamed without changes.

package.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"private": true,
44
"repository": "https://github.com/tanstack/table.git",
55
"packageManager": "pnpm@8.12.1",
6+
"type": "module",
67
"scripts": {
78
"clean": "pnpm --filter \"./packages/**\" run clean",
89
"preinstall": "node -e \"if(process.env.CI == 'true') {console.log('Skipping preinstall...'); process.exit(1)}\" || npx -y only-allow pnpm",
@@ -15,8 +16,7 @@
1516
"watch": "pnpm run build:all && nx watch --all -- pnpm run build:all",
1617
"dev": "pnpm run watch",
1718
"prettier": "prettier \"packages/*/{src/**,examples/**/src/**}.{md,js,jsx,ts,tsx,json}\" --write",
18-
"cipublish": "ts-node scripts/publish.ts",
19-
"cipublishforce": "CI=true pnpm run cipublish",
19+
"cipublish": "node scripts/publish.js",
2020
"test:pr": "nx affected --targets=test:lib,test:types,build --exclude=examples/**",
2121
"test:ci": "nx run-many --targets=test:lib,test:types,build --exclude=examples/**"
2222
},
@@ -29,7 +29,7 @@
2929
"@babel/preset-env": "^7.21.5",
3030
"@babel/preset-react": "^7.18.6",
3131
"@babel/preset-typescript": "^7.21.5",
32-
"@commitlint/parse": "^16.2.1",
32+
"@commitlint/parse": "^18.4.3",
3333
"@faker-js/faker": "^8.3.1",
3434
"@rollup/plugin-babel": "^6.0.3",
3535
"@rollup/plugin-commonjs": "^25.0.7",
@@ -39,17 +39,23 @@
3939
"@testing-library/react": "^12.1.2",
4040
"@testing-library/react-hooks": "^7.0.2",
4141
"@tsconfig/svelte": "^3.0.0",
42+
"@types/current-git-branch": "^1.1.6",
43+
"@types/git-log-parser": "^1.2.3",
44+
"@types/jsonfile": "^6.1.4",
4245
"@types/luxon": "^2.3.1",
4346
"@types/node": "^18.15.10",
4447
"@types/react": "^18.2.45",
4548
"@types/react-dom": "^18.2.18",
4649
"@types/semver": "^7.3.10",
50+
"@types/stream-to-array": "^2.3.3",
4751
"axios": "^0.26.1",
4852
"babel-plugin-transform-async-to-promises": "^0.8.18",
53+
"chalk": "^5.3.0",
4954
"concurrently": "^7.1.0",
5055
"current-git-branch": "^1.1.0",
5156
"git-log-parser": "^1.2.0",
5257
"jsdom": "^21.1.1",
58+
"jsonfile": "^6.1.0",
5359
"luxon": "^2.3.2",
5460
"nx": "^17.2.7",
5561
"prettier": "^3.0.3",
@@ -61,10 +67,11 @@
6167
"rollup-plugin-svelte": "^7.1.0",
6268
"rollup-plugin-terser": "^7.0.2",
6369
"rollup-plugin-visualizer": "^5.6.0",
70+
"semver": "^7.5.4",
6471
"solid-js": "^1.6.2",
6572
"stream-to-array": "^2.3.0",
6673
"svelte": "^3.49.0",
67-
"ts-node": "^10.9.2",
74+
"type-fest": "^4.8.3",
6875
"typescript": "5.2.2",
6976
"vitest": "^0.29.3",
7077
"vue": "^3.2.33"

packages/match-sorter-utils/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"type": "github",
2929
"url": "https://github.com/sponsors/kentcdodds"
3030
},
31+
"type": "commonjs",
3132
"module": "build/lib/index.esm.js",
3233
"main": "build/lib/index.js",
3334
"types": "build/lib/index.d.ts",

packages/match-sorter-utils/rollup.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @ts-check
22

33
import { defineConfig } from 'rollup'
4-
import { buildConfigs } from '../../scripts/getRollupConfig.mjs'
4+
import { buildConfigs } from '../../scripts/getRollupConfig.js'
55

66
export default defineConfig(
77
buildConfigs({

packages/react-table-devtools/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"type": "github",
2323
"url": "https://github.com/sponsors/tannerlinsley"
2424
},
25+
"type": "commonjs",
2526
"module": "build/lib/index.esm.js",
2627
"main": "build/lib/index.js",
2728
"types": "build/lib/index.d.ts",

packages/react-table-devtools/rollup.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @ts-check
22

33
import { defineConfig } from 'rollup'
4-
import { buildConfigs } from '../../scripts/getRollupConfig.mjs'
4+
import { buildConfigs } from '../../scripts/getRollupConfig.js'
55

66
export default defineConfig(
77
buildConfigs({

packages/react-table/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"type": "github",
2323
"url": "https://github.com/sponsors/tannerlinsley"
2424
},
25+
"type": "commonjs",
2526
"module": "build/lib/index.esm.js",
2627
"main": "build/lib/index.js",
2728
"types": "build/lib/index.d.ts",

packages/react-table/rollup.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @ts-check
22

33
import { defineConfig } from 'rollup'
4-
import { buildConfigs } from '../../scripts/getRollupConfig.mjs'
4+
import { buildConfigs } from '../../scripts/getRollupConfig.js'
55

66
export default defineConfig(
77
buildConfigs({

packages/solid-table/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"type": "github",
2323
"url": "https://github.com/sponsors/tannerlinsley"
2424
},
25+
"type": "commonjs",
2526
"module": "build/lib/index.esm.js",
2627
"main": "build/lib/index.js",
2728
"types": "build/lib/index.d.ts",

0 commit comments

Comments
 (0)