@knighted/css 1.0.0-rc.7 → 1.0.0-rc.9

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.
Files changed (41) hide show
  1. package/bin/generate-types.js +31 -0
  2. package/dist/cjs/css.cjs +73 -21
  3. package/dist/cjs/css.d.cts +5 -4
  4. package/dist/cjs/generateTypes.cjs +529 -0
  5. package/dist/cjs/generateTypes.d.cts +54 -0
  6. package/dist/cjs/loader.cjs +51 -27
  7. package/dist/cjs/loader.d.cts +1 -0
  8. package/dist/cjs/loaderInternals.cjs +38 -1
  9. package/dist/cjs/loaderInternals.d.cts +7 -0
  10. package/dist/cjs/moduleGraph.cjs +431 -0
  11. package/dist/cjs/moduleGraph.d.cts +15 -0
  12. package/dist/cjs/sassInternals.cjs +6 -3
  13. package/dist/cjs/sassInternals.d.cts +3 -4
  14. package/dist/cjs/stableNamespace.cjs +12 -0
  15. package/dist/cjs/stableNamespace.d.cts +3 -0
  16. package/dist/cjs/stableSelectorsLiteral.cjs +104 -0
  17. package/dist/cjs/stableSelectorsLiteral.d.cts +19 -0
  18. package/dist/cjs/types.cjs +2 -0
  19. package/dist/cjs/types.d.cts +4 -0
  20. package/dist/css.d.ts +5 -4
  21. package/dist/css.js +73 -21
  22. package/dist/generateTypes.d.ts +54 -0
  23. package/dist/generateTypes.js +521 -0
  24. package/dist/loader.d.ts +1 -0
  25. package/dist/loader.js +50 -26
  26. package/dist/loaderInternals.d.ts +7 -0
  27. package/dist/loaderInternals.js +33 -0
  28. package/dist/moduleGraph.d.ts +15 -0
  29. package/dist/moduleGraph.js +425 -0
  30. package/dist/sassInternals.d.ts +3 -4
  31. package/dist/sassInternals.js +6 -3
  32. package/dist/stableNamespace.d.ts +3 -0
  33. package/dist/stableNamespace.js +8 -0
  34. package/dist/stableSelectorsLiteral.d.ts +19 -0
  35. package/dist/stableSelectorsLiteral.js +98 -0
  36. package/dist/types.d.ts +4 -0
  37. package/dist/types.js +1 -0
  38. package/loader-queries.d.ts +28 -0
  39. package/package.json +23 -11
  40. package/types-stub/index.d.ts +5 -0
  41. package/types.d.ts +1 -0
@@ -6,6 +6,13 @@ declare module '*?knighted-css' {
6
6
  export const knightedCss: string
7
7
  }
8
8
 
9
+ type KnightedCssStableSelectorMap = Readonly<Record<string, string>>
10
+
11
+ declare module '*?knighted-css&types' {
12
+ export const knightedCss: string
13
+ export const stableSelectors: KnightedCssStableSelectorMap
14
+ }
15
+
9
16
  /**
10
17
  * Ambient declaration for combined loader imports (e.g. "./file.tsx?knighted-css&combined").
11
18
  * These modules behave like the original module with an additional `knightedCss` export.
@@ -31,3 +38,24 @@ declare module '*?knighted-css&combined&no-default' {
31
38
  export default combined
32
39
  export const knightedCss: string
33
40
  }
41
+
42
+ declare module '*?knighted-css&combined&types' {
43
+ const combined: KnightedCssCombinedModule<Record<string, unknown>>
44
+ export default combined
45
+ export const knightedCss: string
46
+ export const stableSelectors: KnightedCssStableSelectorMap
47
+ }
48
+
49
+ declare module '*?knighted-css&combined&named-only&types' {
50
+ const combined: KnightedCssCombinedModule<Record<string, unknown>>
51
+ export default combined
52
+ export const knightedCss: string
53
+ export const stableSelectors: KnightedCssStableSelectorMap
54
+ }
55
+
56
+ declare module '*?knighted-css&combined&no-default&types' {
57
+ const combined: KnightedCssCombinedModule<Record<string, unknown>>
58
+ export default combined
59
+ export const knightedCss: string
60
+ export const stableSelectors: KnightedCssStableSelectorMap
61
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knighted/css",
3
- "version": "1.0.0-rc.7",
3
+ "version": "1.0.0-rc.9",
4
4
  "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.",
5
5
  "type": "module",
6
6
  "main": "./dist/css.js",
@@ -13,6 +13,9 @@
13
13
  "loader-queries": [
14
14
  "./loader-queries.d.ts"
15
15
  ],
16
+ "generate-types": [
17
+ "./dist/generateTypes.d.ts"
18
+ ],
16
19
  "*": [
17
20
  "./types.d.ts"
18
21
  ]
@@ -33,6 +36,11 @@
33
36
  "types": "./loader-queries.d.ts",
34
37
  "default": "./loader-queries.d.ts"
35
38
  },
39
+ "./generate-types": {
40
+ "types": "./dist/generateTypes.d.ts",
41
+ "import": "./dist/generateTypes.js",
42
+ "default": "./dist/generateTypes.js"
43
+ },
36
44
  "./stableSelectors": {
37
45
  "types": "./dist/stableSelectors.d.ts",
38
46
  "import": "./dist/stableSelectors.js",
@@ -58,21 +66,23 @@
58
66
  "vanilla-extract",
59
67
  "lightningcss"
60
68
  ],
69
+ "bin": {
70
+ "knighted-css-generate-types": "./bin/generate-types.js"
71
+ },
61
72
  "scripts": {
62
- "build": "duel",
63
- "check-types": "tsc --noEmit",
73
+ "build": "duel && node ./scripts/copy-types-stub.js",
74
+ "check-types": "tsc --noEmit --project tsconfig.json && tsc --noEmit --project tsconfig.tests.json",
64
75
  "test": "c8 --reporter=text --reporter=text-summary --reporter=lcov --include \"src/**/*.ts\" tsx --test test/**/*.test.ts",
65
76
  "prepack": "npm run build"
66
77
  },
67
78
  "dependencies": {
68
- "dependency-tree": "^11.2.0",
69
79
  "es-module-lexer": "^2.0.0",
70
- "lightningcss": "^1.30.2"
71
- },
72
- "overrides": {
73
- "module-lookup-amd": {
74
- "glob": "^9.0.0"
75
- }
80
+ "lightningcss": "^1.30.2",
81
+ "node-module-type": "^1.0.1",
82
+ "get-tsconfig": "^4.13.0",
83
+ "oxc-parser": "^0.104.0",
84
+ "oxc-resolver": "^11.16.0",
85
+ "tsconfig-paths": "^4.2.0"
76
86
  },
77
87
  "peerDependencies": {
78
88
  "@vanilla-extract/integration": "^8.0.0",
@@ -94,7 +104,9 @@
94
104
  "dist",
95
105
  "loader-queries.d.ts",
96
106
  "types.d.ts",
97
- "stable"
107
+ "stable",
108
+ "bin",
109
+ "types-stub"
98
110
  ],
99
111
  "author": "KCM <knightedcodemonkey@gmail.com>",
100
112
  "license": "MIT",
@@ -0,0 +1,5 @@
1
+ // Placeholder stub for @knighted/css stable selector declarations.
2
+ // Running `knighted-css-generate-types` replaces this file with project-specific
3
+ // references into the generated `.knighted-css` manifest.
4
+
5
+ export {}
package/types.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  /// <reference path="./loader-queries.d.ts" />
2
+ /// <reference path="./types-stub/index.d.ts" />
2
3
 
3
4
  export * from './dist/css.js'