Skip to content

Commit

Permalink
chore: Rework publish script (#5240)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
lachlancollins committed Dec 30, 2023
1 parent 72c7ed6 commit 5189d74
Show file tree
Hide file tree
Showing 26 changed files with 625 additions and 1,128 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/ci.yml
@@ -1,6 +1,11 @@
name: ci

on:
workflow_dispatch:
inputs:
tag:
description: override release tag
required: false
push:
branches: ['main', 'alpha', 'beta', 'rc']

Expand All @@ -27,12 +32,17 @@ jobs:
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- run: |
- name: Run Tests
run: pnpm run test:ci
- name: Publish
run: |
git config --global user.name 'Tanner Linsley'
git config --global user.email 'tannerlinsley@users.noreply.github.com'
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
pnpm run cipublish
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
TAG: ${{ inputs.tag }}
File renamed without changes.
15 changes: 11 additions & 4 deletions package.json
Expand Up @@ -3,6 +3,7 @@
"private": true,
"repository": "https://github.com/tanstack/table.git",
"packageManager": "pnpm@8.12.1",
"type": "module",
"scripts": {
"clean": "pnpm --filter \"./packages/**\" run clean",
"preinstall": "node -e \"if(process.env.CI == 'true') {console.log('Skipping preinstall...'); process.exit(1)}\" || npx -y only-allow pnpm",
Expand All @@ -15,8 +16,7 @@
"watch": "pnpm run build:all && nx watch --all -- pnpm run build:all",
"dev": "pnpm run watch",
"prettier": "prettier \"packages/*/{src/**,examples/**/src/**}.{md,js,jsx,ts,tsx,json}\" --write",
"cipublish": "ts-node scripts/publish.ts",
"cipublishforce": "CI=true pnpm run cipublish",
"cipublish": "node scripts/publish.js",
"test:pr": "nx affected --targets=test:lib,test:types,build --exclude=examples/**",
"test:ci": "nx run-many --targets=test:lib,test:types,build --exclude=examples/**"
},
Expand All @@ -29,7 +29,7 @@
"@babel/preset-env": "^7.21.5",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.21.5",
"@commitlint/parse": "^16.2.1",
"@commitlint/parse": "^18.4.3",
"@faker-js/faker": "^8.3.1",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-commonjs": "^25.0.7",
Expand All @@ -39,17 +39,23 @@
"@testing-library/react": "^12.1.2",
"@testing-library/react-hooks": "^7.0.2",
"@tsconfig/svelte": "^3.0.0",
"@types/current-git-branch": "^1.1.6",
"@types/git-log-parser": "^1.2.3",
"@types/jsonfile": "^6.1.4",
"@types/luxon": "^2.3.1",
"@types/node": "^18.15.10",
"@types/react": "^18.2.45",
"@types/react-dom": "^18.2.18",
"@types/semver": "^7.3.10",
"@types/stream-to-array": "^2.3.3",
"axios": "^0.26.1",
"babel-plugin-transform-async-to-promises": "^0.8.18",
"chalk": "^5.3.0",
"concurrently": "^7.1.0",
"current-git-branch": "^1.1.0",
"git-log-parser": "^1.2.0",
"jsdom": "^21.1.1",
"jsonfile": "^6.1.0",
"luxon": "^2.3.2",
"nx": "^17.2.7",
"prettier": "^3.0.3",
Expand All @@ -61,10 +67,11 @@
"rollup-plugin-svelte": "^7.1.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-visualizer": "^5.6.0",
"semver": "^7.5.4",
"solid-js": "^1.6.2",
"stream-to-array": "^2.3.0",
"svelte": "^3.49.0",
"ts-node": "^10.9.2",
"type-fest": "^4.8.3",
"typescript": "5.2.2",
"vitest": "^0.29.3",
"vue": "^3.2.33"
Expand Down
1 change: 1 addition & 0 deletions packages/match-sorter-utils/package.json
Expand Up @@ -28,6 +28,7 @@
"type": "github",
"url": "https://github.com/sponsors/kentcdodds"
},
"type": "commonjs",
"module": "build/lib/index.esm.js",
"main": "build/lib/index.js",
"types": "build/lib/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/match-sorter-utils/rollup.config.mjs
@@ -1,7 +1,7 @@
// @ts-check

import { defineConfig } from 'rollup'
import { buildConfigs } from '../../scripts/getRollupConfig.mjs'
import { buildConfigs } from '../../scripts/getRollupConfig.js'

export default defineConfig(
buildConfigs({
Expand Down
1 change: 1 addition & 0 deletions packages/react-table-devtools/package.json
Expand Up @@ -22,6 +22,7 @@
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"type": "commonjs",
"module": "build/lib/index.esm.js",
"main": "build/lib/index.js",
"types": "build/lib/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-table-devtools/rollup.config.mjs
@@ -1,7 +1,7 @@
// @ts-check

import { defineConfig } from 'rollup'
import { buildConfigs } from '../../scripts/getRollupConfig.mjs'
import { buildConfigs } from '../../scripts/getRollupConfig.js'

export default defineConfig(
buildConfigs({
Expand Down
1 change: 1 addition & 0 deletions packages/react-table/package.json
Expand Up @@ -22,6 +22,7 @@
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"type": "commonjs",
"module": "build/lib/index.esm.js",
"main": "build/lib/index.js",
"types": "build/lib/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-table/rollup.config.mjs
@@ -1,7 +1,7 @@
// @ts-check

import { defineConfig } from 'rollup'
import { buildConfigs } from '../../scripts/getRollupConfig.mjs'
import { buildConfigs } from '../../scripts/getRollupConfig.js'

export default defineConfig(
buildConfigs({
Expand Down
1 change: 1 addition & 0 deletions packages/solid-table/package.json
Expand Up @@ -22,6 +22,7 @@
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"type": "commonjs",
"module": "build/lib/index.esm.js",
"main": "build/lib/index.js",
"types": "build/lib/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/solid-table/rollup.config.mjs
@@ -1,7 +1,7 @@
// @ts-check

import { defineConfig } from 'rollup'
import { buildConfigs } from '../../scripts/getRollupConfig.mjs'
import { buildConfigs } from '../../scripts/getRollupConfig.js'

export default defineConfig(
buildConfigs({
Expand Down
1 change: 1 addition & 0 deletions packages/svelte-table/package.json
Expand Up @@ -22,6 +22,7 @@
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"type": "commonjs",
"module": "build/lib/index.esm.js",
"main": "build/lib/index.js",
"types": "build/lib/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte-table/rollup.config.mjs
@@ -1,7 +1,7 @@
// @ts-check

import { defineConfig } from 'rollup'
import { buildConfigs } from '../../scripts/getRollupConfig.mjs'
import { buildConfigs } from '../../scripts/getRollupConfig.js'

export default defineConfig(
buildConfigs({
Expand Down
1 change: 1 addition & 0 deletions packages/table-core/package.json
Expand Up @@ -24,6 +24,7 @@
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"type": "commonjs",
"module": "build/lib/index.esm.js",
"main": "build/lib/index.js",
"types": "build/lib/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/table-core/rollup.config.mjs
@@ -1,7 +1,7 @@
// @ts-check

import { defineConfig } from 'rollup'
import { buildConfigs } from '../../scripts/getRollupConfig.mjs'
import { buildConfigs } from '../../scripts/getRollupConfig.js'

export default defineConfig(
buildConfigs({
Expand Down
1 change: 1 addition & 0 deletions packages/vue-table/package.json
Expand Up @@ -22,6 +22,7 @@
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"type": "commonjs",
"module": "build/lib/index.esm.js",
"main": "build/lib/index.js",
"types": "build/lib/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-table/rollup.config.mjs
@@ -1,7 +1,7 @@
// @ts-check

import { defineConfig } from 'rollup'
import { buildConfigs } from '../../scripts/getRollupConfig.mjs'
import { buildConfigs } from '../../scripts/getRollupConfig.js'

export default defineConfig(
buildConfigs({
Expand Down

0 comments on commit 5189d74

Please sign in to comment.