Skip to content

Commit

Permalink
feat(up): upgrade dependencies; improve repl; fix lint & tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tahul committed Nov 19, 2023
1 parent 8d1694a commit 31748c1
Show file tree
Hide file tree
Showing 113 changed files with 4,008 additions and 3,479 deletions.
8 changes: 4 additions & 4 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
"preview": "nuxt preview"
},
"devDependencies": {
"@nuxt/content": "^2.8.5",
"@nuxt/content": "^2.9.0",
"@nuxt/devtools": "latest",
"@pinceau/nuxt": "workspace:*",
"@pinceau/palette": "workspace:*",
"@vueuse/motion": "^2.0.0",
"nuxt": "^3.8.0",
"nuxt-icon": "^0.5.0",
"vue": "^3.3.6",
"nuxt": "^3.8.1",
"nuxt-icon": "^0.6.6",
"vue": "^3.3.8",
"vue-router": "^4.2.5"
}
}
1 change: 1 addition & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default antfu(
'jsdoc/require-returns': 'off',
'ts/no-namespace': 'off',
'new-cap': 'off',
'vue/require-explicit-emits': 'off',
},
},
{
Expand Down
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.6"
"vue": "^3.3.8"
},
"devDependencies": {
"@astrojs/svelte": "^4.0.3",
"@astrojs/svelte": "^4.0.4",
"@pinceau/astro": "workspace:*",
"@pinceau/configs": "workspace:*",
"@pinceau/palette": "workspace:*",
"@pinceau/outputs": "workspace:*", "@pinceau/svelte": "workspace:*",
"astro": "^3.3.2"
"astro": "^3.5.5"
},
"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.6"
"vue": "^3.3.8"
},
"devDependencies": {
"@astrojs/vue": "^3.0.1",
"@astrojs/vue": "^3.0.4",
"@pinceau/astro": "workspace:*",
"@pinceau/configs": "workspace:*",
"@pinceau/palette": "workspace:*",
"@pinceau/outputs": "workspace:*", "@pinceau/vue": "workspace:*",
"astro": "^3.3.2"
"astro": "^3.5.5"
},
"stackblitz": {
"installDependencies": false,
Expand Down
4 changes: 2 additions & 2 deletions examples/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
},
"devDependencies": {
"@pinceau/astro": "workspace:*",
"astro": "^3.3.2",
"canvas-confetti": "^1.9.0"
"astro": "^3.5.5",
"canvas-confetti": "^1.9.1"
},
"stackblitz": {
"installDependencies": false,
Expand Down
2 changes: 1 addition & 1 deletion examples/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"devDependencies": {
"@pinceau/configs": "workspace:*",
"@pinceau/palette": "workspace:*",
"@pinceau/outputs": "workspace:*", "nuxt": "^3.8.0"
"@pinceau/outputs": "workspace:*", "nuxt": "^3.8.1"
},
"stackblitz": {
"installDependencies": false,
Expand Down
10 changes: 5 additions & 5 deletions examples/sveltekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
"@pinceau/configs": "workspace:*",
"@pinceau/palette": "workspace:*",
"@pinceau/outputs": "workspace:*", "@pinceau/svelte": "workspace:*",
"@sveltejs/adapter-auto": "^2.1.0",
"@sveltejs/kit": "^1.26.0",
"svelte": "^4.2.2",
"svelte-check": "^3.5.2",
"@sveltejs/adapter-auto": "^2.1.1",
"@sveltejs/kit": "^1.27.6",
"svelte": "^4.2.5",
"svelte-check": "^3.6.0",
"tslib": "^2.6.2",
"typescript": "^5.2.2",
"vite": "4.5.0"
"vite": "5.0.0"
},
"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 @@ -15,6 +15,6 @@
"@pinceau/configs": "workspace:*",
"@pinceau/palette": "workspace:*",
"@pinceau/outputs": "workspace:*", "typescript": "^5.2.2",
"vite": "^4.5.0"
"vite": "^5.0.0"
}
}
4 changes: 2 additions & 2 deletions examples/vite-lit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
"dev": "vite --port=3000"
},
"dependencies": {
"lit": "^3.0.0"
"lit": "^3.1.0"
},
"devDependencies": {
"@pinceau/configs": "workspace:*",
"@pinceau/palette": "workspace:*",
"@pinceau/outputs": "workspace:*", "pinceau": "workspace:*",
"typescript": "^5.2.2",
"vite": "^4.5.0"
"vite": "^5.0.0"
},
"stackblitz": {
"installDependencies": false,
Expand Down
8 changes: 4 additions & 4 deletions examples/vite-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
"preview": "vite preview"
},
"dependencies": {
"preact": "^10.18.1"
"preact": "^10.19.2"
},
"devDependencies": {
"@pinceau/configs": "workspace:*",
"@pinceau/palette": "workspace:*",
"@pinceau/outputs": "workspace:*", "@pinceau/react": "workspace:*",
"@preact/preset-vite": "^2.6.0",
"@prefresh/vite": "^2.4.1",
"@preact/preset-vite": "^2.7.0",
"@prefresh/vite": "^2.4.4",
"cross-env": "^7.0.3",
"typescript": "^5.2.2",
"vite": "^4.5.0"
"vite": "^5.0.0"
},
"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/palette": "workspace:*",
"@pinceau/outputs": "workspace:*",
"@pinceau/react": "workspace:*",
"@types/node": "20.8.7",
"@types/node": "20.9.2",
"@types/react": "latest",
"@types/react-dom": "latest",
"@vitejs/plugin-react": "^4.1.0",
"@vitejs/plugin-react": "^4.2.0",
"cross-env": "^7.0.3",
"typescript": "^5.2.2",
"vite": "^4.5.0"
"vite": "^5.0.0"
},
"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.3"
"solid-js": "^1.8.5"
},
"devDependencies": {
"@pinceau/configs": "workspace:*",
"@pinceau/palette": "workspace:*",
"@pinceau/outputs": "workspace:*", "@pinceau/react": "workspace:*",
"typescript": "^5.2.2",
"vite": "^4.5.0",
"vite-plugin-inspect": "^0.7.40",
"vite": "^5.0.0",
"vite-plugin-inspect": "^0.7.42",
"vite-plugin-solid": "^2.7.2"
},
"stackblitz": {
Expand Down
10 changes: 5 additions & 5 deletions examples/vite-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
"@pinceau/palette": "workspace:*",
"@pinceau/outputs": "workspace:*",
"@pinceau/svelte": "workspace:*",
"@sveltejs/vite-plugin-svelte": "^2.4.6",
"svelte": "^4.2.2",
"svelte-check": "^3.5.2",
"svelte-preprocess": "^5.0.4",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"svelte": "^4.2.5",
"svelte-check": "^3.6.0",
"svelte-preprocess": "^5.1.0",
"tslib": "^2.6.2",
"typescript": "^5.2.2",
"vite": "^4.5.0"
"vite": "^5.0.0"
},
"stackblitz": {
"installDependencies": false,
Expand Down
2 changes: 1 addition & 1 deletion examples/vite-svelte/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<div>
<main on:click={onClick} class={main}>Hello world</main>

<TestComponent color="red" size={test}>
<TestComponent color="blue" size={test}>
hello
</TestComponent>
</div>
21 changes: 0 additions & 21 deletions examples/vite-vue/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,3 @@ const CircleComponent = $styled.div<{ color: 'red' | 'blue' }>({
<div class="dot-background" />
</App>
</template>

<style lang="ts">
styled({
variants: {
size: {
sm: {
padding: '$space.1'
},
md: {
padding: '$space.2'
},
lg: {
padding: '$space.4'
}
},
options: {
default: 'sm'
}
}
})
</style>
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.5.0",
"vue": "^3.3.6",
"@vueuse/core": "^10.6.1",
"vue": "^3.3.8",
"vue-router": "^4.2.5"
},
"devDependencies": {
"@pinceau/configs": "workspace:*",
"@pinceau/palette": "workspace:*",
"@pinceau/outputs": "workspace:*",
"@pinceau/vue": "workspace:*",
"@vitejs/plugin-vue": "^4.4.0",
"@vitejs/plugin-vue": "^4.5.0",
"typescript": "^5.2.2",
"vite": "^4.5.0"
"vite": "^5.0.0"
},
"stackblitz": {
"installDependencies": false,
Expand Down
2 changes: 1 addition & 1 deletion integrations/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"dependencies": {
"@pinceau/core": "workspace:*",
"@pinceau/integration": "workspace:*",
"acorn": "^8.10.0"
"acorn": "^8.11.2"
},
"devDependencies": {
"@pinceau/configs": "workspace:*"
Expand Down
1 change: 0 additions & 1 deletion integrations/astro/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { PinceauPluginsOptions } from '@pinceau/core'
import type { PinceauAstroOptions } from './types'

declare module '@pinceau/core' {
Expand Down
4 changes: 2 additions & 2 deletions integrations/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
"@pinceau/svelte": "workspace:*",
"@pinceau/theme": "workspace:*",
"@pinceau/vue": "workspace:*",
"jiti": "^1.20.0",
"tsup": "^7.2.0"
"jiti": "^1.21.0",
"tsup": "^7.3.0"
},
"dependencies": {
"esbuild-plugin-pipe": "^0.2.0",
Expand Down
8 changes: 4 additions & 4 deletions integrations/language-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"@pinceau/theme": "workspace:*",
"@pinceau/core": "workspace:*",
"@pinceau/style": "workspace:*",
"@vue/compiler-sfc": "^3.3.6",
"fast-glob": "^3.3.1",
"@vue/compiler-sfc": "^3.3.8",
"fast-glob": "^3.3.2",
"line-column": "^1.0.2",
"tinycolor2": "1.6.0",
"vscode-languageserver": "^9.0.1",
Expand All @@ -40,7 +40,7 @@
},
"devDependencies": {
"@pinceau/configs": "workspace:*",
"@types/line-column": "^1.0.1",
"@types/tinycolor2": "^1.4.5"
"@types/line-column": "^1.0.2",
"@types/tinycolor2": "^1.4.6"
}
}
7 changes: 3 additions & 4 deletions integrations/language-server/src/features/completion.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import type { CompletionItem, TextDocumentPositionParams } from 'vscode-languageserver'
import type { PinceauExtension } from '..'
import { getCursorContext } from '../utils/getCursorContext'

export function registerCompletion(
context: PinceauExtension,
) {
const { connection, documents, tokensManager, documentReady, rootPath, getStyleFunctions } = context
const { connection, documents, documentReady } = context

// This handler provides the initial list of the completion items.
connection.onCompletion(async (textDocumentPosition: TextDocumentPositionParams): Promise<CompletionItem[]> => {
Expand All @@ -14,9 +13,9 @@ export function registerCompletion(
const doc = documents.get(textDocumentPosition.textDocument.uri)
if (!doc) { return [] }

const styleFns = getStyleFunctions(doc)
// const styleFns = getStyleFunctions(doc)

const { isInStringExpression, isOffsetOnStyleTsTag, isTokenFunctionCall } = getCursorContext(doc, textDocumentPosition.position, styleFns)
// const { isInStringExpression, isOffsetOnStyleTsTag, isTokenFunctionCall } = getCursorContext(doc, textDocumentPosition.position, styleFns)

// Create completion symbols
const items: CompletionItem[] = []
Expand Down
8 changes: 4 additions & 4 deletions integrations/language-server/src/features/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function setupTokensHelpers(
doc: TextDocument,
_styleFns?: PinceauStyleFunctionContext[],
settings?: PinceauVSCodeSettings,
onToken?: (token: { match: RegExpMatchArray; tokenPath: string; range: Range; settings?: PinceauVSCodeSettings; token?: DesignToken; localToken?: any }) => void,
onToken?: (token: { match: RegExpMatchArray, tokenPath: string, range: Range, settings?: PinceauVSCodeSettings, token?: DesignToken, localToken?: any }) => void,
) {
const colors: ColorInformation[] = []

Expand Down Expand Up @@ -110,12 +110,12 @@ export function setupTokensHelpers(
) {
const toRet: {
delimiter: string
currentLine?: { text: string; range: { start: number; end: number } }
currentToken?: { token: string; range: { start: number; end: number } }
currentLine?: { text: string, range: { start: number, end: number } }
currentToken?: { token: string, range: { start: number, end: number } }
closestToken?: any
token?: any
localToken?: any
lineRange?: { start: number; end: number }
lineRange?: { start: number, end: number }
} = {
delimiter: '$',
currentToken: undefined,
Expand Down
2 changes: 1 addition & 1 deletion integrations/language-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { setupExtension } from './config'
import { setupTokensHelpers } from './features/tokens'
import * as features from './features'

export interface DocumentTokensData { version: number; styleFns: PinceauStyleFunctionContext[] }
export interface DocumentTokensData { version: number, styleFns: PinceauStyleFunctionContext[] }

export { PinceauTokensManager, setupExtension, setupTokensHelpers, features }

Expand Down
4 changes: 2 additions & 2 deletions integrations/language-server/src/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ async function globRequire(folderPath: string, globPaths: string[], cb: (filePat
export default class PinceauTokensManager {
public initialized = false
public synchronizing: Promise<void> | false = false
private tokensCache = new CacheManager<DesignToken & { definition: Location; color?: Color }>()
private transformCache = new CacheManager<{ version: number; styleFns: PinceauStyleFunctionContext[] }>()
private tokensCache = new CacheManager<DesignToken & { definition: Location, color?: Color }>()
private transformCache = new CacheManager<{ version: number, styleFns: PinceauStyleFunctionContext[] }>()

public async syncTokens(folders: string[], settings: Partial<PinceauVSCodeSettings>) {
this.synchronizing = this.scanFolders(folders, settings)
Expand Down
2 changes: 1 addition & 1 deletion integrations/language-server/src/utils/findStringRange.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Position } from 'vscode-languageserver'

export function findStringRange(text: string, target: string, position: Position, delimiter = '$'): { start: number; end: number } {
export function findStringRange(text: string, target: string, position: Position, delimiter = '$'): { start: number, end: number } {
const toRet = {
start: -1,
end: -1,
Expand Down
2 changes: 1 addition & 1 deletion integrations/language-server/src/utils/getCurrentLine.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Position, TextDocument } from 'vscode-languageserver-textdocument'

export function getCurrentLine(document: TextDocument, position: Position): { text: string; range: { start: number; end: number } } {
export function getCurrentLine(document: TextDocument, position: Position): { text: string, range: { start: number, end: number } } {
const text = document.getText()
const lines = text.split('\n')
const line = lines[position.line]
Expand Down
Loading

0 comments on commit 31748c1

Please sign in to comment.