Skip to content

Commit

Permalink
fix: include the source in the packages
Browse files Browse the repository at this point in the history
This has several benefits:
- Allows directly importing the source files, that could resolve the issues with server-side rendering with various build systems
- Can result in more optimized code as the source file is directly built by the build tool (better tree shaking or more modern syntax)
- Compatibility with new package registries such as JSR that prefer TypeScript over JavaScript
- In security conscious environments, the source files can be checked against GitHub and then used directly.
  • Loading branch information
aminya committed May 5, 2024
1 parent 025db21 commit b96dd4d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 8 deletions.
5 changes: 4 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"types": "./dist/*/index.d.ts",
"solid": "./dist/*/index.jsx",
"default": "./dist/*/index.js"
}
},
"./src/*": "./src/*"
},
"main": "dist/index.js",
"module": "dist/index.js",
Expand All @@ -52,8 +53,10 @@
]
}
},
"source": "src/index.tsx",
"files": [
"dist",
"src",
"NOTICE.txt"
],
"scripts": {
Expand Down
7 changes: 5 additions & 2 deletions packages/tailwindcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,16 @@
"default": "./dist/index.js"
},
"require": "./dist/index.cjs"
}
},
"./src/*": "./src/*"
},
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"source": "src/index.ts",
"files": [
"dist"
"dist",
"src"
],
"scripts": {
"build": "tsup",
Expand Down
4 changes: 3 additions & 1 deletion packages/tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"source": "src/index.ts",
"files": [
"dist"
"dist",
"src"
],
"scripts": {
"build": "tsup",
Expand Down
7 changes: 5 additions & 2 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@
"default": "./dist/index.js"
},
"require": "./dist/index.cjs"
}
},
"./src/*": "./src/*"
},
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"source": "src/index.ts",
"files": [
"dist"
"dist",
"src"
],
"scripts": {
"build": "tsup",
Expand Down
7 changes: 5 additions & 2 deletions packages/vanilla-extract/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@
"default": "./dist/index.mjs",
"require": "./dist/index.js",
"node": "./dist/index.js"
}
},
"./src/*": "./src/*"
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"source": "src/index.ts",
"files": [
"dist"
"dist",
"src"
],
"scripts": {
"build": "tsup",
Expand Down

0 comments on commit b96dd4d

Please sign in to comment.