Skip to content

Commit

Permalink
feat(style-dictionary): upgrade to official v4 pr
Browse files Browse the repository at this point in the history
  • Loading branch information
Tahul committed Dec 6, 2023
1 parent 725c9c3 commit 2e8a0d1
Show file tree
Hide file tree
Showing 55 changed files with 2,680 additions and 2,328 deletions.
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@vueuse/motion": "^2.0.0",
"nuxt": "^3.8.2",
"nuxt-icon": "^0.6.6",
"vue": "^3.3.9",
"vue": "^3.3.10",
"vue-router": "^4.2.5"
}
}
6 changes: 3 additions & 3 deletions examples/astro-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
"start": "astro dev --port=3000"
},
"dependencies": {
"vue": "^3.3.9"
"vue": "^3.3.10"
},
"devDependencies": {
"@astrojs/svelte": "^4.0.4",
"@astrojs/svelte": "^5.0.0",
"@pinceau/astro": "workspace:*",
"@pinceau/configs": "workspace:*",
"@pinceau/pigments": "workspace:*",
"@pinceau/outputs": "workspace:*", "@pinceau/svelte": "workspace:*",
"astro": "^3.6.2"
"astro": "^4.0.2"
},
"stackblitz": {
"installDependencies": false,
Expand Down
6 changes: 3 additions & 3 deletions examples/astro-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
"start": "astro dev --port=3000"
},
"dependencies": {
"vue": "^3.3.9"
"vue": "^3.3.10"
},
"devDependencies": {
"@astrojs/vue": "^3.0.4",
"@astrojs/vue": "^4.0.2",
"@pinceau/astro": "workspace:*",
"@pinceau/configs": "workspace:*",
"@pinceau/pigments": "workspace:*",
"@pinceau/outputs": "workspace:*", "@pinceau/vue": "workspace:*",
"astro": "^3.6.2"
"astro": "^4.0.2"
},
"stackblitz": {
"installDependencies": false,
Expand Down
2 changes: 1 addition & 1 deletion examples/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"devDependencies": {
"@pinceau/astro": "workspace:*",
"astro": "^3.6.2",
"astro": "^4.0.2",
"canvas-confetti": "^1.9.2"
},
"stackblitz": {
Expand Down
6 changes: 0 additions & 6 deletions examples/nuxt/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ export default defineNuxtConfig({
modules: [
'@pinceau/nuxt',
],
components: [
{
path: resolve('../shared'),
global: true,
},
],
pinceau: {
style: {
excludes: [
Expand Down
6 changes: 3 additions & 3 deletions examples/sveltekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
"@pinceau/pigments": "workspace:*",
"@pinceau/outputs": "workspace:*", "@pinceau/svelte": "workspace:*",
"@sveltejs/adapter-auto": "^2.1.1",
"@sveltejs/kit": "^1.27.6",
"svelte": "^4.2.7",
"@sveltejs/kit": "^1.27.7",
"svelte": "^4.2.8",
"svelte-check": "^3.6.2",
"tslib": "^2.6.2",
"typescript": "^5.3.2",
"vite": "5.0.3"
"vite": "5.0.5"
},
"stackblitz": {
"installDependencies": false,
Expand Down
2 changes: 1 addition & 1 deletion examples/vite-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"@pinceau/pigments": "workspace:*",
"@pinceau/outputs": "workspace:*",
"typescript": "^5.3.2",
"vite": "^5.0.3"
"vite": "^5.0.5"
}
}
2 changes: 1 addition & 1 deletion examples/vite-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@prefresh/vite": "^2.4.4",
"cross-env": "^7.0.3",
"typescript": "^5.3.2",
"vite": "^5.0.3"
"vite": "^5.0.5"
},
"stackblitz": {
"installDependencies": false,
Expand Down
6 changes: 3 additions & 3 deletions examples/vite-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
"@pinceau/pigments": "workspace:*",
"@pinceau/outputs": "workspace:*",
"@pinceau/react": "workspace:*",
"@types/node": "20.10.0",
"@types/node": "20.10.3",
"@types/react": "latest",
"@types/react-dom": "latest",
"@vitejs/plugin-react": "^4.2.0",
"@vitejs/plugin-react": "^4.2.1",
"cross-env": "^7.0.3",
"typescript": "^5.3.2",
"vite": "^5.0.3"
"vite": "^5.0.5"
},
"stackblitz": {
"installDependencies": false,
Expand Down
6 changes: 3 additions & 3 deletions examples/vite-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
"serve": "vite preview"
},
"dependencies": {
"solid-js": "^1.8.6"
"solid-js": "^1.8.7"
},
"devDependencies": {
"@pinceau/configs": "workspace:*",
"@pinceau/pigments": "workspace:*",
"@pinceau/outputs": "workspace:*", "@pinceau/react": "workspace:*",
"typescript": "^5.3.2",
"vite": "^5.0.3",
"vite-plugin-inspect": "^0.8.0",
"vite": "^5.0.5",
"vite-plugin-inspect": "^0.8.1",
"vite-plugin-solid": "^2.7.2"
},
"stackblitz": {
Expand Down
4 changes: 2 additions & 2 deletions examples/vite-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
"@pinceau/outputs": "workspace:*",
"@pinceau/svelte": "workspace:*",
"@sveltejs/vite-plugin-svelte": "^3.0.1",
"svelte": "^4.2.7",
"svelte": "^4.2.8",
"svelte-check": "^3.6.2",
"svelte-preprocess": "^5.1.1",
"tslib": "^2.6.2",
"typescript": "^5.3.2",
"vite": "^5.0.3"
"vite": "^5.0.5"
},
"stackblitz": {
"installDependencies": false,
Expand Down
8 changes: 4 additions & 4 deletions examples/vite-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
"preview": "vite preview"
},
"dependencies": {
"@vueuse/core": "^10.6.1",
"vue": "^3.3.9",
"@vueuse/core": "^10.7.0",
"vue": "^3.3.10",
"vue-router": "^4.2.5"
},
"devDependencies": {
"@pinceau/configs": "workspace:*",
"@pinceau/pigments": "workspace:*",
"@pinceau/outputs": "workspace:*",
"@pinceau/vue": "workspace:*",
"@vitejs/plugin-vue": "^4.5.0",
"@vitejs/plugin-vue": "^4.5.1",
"typescript": "^5.3.2",
"vite": "^5.0.3"
"vite": "^5.0.5"
},
"stackblitz": {
"installDependencies": false,
Expand Down
2 changes: 1 addition & 1 deletion examples/vite-vue/pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div :styled="{ color: '$color.red.9' }">
<div :styled="{ color: '$color.red.5' }">
Hello World
</div>
</template>
2 changes: 1 addition & 1 deletion integrations/browser/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ build({
},
noExternal: [
'sfc-composer',
'style-dictionary-esm',
'style-dictionary',
'nanoid',
'scule',
'recast',
Expand Down
8 changes: 2 additions & 6 deletions integrations/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,7 @@
"@pinceau/svelte": "workspace:*",
"@pinceau/theme": "workspace:*",
"@pinceau/vue": "workspace:*",
"jiti": "^1.21.0",
"tsup": "^8.0.1"
},
"dependencies": {
"esbuild-plugin-pipe": "^0.2.0",
"esbuild-plugin-text-replace": "^1.3.0"
"tsup": "^8.0.1",
"jiti": "^1.21.0"
}
}
2 changes: 1 addition & 1 deletion integrations/language-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@pinceau/theme": "workspace:*",
"@pinceau/core": "workspace:*",
"@pinceau/style": "workspace:*",
"@vue/compiler-sfc": "^3.3.9",
"@vue/compiler-sfc": "^3.3.10",
"fast-glob": "^3.3.2",
"line-column": "^1.0.2",
"tinycolor2": "1.6.0",
Expand Down
11 changes: 4 additions & 7 deletions integrations/language-server/src/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { dirname } from 'node:path'
import type { Color, Location } from 'vscode-languageserver/node'
import type { DesignToken } from '@pinceau/theme'
import fastGlob from 'fast-glob'
import createJITI from 'jiti'
import type { PinceauStyleFunctionContext } from '@pinceau/style'
import CacheManager from './cache'
import isColor from './utils/isColor'
Expand Down Expand Up @@ -53,8 +52,6 @@ export default class PinceauTokensManager {

public async scanFolders(folders: string[], settings: Partial<PinceauVSCodeSettings>) {
for (const folderPath of folders) {
const jiti = createJITI(folderPath, { cache: false, requireCache: false, v8cache: false })

try {
await globRequire(
folderPath,
Expand All @@ -63,13 +60,13 @@ export default class PinceauTokensManager {
const themePath = dirname(filePath)

if (filePath.includes('theme.js')) {
const file = await jiti(filePath)
this.updateCacheFromTokensContent({ content: file?.default || file, filePath: themePath })
const file = await import(`${filePath}?${Date.now()}`).then(d => d?.default || d)
this.updateCacheFromTokensContent({ content: file, filePath: themePath })
settings?.debug && console.log('📥 Loaded theme:', filePath)
}
if (filePath.includes('definitions.js')) {
const file = await jiti(filePath)
this.pushDefinitions({ content: file?.default || file, filePath: themePath })
const file = await import(`${filePath}?${Date.now()}`).then(d => d?.default || d)
this.pushDefinitions({ content: file, filePath: themePath })
settings?.debug && console.log('📥 Loaded definitions:', filePath)
}
},
Expand Down
1 change: 0 additions & 1 deletion integrations/nuxt/build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export default defineBuildConfig({
},
externals: [
'@nuxt',
'jiti',
'chalk',
'consola',
'defu',
Expand Down
6 changes: 0 additions & 6 deletions integrations/nuxt/index.cjs

This file was deleted.

9 changes: 4 additions & 5 deletions integrations/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./index.cjs"
"require": "./dist/index.cjs"
}
},
"main": "./index.cjs",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist",
"index.cjs",
"server"
],
"scripts": {
Expand All @@ -41,9 +40,9 @@
"@nuxthq/studio": "^1.0.5",
"@nuxtjs/color-mode": "^3.3.2",
"@pinceau/configs": "workspace:*",
"nitropack": "2.8.0",
"nitropack": "2.8.1",
"nuxi": "3.10.0",
"nuxt": "3.8.2",
"nuxt-component-meta": "^0.5.4"
"nuxt-component-meta": "^0.6.0"
}
}
6 changes: 0 additions & 6 deletions integrations/nuxt/server.cjs

This file was deleted.

7 changes: 3 additions & 4 deletions integrations/nuxt/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import fs from 'node:fs'
import process from 'node:process'
import { join, resolve } from 'pathe'
import { addPluginTemplate, addPrerenderRoutes, createResolver, defineNuxtModule, resolveModule } from '@nuxt/kit'
import createJITI from 'jiti'
import type { PinceauUserOptions } from '@pinceau/core'
import { walkTokens } from '@pinceau/theme/runtime'
import type { ConfigLayer } from '@pinceau/theme'
Expand Down Expand Up @@ -49,12 +48,12 @@ const module: any = defineNuxtModule<PinceauUserOptions>({
// @ts-expect-error
nuxt.hook('component-meta:transformers', (transformers: any[]) => {
transformers.push(
(component: any, code: string) => {
async (component: any, code: string) => {
const resolvedTokens: string[] = []

// Grab built tokens and resolve all tokens paths
if (fs.existsSync(join(buildDir, 'index.ts'))) {
const _tokens = createJITI(buildDir)(join(buildDir, 'index.ts')).default
if (fs.existsSync(join(buildDir, 'theme.ts'))) {
const _tokens = await import(`${join(buildDir, 'index.ts')}?${Date.now()}`).then(d => d?.default || d)
walkTokens(_tokens?.theme || _tokens, (_, __, paths) => { cachedTokens.push(paths.join('.')) })
}

Expand Down
24 changes: 12 additions & 12 deletions integrations/repl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,32 +42,32 @@
"start": "vite preview --port 3000"
},
"dependencies": {
"@iconify/json": "^2.2.149",
"@iconify/json": "^2.2.152",
"appwrite": "^13.0.1",
"import-mapper": "^0.0.4",
"monaco-jsx-syntax-highlight": "^1.2.0",
"splitpanes": "^3.1.5",
"unplugin-icons": "^0.17.4",
"vite-plugin-node-polyfills": "^0.16.0",
"unplugin-icons": "^0.18.1",
"vite-plugin-node-polyfills": "^0.17.0",
"vue3-popper": "^1.5.0"
},
"devDependencies": {
"@babel/types": "^7.23.4",
"@microsoft/api-extractor": "^7.38.3",
"@babel/types": "^7.23.5",
"@microsoft/api-extractor": "^7.38.4",
"@pinceau/browser": "workspace:*",
"@pinceau/configs": "workspace:*",
"@pinceau/pigments": "workspace:*",
"@pinceau/react": "workspace:*",
"@pinceau/svelte": "workspace:*",
"@pinceau/vue": "workspace:*",
"@rollup/plugin-replace": "^5.0.5",
"@types/node": "^20.10.0",
"@vitejs/plugin-vue": "^4.5.0",
"@types/node": "^20.10.3",
"@vitejs/plugin-vue": "^4.5.1",
"@volar/cdn": "~1.11.1",
"@volar/language-server": "^1.11.1",
"@volar/monaco": "~1.11.1",
"@volar/typescript": "~1.11.1",
"@vue/language-service": "1.8.22",
"@vue/language-service": "1.8.25",
"fflate": "^0.8.1",
"monaco-editor": "^0.44.0",
"monaco-editor-core": "^0.44.0",
Expand All @@ -78,11 +78,11 @@
"path-browserify": "^1.0.1",
"simple-git-hooks": "^2.9.0",
"sucrase": "^3.34.0",
"svelte": "^4.2.7",
"svelte": "^4.2.8",
"svelte2tsx": "^0.6.27",
"typescript": "^5.3.2",
"vite": "^5.0.3",
"vue": "^3.3.9",
"vue-tsc": "1.8.22"
"vite": "^5.0.5",
"vue": "^3.3.10",
"vue-tsc": "1.8.25"
}
}
3 changes: 1 addition & 2 deletions integrations/repl/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export default defineConfig({
'path': 'path-browserify',
'@vue/compiler-dom': '@vue/compiler-dom/dist/compiler-dom.cjs.js',
'@vue/compiler-core': '@vue/compiler-core/dist/compiler-core.cjs.js',
'jiti': resolve('./src/jiti-proxy.ts'),
},
},
plugins: [
Expand Down Expand Up @@ -84,7 +83,7 @@ export default defineConfig({
'vscode-uri',
'nanoid',
'scule',
'style-dictionary-esm',
'style-dictionary',
'pathe',
'node:fs',
'@volar/language-core',
Expand Down
Loading

0 comments on commit 2e8a0d1

Please sign in to comment.