Skip to content

Commit

Permalink
chore: migrate to TSUp (#446)
Browse files Browse the repository at this point in the history
* chore: migrate to TSUp

* chore: fix build
  • Loading branch information
crutchcorn authored Sep 8, 2023
1 parent 081a228 commit 15d4af9
Show file tree
Hide file tree
Showing 18 changed files with 217 additions and 999 deletions.
18 changes: 4 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
"concurrently": "^8.2.1",
"cpy-cli": "^5.0.0",
"current-git-branch": "^1.1.0",
"esbuild": "^0.18.13",
"esbuild-plugin-file-path-extensions": "^1.0.0",
"eslint": "^8.48.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-typescript": "^3.6.0",
Expand All @@ -86,18 +88,11 @@
"react-dom": "^18.2.0",
"react-dom-17": "npm:react-dom@^17.0.2",
"rimraf": "^5.0.1",
"rollup": "^3.23.0",
"rollup-plugin-esbuild": "^5.0.0",
"rollup-plugin-node-externals": "^6.1.0",
"rollup-plugin-preserve-directives": "^0.2.0",
"rollup-plugin-size": "^0.2.2",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-visualizer": "^5.9.0",
"rollup-preset-solid": "^2.0.1",
"semver": "^7.3.8",
"fs-extra": "^11.1.1",
"solid-js": "^1.6.13",
"stream-to-array": "^2.3.0",
"tsup": "^7.0.0",
"tsup": "^7.1.0",
"type-fest": "^3.11.0",
"typescript": "^5.2.2",
"vitest": "^0.34.3",
Expand All @@ -110,11 +105,6 @@
}
]
},
"dependencies": {
"@tanstack/store": "0.1.3",
"fs-extra": "^11.1.1",
"rollup-plugin-dts": "^5.3.0"
},
"pnpm": {
"patchedDependencies": {
"@types/testing-library__jest-dom@5.14.5": "patches/@types__testing-library__jest-dom@5.14.5.patch"
Expand Down
33 changes: 22 additions & 11 deletions packages/form-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,44 @@
"url": "https://github.com/sponsors/tannerlinsley"
},
"type": "module",
"types": "build/lib/index.d.ts",
"main": "build/lib/index.legacy.cjs",
"module": "build/lib/index.legacy.js",
"types": "build/legacy/index.d.ts",
"main": "build/legacy/index.cjs",
"module": "build/legacy/index.js",
"exports": {
".": {
"types": "./build/lib/index.d.ts",
"import": "./build/lib/index.js",
"require": "./build/lib/index.cjs",
"default": "./build/lib/index.cjs"
"import": {
"types": "./build/modern/index.d.ts",
"default": "./build/modern/index.js"
},
"require": {
"types": "./build/modern/index.d.cts",
"default": "./build/modern/index.cjs"
}
},
"./package.json": "./package.json"
},
"sideEffects": false,
"files": [
"build/lib/*",
"build",
"src"
],
"nx": {
"targets": {
"test:build": {
"dependsOn": [
"build"
]
}
}
},
"scripts": {
"clean": "rimraf ./build && rimraf ./coverage",
"test:eslint": "eslint --ext .ts,.tsx ./src",
"test:types": "tsc --noEmit && vitest typecheck",
"test:lib": "vitest run --coverage",
"test:lib:dev": "pnpm run test:lib --watch",
"test:build": "publint --strict",
"build": "pnpm build:rollup && pnpm build:types",
"build:rollup": "rollup --config rollup.config.js",
"build:types": "tsc --emitDeclarationOnly"
"build": "tsup"
},
"dependencies": {
"@tanstack/store": "0.1.3"
Expand Down
12 changes: 0 additions & 12 deletions packages/form-core/rollup.config.js

This file was deleted.

9 changes: 9 additions & 0 deletions packages/form-core/tsup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// @ts-check

import { defineConfig } from 'tsup'
import { legacyConfig, modernConfig } from '../../scripts/getTsupConfig.js'

export default defineConfig([
modernConfig({ entry: ['src/*.ts'] }),
legacyConfig({ entry: ['src/*.ts'] }),
])
52 changes: 29 additions & 23 deletions packages/react-form/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,6 @@
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"type": "module",
"types": "build/lib/index.d.ts",
"main": "build/lib/index.legacy.cjs",
"module": "build/lib/index.legacy.js",
"exports": {
".": {
"types": "./build/lib/index.d.ts",
"import": "./build/lib/index.js",
"require": "./build/lib/index.cjs",
"default": "./build/lib/index.cjs"
},
"./package.json": "./package.json"
},
"sideEffects": false,
"scripts": {
"clean": "rimraf ./build && rimraf ./coverage",
Expand All @@ -31,19 +18,38 @@
"test:lib": "vitest run --coverage",
"test:lib:dev": "pnpm run test:lib --watch",
"test:build": "publint --strict",
"build": "pnpm build:rollup && pnpm build:codemods && pnpm build:types",
"build:rollup": "rollup --config rollup.config.js",
"build:codemods": "cpy ../codemods/src/**/* ./build/codemods",
"build:types": "tsc --emitDeclarationOnly"
"build": "tsup"
},
"files": [
"build/lib/*",
"src",
"build/codemods",
"!build/codemods/jest.config.js",
"!build/codemods/**/__testfixtures__",
"!build/codemods/**/__tests__"
"build",
"src"
],
"type": "module",
"types": "build/legacy/index.d.ts",
"main": "build/legacy/index.cjs",
"module": "build/legacy/index.js",
"exports": {
".": {
"import": {
"types": "./build/modern/index.d.ts",
"default": "./build/modern/index.js"
},
"require": {
"types": "./build/modern/index.d.cts",
"default": "./build/modern/index.cjs"
}
},
"./package.json": "./package.json"
},
"nx": {
"targets": {
"test:build": {
"dependsOn": [
"build"
]
}
}
},
"devDependencies": {
"@types/jscodeshift": "^0.11.3",
"@types/react": "^18.0.14",
Expand Down
12 changes: 0 additions & 12 deletions packages/react-form/rollup.config.js

This file was deleted.

9 changes: 9 additions & 0 deletions packages/react-form/tsup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// @ts-check

import { defineConfig } from 'tsup'
import { legacyConfig, modernConfig } from '../../scripts/getTsupConfig.js'

export default defineConfig([
modernConfig({ entry: ['src/*.ts', 'src/*.tsx'] }),
legacyConfig({ entry: ['src/*.ts', 'src/*.tsx'] }),
])
32 changes: 21 additions & 11 deletions packages/vue-form/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@
"url": "https://github.com/sponsors/tannerlinsley"
},
"type": "module",
"types": "build/lib/index.d.ts",
"main": "build/lib/index.legacy.cjs",
"module": "build/lib/index.legacy.js",
"types": "build/legacy/index.d.ts",
"main": "build/legacy/index.cjs",
"module": "build/legacy/index.js",
"exports": {
".": {
"types": "./build/lib/index.d.ts",
"import": "./build/lib/index.js",
"require": "./build/lib/index.cjs",
"default": "./build/lib/index.cjs"
"import": {
"types": "./build/modern/index.d.ts",
"default": "./build/modern/index.js"
},
"require": {
"types": "./build/modern/index.d.cts",
"default": "./build/modern/index.cjs"
}
},
"./package.json": "./package.json"
},
Expand All @@ -35,10 +39,16 @@
"test:3": "vue-demi-switch 3 && vitest",
"test:lib:dev": "pnpm run test:lib --watch",
"test:build": "publint --strict",
"build": "pnpm build:rollup && pnpm build:codemods && pnpm build:types",
"build:rollup": "rollup --config rollup.config.js",
"build:codemods": "cpy ../codemods/src/**/* ./build/codemods",
"build:types": "tsc --emitDeclarationOnly"
"build": "tsup"
},
"nx": {
"targets": {
"test:build": {
"dependsOn": [
"build"
]
}
}
},
"files": [
"build",
Expand Down
12 changes: 0 additions & 12 deletions packages/vue-form/rollup.config.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/vue-form/src/sfc.d.ts

This file was deleted.

3 changes: 1 addition & 2 deletions packages/vue-form/src/tests/useForm.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference lib="dom" />
import { h, defineComponent, ref } from 'vue-demi'
import { render } from '@testing-library/vue'
import { render, waitFor } from '@testing-library/vue'
import '@testing-library/jest-dom'
import {
createFormFactory,
Expand All @@ -10,7 +10,6 @@ import {
} from '../index'
import userEvent from '@testing-library/user-event'
import * as React from 'react'
import { waitFor } from '@testing-library/react'

const user = userEvent.setup()

Expand Down
9 changes: 9 additions & 0 deletions packages/vue-form/tsup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// @ts-check

import { defineConfig } from 'tsup'
import { legacyConfig, modernConfig } from '../../scripts/getTsupConfig.js'

export default defineConfig([
modernConfig({ entry: ['src/*.ts'] }),
legacyConfig({ entry: ['src/*.ts'] }),
])
Loading

0 comments on commit 15d4af9

Please sign in to comment.