Skip to content

Commit

Permalink
build(next-drupal): switch from microbundle to tsup for builds
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnAlbin committed Nov 17, 2023
1 parent 1be6184 commit 77de568
Show file tree
Hide file tree
Showing 23 changed files with 416 additions and 1,669 deletions.
2 changes: 1 addition & 1 deletion examples/example-auth/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es2020",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand Down
2 changes: 1 addition & 1 deletion examples/example-blog/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es2020",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand Down
2 changes: 1 addition & 1 deletion examples/example-client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es2020",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand Down
2 changes: 1 addition & 1 deletion examples/example-custom-auth/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es2020",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand Down
2 changes: 1 addition & 1 deletion examples/example-custom-cache/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es2020",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand Down
2 changes: 1 addition & 1 deletion examples/example-custom-fetcher/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es2020",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand Down
2 changes: 1 addition & 1 deletion examples/example-custom-serializer/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es2020",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand Down
2 changes: 1 addition & 1 deletion examples/example-graphql/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es2020",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand Down
2 changes: 1 addition & 1 deletion examples/example-marketing/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es2020",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand Down
2 changes: 1 addition & 1 deletion examples/example-query/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es2020",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand Down
2 changes: 1 addition & 1 deletion examples/example-search-api/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es2020",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand Down
2 changes: 1 addition & 1 deletion examples/example-umami/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es2020",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand Down
2 changes: 1 addition & 1 deletion examples/example-webform/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es2020",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@
"jest": "^27.5.1",
"lerna": "^4.0.0",
"lint-staged": "^15.0.2",
"microbundle": "^0.15.1",
"prettier": "^3.0.3",
"start-server-and-test": "^1.15.5",
"ts-jest": "^27.1.5",
"ts-node": "^10.9.1",
"tsup": "^7.3.0",
"turbo": "^1.10.15",
"typescript": "^4.9.5",
"typescript": "^5.2.2",
"uuid": "^9.0.1",
"yaml": "^2.3.3"
}
Expand Down
25 changes: 18 additions & 7 deletions packages/next-drupal-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,20 @@
"source": "src/index.ts",
"type": "module",
"main": "dist/index.cjs",
"module": "dist/index.modern.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
}
},
"license": "MIT",
"publishConfig": {
"access": "public"
Expand All @@ -17,8 +29,8 @@
"url": "https://twitter.com/shadcn"
},
"scripts": {
"prepare": "microbundle --no-compress --jsx React.createElement --format modern,cjs",
"dev": "microbundle watch --no-compress --jsx React.createElement --format modern,cjs",
"prepare": "tsup",
"dev": "tsup --watch",
"test": "jest"
},
"keywords": [
Expand All @@ -37,13 +49,12 @@
"directory": "packages/next-drupal-query"
},
"devDependencies": {
"rollup-plugin-node-builtins": "^2.1.2",
"typescript": "^4.9.5"
"type-fest": "^4.8.1",
"typescript": "^5.2.2"
},
"dependencies": {
"deepmerge": "^4.3.1",
"drupal-jsonapi-params": "^2.3.1",
"next": "^12.2.3 || ^13",
"type-fest": "^2.19.0"
"next": "^12.2.3 || ^13"
}
}
14 changes: 14 additions & 0 deletions packages/next-drupal-query/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineConfig } from "tsup"

export const tsup = defineConfig({
entry: ["src/index.ts"],
// Enable experimental code splitting support in CommonJS.
// splitting: true,
// Use Rollup for tree shaking.
// treeshake: true,
sourcemap: true,
clean: true,
format: ["esm", "cjs"],
dts: true,
cjsInterop: true,
})
21 changes: 16 additions & 5 deletions packages/next-drupal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,20 @@
"source": "src/index.ts",
"type": "module",
"main": "dist/index.cjs",
"module": "dist/index.modern.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
}
},
"license": "MIT",
"publishConfig": {
"access": "public"
Expand All @@ -17,8 +29,8 @@
"url": "https://twitter.com/shadcn"
},
"scripts": {
"prepare": "microbundle --no-compress --jsx React.createElement --format modern,cjs",
"dev": "microbundle watch --no-compress --jsx React.createElement --format modern,cjs",
"prepare": "tsup",
"dev": "tsup --watch",
"test": "jest"
},
"keywords": [
Expand All @@ -37,8 +49,7 @@
"directory": "packages/next-drupal"
},
"devDependencies": {
"rollup-plugin-node-builtins": "^2.1.2",
"typescript": "^4.9.5"
"typescript": "^5.2.2"
},
"dependencies": {
"jsona": "^1.12.1",
Expand Down
14 changes: 14 additions & 0 deletions packages/next-drupal/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineConfig } from "tsup"

export const tsup = defineConfig({
entry: ["src/index.ts"],
// Enable experimental code splitting support in CommonJS.
// splitting: true,
// Use Rollup for tree shaking.
// treeshake: true,
sourcemap: true,
clean: true,
format: ["esm", "cjs"],
dts: true,
cjsInterop: true,
})
2 changes: 1 addition & 1 deletion starters/basic-starter/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es2020",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand Down
2 changes: 1 addition & 1 deletion starters/graphql-starter/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es2020",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "ES2020",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand Down
2 changes: 1 addition & 1 deletion www/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es2020",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand Down
Loading

0 comments on commit 77de568

Please sign in to comment.