Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/css/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@knighted/css",
"version": "1.1.0-rc.1",
"version": "1.1.0-rc.2",
"description": "A build-time utility that traverses JavaScript/TypeScript module dependency graphs to extract, compile, and optimize all imported CSS into a single, in-memory string.",
"type": "module",
"main": "./dist/css.js",
Expand Down
11 changes: 6 additions & 5 deletions packages/css/src/generateTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ function formatSelectorModuleSource(
selectors: Map<string, string>,
proxyInfo?: SelectorModuleProxyInfo,
): string {
const header = '// Generated by @knighted/css/generate-types\n// Do not edit.\n\n'
const header = '// Generated by @knighted/css/generate-types\n// Do not edit.'
const entries = Array.from(selectors.entries()).sort(([a], [b]) => a.localeCompare(b))
const lines = entries.map(
([token, selector]) => ` ${JSON.stringify(token)}: ${JSON.stringify(selector)},`,
Expand All @@ -450,14 +450,15 @@ ${lines.join('\n')}
proxyLines.push(
`export { knightedCss } from '${proxyInfo.moduleSpecifier}?knighted-css'`,
)
proxyLines.push('')
}
const defaultExport = proxyInfo ? '' : '\nexport default stableSelectors\n'
return `${header}${proxyLines.join('\n')}
export const stableSelectors = ${literal}
const defaultExport = proxyInfo ? '' : '\nexport default stableSelectors'
const stableBlock = `export const stableSelectors = ${literal}

export type KnightedCssStableSelectors = typeof stableSelectors
export type KnightedCssStableSelectorToken = keyof typeof stableSelectors${defaultExport}`
const sections = [header, proxyLines.join('\n'), stableBlock].filter(Boolean)
return `${sections.join('\n\n')}
`
}

function hashContent(content: string): string {
Expand Down
3 changes: 2 additions & 1 deletion packages/playwright/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"build:auto-stable": "rspack --config rspack.auto-stable.config.js",
"build:webpack": "webpack --config webpack.config.js",
"build:ssr": "tsx scripts/render-ssr-preview.ts",
"precheck-types": "npm run types",
"check-types": "tsc --noEmit",
"preview": "npm run build && http-server . -p 4174",
"preview:auto-stable": "npm run build:auto-stable && http-server . -p 4175",
Expand All @@ -20,7 +21,7 @@
"pretest": "npm run types && npm run build"
},
"dependencies": {
"@knighted/css": "1.1.0-rc.1",
"@knighted/css": "1.1.0-rc.2",
"@knighted/jsx": "^1.7.3",
"lit": "^3.2.1",
"react": "^19.0.0",
Expand Down