@digdir/designsystemet 0.1.0-alpha.3 → 0.1.0-alpha.4

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 (45) hide show
  1. package/dist/build/bin/designsystemet.js +1 -1
  2. package/dist/build/src/migrations/beta-to-v1.js +64 -6
  3. package/dist/build/src/migrations/codemods/jsx/run.js +19 -0
  4. package/dist/build/src/migrations/index.js +3 -1
  5. package/dist/build/src/migrations/react-beta-to-v1.js +2 -0
  6. package/dist/build/src/test/jsx-test.js +1 -1
  7. package/dist/build/src/tokens/actions.js +13 -0
  8. package/dist/build/src/tokens/build.js +84 -38
  9. package/dist/build/src/tokens/formats/groupedTokens.js +28 -0
  10. package/dist/build/src/tokens/{formatters.js → formats/scopedReferenceVariables.js} +2 -30
  11. package/dist/build/src/tokens/formats/typographyClasses.js +31 -0
  12. package/dist/build/src/tokens/transformers.js +7 -6
  13. package/dist/build/tsconfig.tsbuildinfo +1 -1
  14. package/dist/types/src/migrations/beta-to-v1.d.ts.map +1 -1
  15. package/dist/types/src/migrations/codemods/css/plugins.d.ts.map +1 -0
  16. package/dist/types/src/migrations/codemods/css/run.d.ts.map +1 -0
  17. package/dist/types/src/migrations/codemods/jsx/classname-prefix.d.ts.map +1 -0
  18. package/dist/types/src/migrations/codemods/jsx/run.d.ts +7 -0
  19. package/dist/types/src/migrations/codemods/jsx/run.d.ts.map +1 -0
  20. package/dist/types/src/migrations/index.d.ts +2 -1
  21. package/dist/types/src/migrations/index.d.ts.map +1 -1
  22. package/dist/types/src/migrations/react-beta-to-v1.d.ts +3 -0
  23. package/dist/types/src/migrations/react-beta-to-v1.d.ts.map +1 -0
  24. package/dist/types/src/test/jsx-test.d.ts.map +1 -1
  25. package/dist/types/src/tokens/actions.d.ts +3 -0
  26. package/dist/types/src/tokens/actions.d.ts.map +1 -0
  27. package/dist/types/src/tokens/build.d.ts.map +1 -1
  28. package/dist/types/src/tokens/formats/groupedTokens.d.ts +6 -0
  29. package/dist/types/src/tokens/formats/groupedTokens.d.ts.map +1 -0
  30. package/dist/types/src/tokens/{formatters.d.ts → formats/scopedReferenceVariables.d.ts} +1 -5
  31. package/dist/types/src/tokens/formats/scopedReferenceVariables.d.ts.map +1 -0
  32. package/dist/types/src/tokens/formats/typographyClasses.d.ts +6 -0
  33. package/dist/types/src/tokens/formats/typographyClasses.d.ts.map +1 -0
  34. package/dist/types/src/tokens/transformers.d.ts.map +1 -1
  35. package/package.json +11 -12
  36. package/dist/types/src/codemods/css/plugins.d.ts.map +0 -1
  37. package/dist/types/src/codemods/css/run.d.ts.map +0 -1
  38. package/dist/types/src/codemods/jsx/classname-prefix.d.ts.map +0 -1
  39. package/dist/types/src/tokens/formatters.d.ts.map +0 -1
  40. /package/dist/build/src/{codemods → migrations/codemods}/css/plugins.js +0 -0
  41. /package/dist/build/src/{codemods → migrations/codemods}/css/run.js +0 -0
  42. /package/dist/build/src/{codemods → migrations/codemods}/jsx/classname-prefix.js +0 -0
  43. /package/dist/types/src/{codemods → migrations/codemods}/css/plugins.d.ts +0 -0
  44. /package/dist/types/src/{codemods → migrations/codemods}/css/run.d.ts +0 -0
  45. /package/dist/types/src/{codemods → migrations/codemods}/jsx/classname-prefix.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"beta-to-v1.d.ts","sourceRoot":"","sources":["../../../../src/migrations/beta-to-v1.ts"],"names":[],"mappings":"gCAGuB,MAAM;AAA7B,wBAuRK"}
1
+ {"version":3,"file":"beta-to-v1.d.ts","sourceRoot":"","sources":["../../../../src/migrations/beta-to-v1.ts"],"names":[],"mappings":"gCAGuB,MAAM;AAA7B,wBAiVK"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../../../../src/migrations/codemods/css/plugins.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAe,MAAM,SAAS,CAAC;AAInD,KAAK,eAAe,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC;AAOtE,eAAO,MAAM,cAAc,EAAE,eAe3B,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,eA6BzB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../../../../src/migrations/codemods/css/run.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAI9C,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,aAAa,6BAAwD,eAAe,kBAkBhG,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classname-prefix.d.ts","sourceRoot":"","sources":["../../../../../../src/migrations/codemods/jsx/classname-prefix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAmB,MAAM,aAAa,CAAC;AAoElE;;;;;GAKG;AACH,iBAAS,sBAAsB,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAiB5E;AAED,eAAe,sBAAsB,CAAC"}
@@ -0,0 +1,7 @@
1
+ type CssCodemodProps = {
2
+ globPattern?: string;
3
+ dry?: boolean;
4
+ };
5
+ export declare const runJSXCodemod: ({ globPattern, dry }: CssCodemodProps) => Promise<void>;
6
+ export {};
7
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../../../../src/migrations/codemods/jsx/run.ts"],"names":[],"mappings":"AAKA,KAAK,eAAe,GAAG;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAIF,eAAO,MAAM,aAAa,yBAA+C,eAAe,kBAiBvF,CAAC"}
@@ -1,5 +1,6 @@
1
1
  declare const _default: {
2
- 'beta-to-v1': (glob?: string | undefined) => Promise<void>;
2
+ 'css-beta-to-v1': (glob?: string | undefined) => Promise<void>;
3
+ 'react-beta-to-v1': (glob?: string | undefined) => Promise<void>;
3
4
  };
4
5
  export default _default;
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/migrations/index.ts"],"names":[],"mappings":";;;AAEA,wBAEE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/migrations/index.ts"],"names":[],"mappings":";;;;AAGA,wBAGE"}
@@ -0,0 +1,3 @@
1
+ declare const _default: (glob?: string) => Promise<void>;
2
+ export default _default;
3
+ //# sourceMappingURL=react-beta-to-v1.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-beta-to-v1.d.ts","sourceRoot":"","sources":["../../../../src/migrations/react-beta-to-v1.ts"],"names":[],"mappings":"gCAEuB,MAAM;AAA7B,wBAAuE"}
@@ -1 +1 @@
1
- {"version":3,"file":"jsx-test.d.ts","sourceRoot":"","sources":["../../../../src/test/jsx-test.tsx"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,2CA2BpE"}
1
+ {"version":3,"file":"jsx-test.d.ts","sourceRoot":"","sources":["../../../../src/test/jsx-test.tsx"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,2CA6BpE"}
@@ -0,0 +1,3 @@
1
+ import type { Action } from 'style-dictionary/types';
2
+ export declare const makeEntryFile: Action;
3
+ //# sourceMappingURL=actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../src/tokens/actions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,eAAO,MAAM,aAAa,EAAE,MAU3B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../src/tokens/build.ts"],"names":[],"mappings":"AAkHA,KAAK,OAAO,GAAG;IACb,0BAA0B;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,8BAA8B;IAC9B,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAIF,wBAAsB,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAwEzD"}
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../src/tokens/build.ts"],"names":[],"mappings":"AAkKA,KAAK,OAAO,GAAG;IACb,0BAA0B;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,8BAA8B;IAC9B,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAkCF,wBAAsB,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAgEzD"}
@@ -0,0 +1,6 @@
1
+ import type { Format } from 'style-dictionary/types';
2
+ /**
3
+ * Format for displaying tokens in storefront
4
+ */
5
+ export declare const groupedTokens: Format;
6
+ //# sourceMappingURL=groupedTokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"groupedTokens.d.ts","sourceRoot":"","sources":["../../../../../src/tokens/formats/groupedTokens.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAoB,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAYvE;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAyB3B,CAAC"}
@@ -3,8 +3,4 @@ import type { Format } from 'style-dictionary/types';
3
3
  * CSS variables format with option to include source references for matched token through `options.referencesFilter`
4
4
  */
5
5
  export declare const scopedReferenceVariables: Format;
6
- /**
7
- * Format for displaying tokens in storefront
8
- */
9
- export declare const groupedTokens: Format;
10
- //# sourceMappingURL=formatters.d.ts.map
6
+ //# sourceMappingURL=scopedReferenceVariables.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scopedReferenceVariables.d.ts","sourceRoot":"","sources":["../../../../../src/tokens/formats/scopedReferenceVariables.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAKvE;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,MA2DtC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { Format } from 'style-dictionary/types';
2
+ /**
3
+ * Creates CSS classes from typography tokens
4
+ */
5
+ export declare const typographyClasses: Format;
6
+ //# sourceMappingURL=typographyClasses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typographyClasses.d.ts","sourceRoot":"","sources":["../../../../../src/tokens/formats/typographyClasses.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAYrD;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,MA+B/B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"transformers.d.ts","sourceRoot":"","sources":["../../../../src/tokens/transformers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAIxD,eAAO,MAAM,OAAO,EAAE,SAiBrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,SASvB,CAAC;AASF,eAAO,MAAM,mBAAmB,EAAE,SAcjC,CAAC"}
1
+ {"version":3,"file":"transformers.d.ts","sourceRoot":"","sources":["../../../../src/tokens/transformers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAIxD,eAAO,MAAM,OAAO,EAAE,SAkBrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,SASvB,CAAC;AASF,eAAO,MAAM,mBAAmB,EAAE,SAcjC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digdir/designsystemet",
3
- "version": "0.1.0-alpha.3",
3
+ "version": "0.1.0-alpha.4",
4
4
  "description": "CLI for Designsystemet",
5
5
  "author": "Designsystemet team",
6
6
  "repository": {
@@ -14,29 +14,21 @@
14
14
  "access": "public"
15
15
  },
16
16
  "scripts": {
17
- "designsystemet": "esno ./bin/designsystemet.ts",
17
+ "designsystemet": "tsx ./bin/designsystemet.ts",
18
18
  "build:tokens": "yarn clean:theme && yarn designsystemet tokens -p -t ../../design-tokens -o ../../packages/theme/brand",
19
19
  "build": "yarn clean && tsc",
20
20
  "prepublish:tsup": "yarn clean && tsup src/**/*.ts bin/designsystemet.ts --cjsInterop --shims --format esm",
21
21
  "clean": "rimraf dist",
22
- "clean:theme": "yarn workspace @digdir/designsystemet-theme clean",
23
- "css-classes": "yarn designsystemet css-names",
24
- "jscodeshift": "jscodeshift -t ./src/codemods/jsx/classname-prefix.ts ./src/test/**/* --extensions=tsx --parser=tsx",
25
- "jscodeshift-react": "jscodeshift -t ./src/codemods/jsx/classname-prefix.ts ../../packages/react/src/components/Button/**/* --extensions=tsx --parser=tsx"
22
+ "clean:theme": "yarn workspace @digdir/designsystemet-theme clean"
26
23
  },
27
24
  "files": [
28
25
  "./dist/**"
29
26
  ],
30
27
  "bin": "dist/build/bin/designsystemet.js",
31
28
  "dependencies": {
32
- "@commander-js/extra-typings": "^12.0.1",
33
29
  "@tokens-studio/sd-transforms": "^0.16.0",
34
- "@types/glob": "^8.1.0",
35
- "@types/node": "^20.12.7",
36
- "@types/ramda": "^0.29.9",
37
30
  "chalk": "^5.3.0",
38
31
  "commander": "^12.0.0",
39
- "esno": "^4.7.0",
40
32
  "fast-glob": "^3.3.2",
41
33
  "jscodeshift": "^0.15.2",
42
34
  "object-hash": "^3.0.0",
@@ -47,9 +39,16 @@
47
39
  "tsup": "^8.0.2"
48
40
  },
49
41
  "devDependencies": {
42
+ "@commander-js/extra-typings": "^12.0.1",
43
+ "@types/fs-extra": "^11.0.4",
44
+ "@types/glob": "^8.1.0",
50
45
  "@types/jscodeshift": "^0.11.11",
46
+ "@types/node": "^20.12.7",
51
47
  "@types/object-hash": "^3",
48
+ "@types/ramda": "^0.29.9",
49
+ "fs-extra": "^11.2.0",
50
+ "tsx": "^4.11.2",
52
51
  "typescript": "^5.4.5"
53
52
  },
54
- "gitHead": "f9920518e77e01f2f77095ef30f8d4c62deafd51"
53
+ "gitHead": "d7e07e452da4267f1c2d28ba3e8b6f7acd0d4cb1"
55
54
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../../../src/codemods/css/plugins.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAe,MAAM,SAAS,CAAC;AAInD,KAAK,eAAe,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC;AAOtE,eAAO,MAAM,cAAc,EAAE,eAe3B,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,eA6BzB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../../../src/codemods/css/run.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAI9C,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,aAAa,6BAAwD,eAAe,kBAkBhG,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"classname-prefix.d.ts","sourceRoot":"","sources":["../../../../../src/codemods/jsx/classname-prefix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAmB,MAAM,aAAa,CAAC;AAoElE;;;;;GAKG;AACH,iBAAS,sBAAsB,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAiB5E;AAED,eAAe,sBAAsB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../../../src/tokens/formatters.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAoB,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAKvE;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,MA6DtC,CAAC;AAWF;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAyB3B,CAAC"}