@inkdropapp/theme-dev-helpers 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bun.lockb CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkdropapp/theme-dev-helpers",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "type": "module",
5
5
  "description": "A helper module for creating themes for Inkdrop",
6
6
  "keywords": [
@@ -23,8 +23,6 @@
23
23
  "dependencies": {
24
24
  "@inkdropapp/base-ui-theme": "^0.3.1",
25
25
  "@inkdropapp/css": "^0.4.2",
26
- "@types/react": "^18.3.10",
27
- "@types/react-dom": "^18.3.0",
28
26
  "@vitejs/plugin-react": "^4.3.2",
29
27
  "commander": "^12.1.0",
30
28
  "puppeteer": "^23.5.3",
@@ -32,10 +30,12 @@
32
30
  "react-dom": "^18.3.1",
33
31
  "react-router-dom": "^6.27.0",
34
32
  "typescript": "^5.5.3",
35
- "typescript-eslint": "^8.7.0",
36
33
  "vite": "^5.4.8"
37
34
  },
38
35
  "devDependencies": {
36
+ "@types/react": "^18.3.10",
37
+ "@types/react-dom": "^18.3.0",
38
+ "typescript-eslint": "^8.7.0",
39
39
  "prettier": "^3.3.3"
40
40
  }
41
41
  }
@@ -6,21 +6,18 @@ import "./dev-server.css";
6
6
  import "@inkdropapp/css/reset.css";
7
7
  import "@inkdropapp/css/tokens.css";
8
8
  import "@inkdropapp/base-ui-theme/styles/theme.css";
9
- import "@/styles/tokens.css";
10
- import "@/styles/theme.css";
11
9
 
12
10
  import { ColorTokensPage } from "./dev-server/color-tokens";
13
11
  import { VariablesPage } from "./dev-server/variables";
14
12
  import { ComponentsPage } from "./dev-server/components";
13
+ const baseProjectPath = import.meta.env.BASE_PROJECT_PATH || ''
14
+ const styleSheets: string[] = import.meta.env.STYLE_SHEETS || []
15
15
 
16
- // const cssFiles = [
17
- // "@/styles/tokens.css",
18
- // "@/styles/theme.css",
19
- // ];
20
- //
21
- // cssFiles.forEach((file) => {
22
- // import(/* @vite-ignore */ file);
23
- // });
16
+ const cssFiles = styleSheets.map(ss => `${baseProjectPath}/styles/${ss}`)
17
+
18
+ cssFiles.forEach((file) => {
19
+ import(file);
20
+ });
24
21
 
25
22
  const router = createBrowserRouter([
26
23
  {
@@ -0,0 +1,10 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ interface ImportMetaEnv {
4
+ readonly BASE_PROJECT_PATH: string
5
+ readonly STYLE_SHEETS: string[]
6
+ }
7
+
8
+ interface ImportMeta {
9
+ readonly env: ImportMetaEnv
10
+ }
package/tsconfig.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "ES2020",
3
+ "target": "ESNext",
4
4
  "useDefineForClassFields": true,
5
5
  "lib": [
6
6
  "ES2020",
@@ -10,7 +10,7 @@
10
10
  "module": "ESNext",
11
11
  "skipLibCheck": true,
12
12
  /* Bundler mode */
13
- "moduleResolution": "bundler",
13
+ "moduleResolution": "Node",
14
14
  "allowImportingTsExtensions": true,
15
15
  "isolatedModules": true,
16
16
  "moduleDetection": "force",
package/vite.config.ts CHANGED
@@ -1,9 +1,14 @@
1
- import { fileURLToPath, URL } from 'url'
2
1
  import { defineConfig } from 'vite'
3
2
  import react from '@vitejs/plugin-react'
4
3
 
5
- const baseProjectPath = process.env.BASE_PROJECT_PATH || fileURLToPath(new URL('../..', import.meta.url))
4
+ const baseProjectPath = process.env.BASE_PROJECT_PATH || process.cwd()
6
5
  console.log('Base project path:', baseProjectPath)
6
+ const packageJson = await import(`${baseProjectPath}/package.json`, {
7
+ with: {
8
+ type: "json",
9
+ }
10
+ })
11
+ const { styleSheets } = packageJson
7
12
 
8
13
  // https://vitejs.dev/config/
9
14
  export default defineConfig({
@@ -16,9 +21,16 @@ export default defineConfig({
16
21
  }
17
22
  ]
18
23
  },
24
+ define: {
25
+ 'import.meta.env.BASE_PROJECT_PATH': JSON.stringify(baseProjectPath),
26
+ 'import.meta.env.STYLE_SHEETS': JSON.stringify(styleSheets)
27
+ },
19
28
  server: {
20
29
  fs: {
21
- allow: ['src', 'node_modules', baseProjectPath]
30
+ strict: false
22
31
  }
32
+ },
33
+ optimizeDeps: {
34
+ include: ['react', 'react-dom', 'react-dom/client', 'react/jsx-dev-runtime', 'react/jsx-runtime']
23
35
  }
24
36
  })