Skip to content

Commit

Permalink
fix: fixed examples
Browse files Browse the repository at this point in the history
  • Loading branch information
prisis committed Sep 17, 2024
1 parent 10d0a11 commit c606586
Show file tree
Hide file tree
Showing 38 changed files with 291 additions and 93 deletions.
3 changes: 3 additions & 0 deletions examples/cjs-interop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"./dist"
],
"scripts": {
"attw": "pnpm exec attw --pack",
"build": "packem build --cjsInterop"
Expand Down
8 changes: 7 additions & 1 deletion examples/cjs-interop/packem.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,11 @@ import transformer from "@visulima/packem/transformer/esbuild";

// eslint-disable-next-line import/no-unused-modules
export default defineConfig({
transformer
transformer,
cjsInterop: true,
rollup: {
node10Compatibility: {
writeToPackageJson: true,
},
},
});
7 changes: 5 additions & 2 deletions examples/copy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
"type": "commonjs",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"./dist"
],
"scripts": {
"build": "packem build"
},
"devDependencies": {
"@visulima/packem": "workspace:*",
"esbuild": "^0.23.1"
"esbuild": "^0.23.1",
"typescript": "^5.6.2"
},
"packem": {
"rollup": {
Expand Down
9 changes: 9 additions & 0 deletions examples/esm-cjs-exports/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@
"version": "1.0.0",
"private": true,
"type": "module",
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"files": [
"./dist"
],
"scripts": {
"build": "packem build --cjsInterop"
},
Expand Down
13 changes: 13 additions & 0 deletions examples/isolated-declarations-oxc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
}
}
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"./dist"
],
"scripts": {
"build": "packem build"
},
Expand All @@ -23,5 +29,12 @@
"esbuild": "^0.23.1",
"oxc-transform": "^0.29.0",
"typescript": "^5.6.2"
},
"typesVersions": {
"*": {
".": [
"./dist/index.d.ts"
]
}
}
}
7 changes: 6 additions & 1 deletion examples/isolated-declarations-oxc/packem.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,10 @@ import isolatedDeclarationTransformer from "@visulima/packem/dts/isolated/transf
export default defineConfig({
fileCache: false,
transformer,
isolatedDeclarationTransformer
isolatedDeclarationTransformer,
rollup: {
node10Compatibility: {
writeToPackageJson: true,
},
},
});
13 changes: 13 additions & 0 deletions examples/isolated-declarations-swc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
}
}
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"./dist"
],
"scripts": {
"build": "packem build"
},
Expand All @@ -23,5 +29,12 @@
"@visulima/packem": "workspace:*",
"esbuild": "^0.23.1",
"typescript": "^5.6.2"
},
"typesVersions": {
"*": {
".": [
"./dist/index.d.ts"
]
}
}
}
7 changes: 6 additions & 1 deletion examples/isolated-declarations-swc/packem.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,10 @@ import isolatedDeclarationTransformer from "@visulima/packem/dts/isolated/transf
export default defineConfig({
fileCache: false,
transformer,
isolatedDeclarationTransformer
isolatedDeclarationTransformer,
rollup: {
node10Compatibility: {
writeToPackageJson: true,
},
},
});
7 changes: 6 additions & 1 deletion examples/isolated-declarations-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,15 @@
".": [
"./dist/index.d.cts"
]
},
"*": {
".": [
"./dist/index.d.ts"
]
}
},
"files": [
"dist"
"./dist"
],
"scripts": {
"build": "packem build"
Expand Down
7 changes: 6 additions & 1 deletion examples/isolated-declarations-typescript/packem.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,10 @@ import isolatedDeclarationTransformer from "@visulima/packem/dts/isolated/transf
export default defineConfig({
fileCache: false,
transformer,
isolatedDeclarationTransformer
isolatedDeclarationTransformer,
rollup: {
node10Compatibility: {
writeToPackageJson: true,
},
},
});
17 changes: 0 additions & 17 deletions examples/minifed-class/package.json

This file was deleted.

7 changes: 0 additions & 7 deletions examples/minifed-class/packem.config.ts

This file was deleted.

19 changes: 0 additions & 19 deletions examples/minifed-class/src/index.ts

This file was deleted.

8 changes: 0 additions & 8 deletions examples/minifed-class/tsconfig.json

This file was deleted.

16 changes: 16 additions & 0 deletions examples/mixed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"typesVersions": {
"*": {
".": [
"./dist/index.production.d.ts"
],
"core": [
"./dist/core/index.production.d.ts"
],
"react": [
"./dist/react/index.production.d.ts"
]
}
},
"files": [
"./dist"
],
"scripts": {
"build": "packem build"
},
Expand Down
7 changes: 6 additions & 1 deletion examples/mixed/packem.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@ import { defineConfig } from "@visulima/packem/config";
import transformer from "@visulima/packem/transformer/esbuild";

export default defineConfig({
transformer
transformer,
rollup: {
node10Compatibility: {
writeToPackageJson: true,
},
},
});
2 changes: 1 addition & 1 deletion examples/mixed/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"noEmit": false,
"outDir": "dist",
"outDir": "./dist",
"isolatedModules": true
}
}
18 changes: 17 additions & 1 deletion examples/multi-exports/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "example_packem_multi-exports",
"name": "example_packem_multi_exports",
"version": "1.0.0",
"private": true,
"type": "module",
Expand Down Expand Up @@ -33,6 +33,22 @@
}
}
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"typesVersions": {
"*": {
".": [
"./dist/index.production.d.ts"
],
"react": [
"./dist/react.production.d.ts"
]
}
},
"files": [
"./dist"
],
"scripts": {
"build": "packem build"
},
Expand Down
7 changes: 6 additions & 1 deletion examples/multi-exports/packem.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@ import transformer from "@visulima/packem/transformer/esbuild";

// eslint-disable-next-line import/no-unused-modules
export default defineConfig({
transformer
transformer,
rollup: {
node10Compatibility: {
writeToPackageJson: true,
},
},
});
6 changes: 5 additions & 1 deletion examples/native-node-module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"./dist"
],
"scripts": {
"build": "packem build --cjsInterop"
},
"devDependencies": {
"@visulima/packem": "workspace:*",
"esbuild": "^0.23.1",
"nodehun": "^3.0.2"
"nodehun": "^3.0.2",
"typescript": "^5.6.2"
}
}
3 changes: 3 additions & 0 deletions examples/react-tsx-css/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"files": [
"./dist"
],
"scripts": {
"build": "packem build"
},
Expand Down
22 changes: 22 additions & 0 deletions examples/react-tsx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,31 @@
"version": "1.0.0",
"private": true,
"type": "module",
"exports": {
".": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.cjs"
}
}
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"typesVersions": {
"*": {
".": [
"./dist/index.d.ts"
]
}
},
"files": [
"./dist"
],
"scripts": {
"build": "packem build"
},
Expand Down
7 changes: 6 additions & 1 deletion examples/react-tsx/packem.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@ import transformer from "@visulima/packem/transformer/esbuild";

// eslint-disable-next-line import/no-unused-modules
export default defineConfig({
transformer
transformer,
rollup: {
node10Compatibility: {
writeToPackageJson: true,
},
},
});
13 changes: 13 additions & 0 deletions examples/react-use-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"typesVersions": {
"*": {
".": [
"./dist/index.d.ts"
],
"button": [
"./dist/components/button/index.d.ts"
]
}
},
"files": [
"./dist"
],
"scripts": {
"build": "packem build"
},
Expand Down
Loading

0 comments on commit c606586

Please sign in to comment.