@efficiency-point/design-system 0.4.7 → 0.7.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 (37) hide show
  1. package/README.md +99 -4
  2. package/assets/favicon/android-chrome-192x192.png +0 -0
  3. package/assets/favicon/android-chrome-512x512.png +0 -0
  4. package/assets/favicon/apple-touch-icon.png +0 -0
  5. package/assets/favicon/apple-touch-icon.svg +13 -0
  6. package/assets/favicon/browserconfig.xml +9 -0
  7. package/assets/favicon/favicon-16x16.png +0 -0
  8. package/assets/favicon/favicon-32x32.png +0 -0
  9. package/assets/favicon/favicon-48x48.png +0 -0
  10. package/assets/favicon/favicon-links.html +6 -0
  11. package/assets/favicon/favicon-maskable.svg +13 -0
  12. package/assets/favicon/favicon-signal.svg +13 -0
  13. package/assets/favicon/favicon-teal.svg +13 -0
  14. package/assets/favicon/favicon.ico +0 -0
  15. package/assets/favicon/favicon.svg +13 -0
  16. package/assets/favicon/mstile-150x150.png +0 -0
  17. package/assets/favicon/pwa-maskable-192x192.png +0 -0
  18. package/assets/favicon/pwa-maskable-512x512.png +0 -0
  19. package/assets/favicon/safari-pinned-tab.svg +4 -0
  20. package/assets/favicon/site.webmanifest +33 -0
  21. package/assets/fonts/OFL-Play.txt +93 -0
  22. package/assets/fonts/Play-Bold.ttf +0 -0
  23. package/dist/brand/favicon.d.ts +25 -0
  24. package/dist/brand/favicon.d.ts.map +1 -0
  25. package/dist/components/DSDataTable/DSDataTable.d.ts.map +1 -1
  26. package/dist/components/DSLogo/DSLogo.d.ts +11 -0
  27. package/dist/components/DSLogo/DSLogo.d.ts.map +1 -0
  28. package/dist/components/DSServiceBrand/DSServiceBrand.d.ts +9 -0
  29. package/dist/components/DSServiceBrand/DSServiceBrand.d.ts.map +1 -0
  30. package/dist/components/DSThemeSwitcher/theme.d.ts.map +1 -1
  31. package/dist/index.cjs +2 -2
  32. package/dist/index.d.ts +3 -0
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.es.js +1190 -997
  35. package/dist/style.css +1 -1
  36. package/package.json +13 -4
  37. package/scripts/copy-favicons.mjs +70 -0
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Efficiency-point react design system",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
- "version": "0.4.7",
6
+ "version": "0.7.4",
7
7
  "publishConfig": {
8
8
  "access": "public",
9
9
  "registry": "https://registry.npmjs.org/"
@@ -12,15 +12,22 @@
12
12
  "module": "./dist/index.es.js",
13
13
  "types": "./dist/index.d.ts",
14
14
  "files": [
15
- "dist"
15
+ "dist",
16
+ "assets/favicon",
17
+ "assets/fonts",
18
+ "scripts/copy-favicons.mjs"
16
19
  ],
20
+ "bin": {
21
+ "ds-copy-favicons": "./scripts/copy-favicons.mjs"
22
+ },
17
23
  "exports": {
18
24
  ".": {
19
25
  "types": "./dist/index.d.ts",
20
26
  "import": "./dist/index.es.js",
21
27
  "require": "./dist/index.cjs"
22
28
  },
23
- "./styles.css": "./dist/style.css"
29
+ "./styles.css": "./dist/style.css",
30
+ "./assets/favicon/*": "./assets/favicon/*"
24
31
  },
25
32
  "sideEffects": [
26
33
  "**/*.css"
@@ -32,7 +39,9 @@
32
39
  "preview": "vite preview",
33
40
  "storybook": "storybook dev -p 6006",
34
41
  "build-storybook": "storybook build",
35
- "test": "vitest run",
42
+ "test": "vitest run && npm run test:assets",
43
+ "test:assets": "node --test tests/copy-favicons.test.mjs",
44
+ "generate:favicons": "node scripts/render-favicons.mjs",
36
45
  "test:coverage": "vitest run --coverage",
37
46
  "test:package": "npm run build && node tests/package-smoke.mjs",
38
47
  "pack:check": "npm pack --dry-run",
@@ -0,0 +1,70 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { constants, access, copyFile, mkdir } from 'node:fs/promises';
4
+ import { resolve } from 'node:path';
5
+ import process from 'node:process';
6
+ import { URL, fileURLToPath } from 'node:url';
7
+
8
+ const faviconFiles = [
9
+ 'favicon.svg',
10
+ 'favicon-signal.svg',
11
+ 'favicon-teal.svg',
12
+ 'favicon.ico',
13
+ 'favicon-16x16.png',
14
+ 'favicon-32x32.png',
15
+ 'favicon-48x48.png',
16
+ 'apple-touch-icon.png',
17
+ 'android-chrome-192x192.png',
18
+ 'android-chrome-512x512.png',
19
+ 'pwa-maskable-192x192.png',
20
+ 'pwa-maskable-512x512.png',
21
+ 'mstile-150x150.png',
22
+ 'safari-pinned-tab.svg',
23
+ 'site.webmanifest',
24
+ 'browserconfig.xml',
25
+ ];
26
+
27
+ const args = process.argv.slice(2);
28
+ const force = args.includes('--force');
29
+ const targetArgument = args.find((argument) => !argument.startsWith('--')) ?? 'public';
30
+ const unknownFlags = args.filter((argument) => argument.startsWith('--') && argument !== '--force' && argument !== '--help');
31
+
32
+ if (args.includes('--help')) {
33
+ process.stdout.write('Usage: ds-copy-favicons [target-directory] [--force]\n');
34
+ process.stdout.write('Default target directory: public\n');
35
+ process.exit(0);
36
+ }
37
+
38
+ if (unknownFlags.length > 0) {
39
+ throw new Error(`Unknown option: ${unknownFlags.join(', ')}`);
40
+ }
41
+
42
+ const sourceDirectory = fileURLToPath(new URL('../assets/favicon/', import.meta.url));
43
+ const targetDirectory = resolve(process.cwd(), targetArgument);
44
+
45
+ await mkdir(targetDirectory, { recursive: true });
46
+
47
+ if (!force) {
48
+ const existingFiles = [];
49
+
50
+ for (const fileName of faviconFiles) {
51
+ try {
52
+ await access(resolve(targetDirectory, fileName), constants.F_OK);
53
+ existingFiles.push(fileName);
54
+ } catch (error) {
55
+ if (error?.code !== 'ENOENT') throw error;
56
+ }
57
+ }
58
+
59
+ if (existingFiles.length > 0) {
60
+ throw new Error(`Target already contains favicon files: ${existingFiles.join(', ')}. Use --force to replace them.`);
61
+ }
62
+ }
63
+
64
+ await Promise.all(
65
+ faviconFiles.map((fileName) =>
66
+ copyFile(resolve(sourceDirectory, fileName), resolve(targetDirectory, fileName)),
67
+ ),
68
+ );
69
+
70
+ process.stdout.write(`Copied ${faviconFiles.length} favicon files to ${targetDirectory}\n`);