(react) add tokens.ts files handling

These files will be used to define the custom design tokens per components.
They are automatically aggregated by the packages/react/cunningham.ts file,
this is why handling typescript config file was important.
This commit is contained in:
Nathan Vasse
2023-01-04 15:52:24 +01:00
committed by NathanVss
parent 67dd0048d0
commit be1c9d000b
19 changed files with 147 additions and 29 deletions

View File

@@ -20,8 +20,9 @@
],
"scripts": {
"lint": "eslint . 'src/**/*.{ts,tsx}'",
"dev": "yarn storybook & nodemon --watch src --ext '*' --exec npm run build",
"build": "tsc && vite build",
"dev": "yarn storybook & nodemon --watch src --ext '*' --ignore src/cunningham-tokens.ts --ignore src/cunningham-tokens.css --exec npm run build",
"build": "tsc && yarn build-theme && vite build",
"build-theme": "cunningham -o src -s html -g css,ts",
"preview": "vite preview",
"test": "FORCE_COLOR=1 vitest run",
"test-watch": "vitest",
@@ -39,6 +40,7 @@
},
"devDependencies": {
"@babel/core": "7.20.7",
"@openfun/cunningham-tokens": "*",
"@openfun/typescript-configs": "*",
"@storybook/addon-actions": "6.5.15",
"@storybook/addon-essentials": "6.5.15",
@@ -53,9 +55,11 @@
"@types/react": "18.0.26",
"@types/react-dom": "18.0.10",
"@vitejs/plugin-react": "3.0.0",
"@vitest/coverage-c8": "0.26.3",
"@vitest/ui": "0.26.2",
"babel-loader": "9.1.0",
"css-loader": "6.7.3",
"glob": "8.0.3",
"jsdom": "20.0.3",
"sass": "1.57.1",
"sass-loader": "13.2.0",
@@ -63,6 +67,7 @@
"typescript": "4.9.4",
"vite": "4.0.3",
"vite-plugin-dts": "1.7.1",
"vite-tsconfig-paths": "4.0.3",
"vitest": "0.26.2"
}
}