Skip to content

Commit 9bd737f

Browse files
layershifterclaude
andcommitted
fix: add files field, fix types paths, emit CJS for Node.js packages
- Add "files": ["dist/"] to all publishable packages for correct npm pack - Fix top-level "types" fields to point to dist instead of source - Add module: "node16" + moduleResolution: "node16" in tsconfig.lib.json for CJS-only packages (babel-preset, webpack-loader, webpack-extraction-plugin, next-extraction-plugin, tag-processor, postcss-syntax, jest-serializer, eslint-plugin) - Fix virtual-loader to require from dist instead of src Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 66e9762 commit 9bd737f

23 files changed

Lines changed: 74 additions & 8 deletions

File tree

packages/babel-preset/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"version": "1.8.0",
44
"types": "./dist/index.d.ts",
55
"description": "Babel preset with build time transforms for Griffel",
6+
"files": [
7+
"dist/"
8+
],
69
"license": "MIT",
710
"repository": {
811
"type": "git",

packages/babel-preset/tsconfig.lib.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"compilerOptions": {
44
"outDir": "./dist",
55
"rootDir": "./src",
6+
"module": "node16",
7+
"moduleResolution": "node16",
68
"types": ["node", "environment"]
79
},
810
"exclude": ["src/**/*.test.ts", "src/**/__fixture__/", "src/**/__mocks__/"],

packages/core/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
22
"name": "@griffel/core",
33
"version": "1.20.0",
4-
"types": "./src/index.ts",
4+
"types": "./dist/index.d.ts",
55
"description": "DOM implementation of Atomic CSS-in-JS",
6+
"files": [
7+
"dist/"
8+
],
69
"license": "MIT",
710
"repository": {
811
"type": "git",

packages/eslint-plugin/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"version": "2.0.2",
44
"types": "./dist/index.d.ts",
55
"description": "ESLint plugin with lint rules for Griffel",
6+
"files": [
7+
"dist/"
8+
],
69
"license": "MIT",
710
"repository": {
811
"type": "git",

packages/jest-serializer/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"version": "1.1.35",
44
"types": "./dist/index.d.ts",
55
"description": "Jest serializer for Griffel",
6+
"files": [
7+
"dist/"
8+
],
69
"license": "MIT",
710
"repository": {
811
"type": "git",

packages/jest-serializer/tsconfig.lib.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"compilerOptions": {
44
"outDir": "./dist",
55
"rootDir": "./src",
6+
"module": "node16",
7+
"moduleResolution": "node16",
68
"types": ["node", "environment"]
79
},
810
"exclude": ["src/**/*.test.ts", "src/**/__fixture__/", "src/**/__mocks__/"],

packages/next-extraction-plugin/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"version": "0.1.14",
44
"types": "./dist/index.d.ts",
55
"description": "NextJS plugin that add Griffel's CSS extraction to webpack loaders pipeline",
6+
"files": [
7+
"dist/"
8+
],
69
"license": "MIT",
710
"repository": {
811
"type": "git",

packages/next-extraction-plugin/tsconfig.lib.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"compilerOptions": {
44
"outDir": "./dist",
55
"rootDir": "./src",
6+
"module": "node16",
7+
"moduleResolution": "node16",
68
"types": ["node", "environment"]
79
},
810
"exclude": ["src/**/*.spec.ts", "src/**/__fixture__/", "src/**/__mocks__/"],

packages/postcss-syntax/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"version": "1.3.5",
44
"types": "./dist/index.d.ts",
55
"description": "postcss syntax for Griffel",
6+
"files": [
7+
"dist/"
8+
],
69
"license": "MIT",
710
"repository": {
811
"type": "git",

packages/postcss-syntax/tsconfig.lib.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"compilerOptions": {
44
"outDir": "./dist",
55
"rootDir": "./src",
6+
"module": "node16",
7+
"moduleResolution": "node16",
68
"types": ["node", "environment"]
79
},
810
"exclude": ["src/**/*.test.ts", "src/**/__fixture__/", "src/**/__mocks__/"],

0 commit comments

Comments
 (0)