Skip to content

Commit

Permalink
Fix bundling (#498)
Browse files Browse the repository at this point in the history
  • Loading branch information
SorsOps authored Sep 27, 2024
1 parent b591bcd commit cd66e2c
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 31 deletions.
5 changes: 5 additions & 0 deletions .changeset/seven-experts-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tokens-studio/graph-engine-nodes-design-tokens": minor
---

Removed bundling from build step to support treeshaking
14 changes: 10 additions & 4 deletions packages/nodes-design-tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"author": "[email protected]",
"type": "module",
"exports": {
"./*": {
"import": "./dist/*",
"types": "./dist/*",
"style": "./dist/*"
},
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
Expand All @@ -18,8 +23,8 @@
"access": "public"
},
"scripts": {
"build": "tsup",
"dev": "tsup --watch",
"build": "tspc -p tsconfig.prod.json",
"dev": "tspc -p tsconfig.prod.json --watch",
"docs": "typedoc",
"format": "npm run format:eslint && npm run format:prettier",
"format:eslint": "eslint . --fix",
Expand Down Expand Up @@ -54,7 +59,8 @@
"@tokens-studio/graph-engine": "*",
"@types/node": "^18.15.11",
"ts-node": "^10.9.1",
"tsup": "^8.1.0",
"ts-patch": "^3.2.1",
"typescript-transform-paths": "^3.5.1",
"typedoc": "^0.24.7",
"typescript": "^5.4.5",
"vitest": "^1.6.0"
Expand All @@ -64,4 +70,4 @@
"tokens",
"ui"
]
}
}
7 changes: 2 additions & 5 deletions packages/nodes-design-tokens/src/nodes/createBorderToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ import {
ToOutput
} from '@tokens-studio/graph-engine';
import { TokenBorderSchema, TokenSchema } from '../schemas/index.js';
import { TokenTypes } from '@tokens-studio/types';
import { arrayOf } from '../schemas/utils.js';
import type {
SingleToken,
TokenBorderValue,
TokenTypes
} from '@tokens-studio/types';
import type { SingleToken, TokenBorderValue } from '@tokens-studio/types';

export default class NodeDefinition extends Node {
static title = 'Create Border Design Token';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ import {
ToOutput
} from '@tokens-studio/graph-engine';
import { TokenBoxShadowSchema, TokenSchema } from '../schemas/index.js';
import { TokenTypes } from '@tokens-studio/types';
import { arrayOf } from '../schemas/utils.js';
import type {
SingleToken,
TokenBoxshadowValue,
TokenTypes
} from '@tokens-studio/types';
import type { SingleToken, TokenBoxshadowValue } from '@tokens-studio/types';

export default class NodeDefinition extends Node {
static title = 'Create Box Shadow Design Token';
Expand Down
43 changes: 26 additions & 17 deletions packages/nodes-design-tokens/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
{
"ts-node": {
"esm": true
},
"$schema": "https://json.schemastore.org/tsconfig",
"include": ["src", "package.json"],
"exclude": ["cypress.config.ts", "cypress", "node_modules"],
"compilerOptions": {
"sourceMap": true,
"composite": false,
"declaration": true,
"declarationMap": true,
"noEmit": true,
"esModuleInterop": true,
"moduleResolution": "NodeNext",
"forceConsistentCasingInFileNames": true,
"inlineSources": false,
"isolatedModules": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"preserveWatchOutput": true,
"preserveSymlinks": true,
"skipLibCheck": true,
"strict": true,
"jsx": "react",
"target": "ESNext",
"outDir": "./types",
"preserveConstEnums": true,
"module": "NodeNext",
"moduleResolution": "NodeNext",
"rootDir": ".",
"target": "esnext",
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
},
"noImplicitAny": false,
"esModuleInterop": true,
"rootDir": ".",
"experimentalDecorators": true,
"lib": ["esnext", "dom", "dom.iterable"],
"allowJs": true,
"sourceMap": true,
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"types": ["node"],
"baseUrl": "."
},
"include": ["stories/**/*", "src/**/*", "tests/**/*"],
"exclude": ["node_modules", "cypress/**"]
"outDir": "dist"
}
}
28 changes: 28 additions & 0 deletions packages/nodes-design-tokens/tsconfig.prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"extends": "./tsconfig.json",
"include": ["src"],
"compilerOptions": {
"incremental": true,
"rootDir": "src",
"module": "NodeNext",
"skipLibCheck": true,
"moduleResolution": "NodeNext",
"plugins": [
{
"transform": "typescript-transform-paths"
},
// Transform paths in output .d.ts files (Include this line if you output declarations files)
{
"transform": "typescript-transform-paths",
"afterDeclarations": true
}
]
},
"exclude": [
"cypress.config.ts",
"cypress",
"node_modules",
"**/*.stories.tsx",
"**/*.cy.tsx"
]
}
1 change: 1 addition & 0 deletions packages/nodes-design-tokens/tsconfig.prod.tsbuildinfo

Large diffs are not rendered by default.

0 comments on commit cd66e2c

Please sign in to comment.