@birdapi/velinstyle 1.2.2 → 1.3.0

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 (109) hide show
  1. package/README.de.md +18 -4
  2. package/README.md +42 -7
  3. package/cli/cli-manifest.json +441 -174
  4. package/cli/docgen/extract-cli.js +2 -1
  5. package/cli/docs-generate.js +9 -0
  6. package/cli/experience.js +173 -0
  7. package/cli/index.js +1294 -417
  8. package/cli/motion.js +738 -0
  9. package/cli/production/extract.js +46 -6
  10. package/cli/production/report.js +104 -14
  11. package/cli/production/run.js +44 -1
  12. package/cli/security.js +190 -0
  13. package/cli/skills.js +53 -10
  14. package/cli/transparency.js +140 -41
  15. package/cli/workflow.js +32 -17
  16. package/components/velin-theme-toggle.js +15 -1
  17. package/core/a11y/component-contracts.json +391 -274
  18. package/core/attributes/registry.js +1 -1
  19. package/core/motion/analyze.js +38 -0
  20. package/core/motion/blueprint.js +51 -0
  21. package/core/motion/composer.js +114 -0
  22. package/core/motion/data/registry.json +352 -0
  23. package/core/motion/effects.js +17 -1
  24. package/core/motion/index.js +112 -9
  25. package/core/motion/optimize.js +44 -0
  26. package/core/motion/policy.js +77 -0
  27. package/core/motion/registry.js +131 -0
  28. package/core/motion/review.js +59 -0
  29. package/core/motion/scan.js +150 -0
  30. package/core/motion/timeline.js +68 -0
  31. package/core/motion/transitions.js +49 -0
  32. package/core/motion/triggers.js +168 -0
  33. package/core/security/checks/fs.js +92 -0
  34. package/core/security/detect.js +35 -0
  35. package/core/security/engine.js +116 -0
  36. package/core/security/index.js +18 -0
  37. package/core/security/registry.js +85 -0
  38. package/core/security/report/report.js +113 -0
  39. package/core/security/rules/ci/index.js +146 -0
  40. package/core/security/rules/consumer/index.js +174 -0
  41. package/core/security/rules/deps/index.js +182 -0
  42. package/core/security/rules/index.js +24 -0
  43. package/core/security/rules/publish/index.js +230 -0
  44. package/core/security/rules/repo/index.js +143 -0
  45. package/core/security/rules/secrets/index.js +133 -0
  46. package/core/security/score/dependency-health.js +53 -0
  47. package/core/security/score/release-health.js +66 -0
  48. package/core/security/score/score.js +102 -0
  49. package/core/security/timeline/timeline.js +76 -0
  50. package/dist/chunks/attributes-HK7VIOLA.js +1080 -0
  51. package/dist/chunks/attributes-VRHHVNDO.js +1080 -0
  52. package/dist/chunks/chunk-MYKUI364.js +116 -0
  53. package/dist/chunks/chunk-NEVBPD5T.js +116 -0
  54. package/dist/chunks/runtime-entry.js +1 -1
  55. package/dist/chunks/velin-theme-toggle-J2NHC7IM.js +304 -0
  56. package/dist/llms.txt +2 -2
  57. package/dist/search-index.json +166 -2
  58. package/dist/velin-agent.json +156 -32
  59. package/dist/velinstyle-components.iife.js +862 -17
  60. package/dist/velinstyle-components.js +862 -17
  61. package/dist/velinstyle-components.min.js +126 -126
  62. package/dist/velinstyle.css +42 -7
  63. package/dist/velinstyle.min.css +1 -1
  64. package/package.json +158 -143
  65. package/packages/velinstyle-cli-core/package.json +11 -0
  66. package/packages/velinstyle-cli-core/src/config.js +84 -0
  67. package/packages/velinstyle-cli-core/src/contract.js +56 -0
  68. package/packages/velinstyle-cli-core/src/event-bus.js +50 -0
  69. package/packages/velinstyle-cli-core/src/index.js +18 -0
  70. package/packages/velinstyle-cli-core/src/lifecycle.js +33 -0
  71. package/packages/velinstyle-cli-core/src/runner.js +129 -0
  72. package/packages/velinstyle-cli-registry/data/commands.json +1216 -0
  73. package/packages/velinstyle-cli-registry/data/layouts.json +33 -0
  74. package/packages/velinstyle-cli-registry/data/widgets.json +35 -0
  75. package/packages/velinstyle-cli-registry/package.json +13 -0
  76. package/packages/velinstyle-cli-registry/src/index.js +88 -0
  77. package/packages/velinstyle-cli-renderer/package.json +8 -0
  78. package/packages/velinstyle-cli-renderer/src/index.js +286 -0
  79. package/packages/velinstyle-cli-theme/package.json +8 -0
  80. package/packages/velinstyle-cli-theme/src/index.js +84 -0
  81. package/packages/velinstyle-cli-ui/package.json +8 -0
  82. package/packages/velinstyle-cli-ui/src/index.js +34 -0
  83. package/packages/velinstyle-motion/README.md +81 -0
  84. package/packages/velinstyle-motion/package.json +37 -0
  85. package/packages/velinstyle-motion/src/ai/mini-prompt.js +119 -0
  86. package/packages/velinstyle-motion/src/ai/provider.js +59 -0
  87. package/packages/velinstyle-motion/src/ai/providers/pixverse-setup.js +402 -0
  88. package/packages/velinstyle-motion/src/ai/providers/pixverse.js +245 -0
  89. package/packages/velinstyle-motion/src/config.js +257 -0
  90. package/packages/velinstyle-motion/src/export/html-clip.js +141 -0
  91. package/packages/velinstyle-motion/src/index.js +304 -0
  92. package/packages/velinstyle-motion/src/jobs/cache.js +30 -0
  93. package/packages/velinstyle-motion/src/jobs/queue.js +69 -0
  94. package/packages/velinstyle-motion/src/jobs/usage.js +53 -0
  95. package/packages/velinstyle-motion/src/local/effects.js +139 -0
  96. package/packages/velinstyle-motion/src/local/engine.js +96 -0
  97. package/packages/velinstyle-motion/src/providers-catalog.js +44 -0
  98. package/packages/velinstyle-motion/src/registry/presets.js +25 -0
  99. package/packages/velinstyle-motion/src/registry/presets.json +85 -0
  100. package/packages/velinstyle-motion/src/ux/cost-gate.js +37 -0
  101. package/packages/velinstyle-motion/src/ux/pixverse-gate.js +153 -0
  102. package/packages/velinstyle-motion/src/ux/wizard.js +171 -0
  103. package/packages/velinstyle-motion/src/validate-image.js +91 -0
  104. package/packages/velinstyle-skills/catalog.json +1 -1
  105. package/packages/velinstyle-skills/registry.json +1 -142
  106. package/packages/velinstyle-skills/skills/velin-motion-reduced-safe/SKILL.md +1 -1
  107. package/packages/velinstyle-skills/skills/velin-motion-reveal-feedback/SKILL.md +1 -1
  108. package/src/tokens/motion.css +7 -0
  109. package/src/utilities/scroll-animation.css +66 -0
package/package.json CHANGED
@@ -1,143 +1,158 @@
1
- {
2
- "name": "@birdapi/velinstyle",
3
- "version": "1.2.2",
4
- "publishConfig": {
5
- "access": "public",
6
- "registry": "https://registry.npmjs.org"
7
- },
8
- "types": "dist/velinstyle.d.ts",
9
- "sideEffects": [
10
- "components/index.js",
11
- "components/velin-*.js"
12
- ],
13
- "description": "WCAG 2.2 AAA CSS + Web Components: OKLCH themes, PII scanner, perf CLI, runtime tree-shaking. Ship inclusive UI faster.",
14
- "type": "module",
15
- "main": "dist/velinstyle.css",
16
- "module": "dist/velinstyle-components.js",
17
- "exports": {
18
- ".": "./components/runtime-entry.js",
19
- "./bundle": "./dist/velinstyle-components.min.js",
20
- "./css": "./dist/velinstyle.min.css",
21
- "./sanitize": "./components/sanitize.js",
22
- "./runtime": "./components/runtime/index.js",
23
- "./secure": "./components/velin-secure-field.js",
24
- "./email": "./components/velin-email.js",
25
- "./search": "./core/search/index.js",
26
- "./motion": "./core/motion/index.js",
27
- "./attributes": "./core/attributes/index.js",
28
- "./highlight": "./core/highlight/index.js",
29
- "./meta": "./core/meta/index.js",
30
- "./transparency": "./core/transparency/index.js",
31
- "./a11y": "./components/a11y-entry.js",
32
- "./skills-registry": "./packages/velinstyle-skills/registry.json"
33
- },
34
- "bin": {
35
- "velinstyle": "cli/index.js"
36
- },
37
- "repository": {
38
- "type": "git",
39
- "url": "https://github.com/SkyliteDesign/velinstyle.git"
40
- },
41
- "homepage": "https://velinstyle.info",
42
- "bugs": {
43
- "url": "https://github.com/SkyliteDesign/velinstyle/issues"
44
- },
45
- "files": [
46
- "dist/",
47
- "src/",
48
- "components/",
49
- "core/",
50
- "cli/",
51
- "packages/skill-engine/",
52
- "packages/velinstyle-skills/",
53
- "schemas/",
54
- "examples/search-index.schema.json",
55
- "icons/velin-icons.svg"
56
- ],
57
- "scripts": {
58
- "build": "npm run build:css:min && npm run build:css:dev && npm run build:js:min && npm run build:js:dev && npm run build:js:iife && npm run build:js:chunks && npm run build:loaders && npm run build:react:src && npm run build:types && npm run build:themes && npm run build:icons",
59
- "build:loaders": "node scripts/generate-component-loaders.mjs",
60
- "build:react:src": "node scripts/generate-react-wrappers.mjs",
61
- "build:react": "npm run build:react:src && npm --prefix packages/react run build",
62
- "build:types": "node scripts/generate-types.mjs",
63
- "build:js:chunks": "esbuild components/runtime-entry.js --bundle --splitting --format=esm --outdir=dist/chunks --chunk-names=[name]-[hash]",
64
- "build:css:min": "lightningcss --bundle --minify src/velinstyle.css -o dist/velinstyle.min.css",
65
- "build:css:dev": "lightningcss --bundle src/velinstyle.css -o dist/velinstyle.css",
66
- "build:js:min": "esbuild components/index.js --bundle --minify --format=esm --outfile=dist/velinstyle-components.min.js",
67
- "build:js:dev": "esbuild components/index.js --bundle --format=esm --outfile=dist/velinstyle-components.js",
68
- "build:js:iife": "esbuild components/index.js --bundle --format=iife --outfile=dist/velinstyle-components.iife.js",
69
- "build:themes": "node scripts/build-themes.js",
70
- "build:icons": "node icons/build-sprite.js",
71
- "dev": "npx serve . --cors -l 3000",
72
- "watch": "lightningcss --bundle src/velinstyle.css -o dist/velinstyle.css --watch",
73
- "lint": "stylelint \"src/**/*.css\"",
74
- "test": "vitest run",
75
- "test:a11y": "node tests/a11y/run.js",
76
- "test:a11y:coverage": "node tests/a11y/coverage.js",
77
- "test:contrast": "node scripts/check-contrast.js",
78
- "test:security": "vitest run tests/sanitize.test.js tests/cli-security-scanner.test.js",
79
- "test:perf": "vitest run tests/perf-audit.test.js",
80
- "test:search:bench": "vitest run tests/search-benchmark.test.js",
81
- "test:e2e": "playwright test",
82
- "test:e2e:chromium": "playwright test --project=chromium",
83
- "docs:patch-theme-picker": "node scripts/patch-docs-theme-picker.mjs",
84
- "tokens:validate": "node cli/index.js tokens validate --input examples/tokens.sample.json",
85
- "tokens:validate:full": "node cli/index.js tokens validate --input examples/tokens.full.json",
86
- "docs:generate": "node cli/index.js docs generate",
87
- "search:index": "node cli/index.js search index",
88
- "skills:generate": "node packages/velinstyle-skills/scripts/generate-assets.mjs && node -e \"import('./packages/velinstyle-skills/index.js').then(m=>m.writeCatalogFile())\"",
89
- "skills:validate": "node scripts/validate-skills.mjs",
90
- "skills:doctor": "node scripts/check-skills-paths.mjs",
91
- "meta:build": "node cli/index.js meta",
92
- "ci:checks": "node scripts/ci-checks.mjs",
93
- "check:blueprints": "node scripts/check-blueprint-classes.mjs",
94
- "check:chaos": "node scripts/check-chaos-detection.mjs",
95
- "release:check": "node scripts/check-release-sync.mjs",
96
- "release:sync": "node scripts/check-release-sync.mjs --fix",
97
- "intelligence:validate": "node scripts/validate-intelligence-schemas.mjs",
98
- "prepublishOnly": "npm run build && npm run check:blueprints && npm run search:index && npm run skills:generate && npm run skills:validate && npm run skills:doctor && npm run meta:build && npm run intelligence:validate && npm run release:check -- --skip-site",
99
- "pack:check": "npm pack --dry-run",
100
- "docs:prepare": "npm run build && node scripts/prepare-docs-pages.js",
101
- "docs:patch-nav": "node scripts/patch-docs-nav.js",
102
- "docs:sync-site": "npm run build && npm run docs:generate && python ../velinstyle-site/tools/sync-framework-0.9.0.py && python ../velinstyle-site/tools/patch-site-a11y-aaa.py && python ../velinstyle-site/tools/patch-docs-090-final.py",
103
- "readme:capture": "node tools/capture-readme-demos.mjs",
104
- "readme:assets:webp": "node tools/readme-png-to-webp.mjs",
105
- "demos:sync": "node tools/sync-demos-to-repo.mjs --out showcase-demos && node tools/sync-demos-to-repo.mjs --out ../velinstyle-demos",
106
- "strategy:bootstrap-issues": "node scripts/bootstrap-github-backlog.mjs",
107
- "strategy:bootstrap-issues:dry": "node scripts/bootstrap-github-backlog.mjs --dry-run",
108
- "strategy:bootstrap-next30": "node scripts/bootstrap-github-backlog.mjs --issues-only --seed=../interne_docs/strategy/next-30-issues.json --map=../interne_docs/strategy/next-30-issue-map.json",
109
- "strategy:bootstrap-next30:dry": "node scripts/bootstrap-github-backlog.mjs --dry-run --issues-only --seed=../interne_docs/strategy/next-30-issues.json --map=../interne_docs/strategy/next-30-issue-map.json"
110
- },
111
- "keywords": [
112
- "css",
113
- "framework",
114
- "accessibility",
115
- "a11y",
116
- "wcag",
117
- "mobile-first",
118
- "container-queries",
119
- "oklch",
120
- "web-components",
121
- "design-tokens",
122
- "dark-mode",
123
- "rtl"
124
- ],
125
- "author": "SkyliteDesign",
126
- "license": "MIT",
127
- "devDependencies": {
128
- "@playwright/test": "^1.60.0",
129
- "axe-core": "^4.10.0",
130
- "esbuild": "^0.24.0",
131
- "jsdom": "^26.1.0",
132
- "lightningcss-cli": "^1.28.0",
133
- "playwright": "^1.60.0",
134
- "serve": "^14.0.0",
135
- "sharp": "^0.34.5",
136
- "stylelint": "^16.0.0",
137
- "stylelint-config-standard": "^36.0.0",
138
- "vitest": "^3.2.0"
139
- },
140
- "dependencies": {
141
- "isomorphic-dompurify": "^3.21.0"
142
- }
143
- }
1
+ {
2
+ "name": "@birdapi/velinstyle",
3
+ "version": "1.3.0",
4
+ "publishConfig": {
5
+ "access": "public",
6
+ "registry": "https://registry.npmjs.org"
7
+ },
8
+ "types": "dist/velinstyle.d.ts",
9
+ "sideEffects": [
10
+ "components/index.js",
11
+ "components/velin-*.js"
12
+ ],
13
+ "description": "WCAG 2.2 AAA CSS + Web Components: OKLCH themes, PII scanner, perf CLI, runtime tree-shaking. Ship inclusive UI faster.",
14
+ "type": "module",
15
+ "main": "dist/velinstyle.css",
16
+ "module": "dist/velinstyle-components.js",
17
+ "exports": {
18
+ ".": "./components/runtime-entry.js",
19
+ "./bundle": "./dist/velinstyle-components.min.js",
20
+ "./css": "./dist/velinstyle.min.css",
21
+ "./sanitize": "./components/sanitize.js",
22
+ "./runtime": "./components/runtime/index.js",
23
+ "./secure": "./components/velin-secure-field.js",
24
+ "./email": "./components/velin-email.js",
25
+ "./search": "./core/search/index.js",
26
+ "./motion": "./core/motion/index.js",
27
+ "./motion-clip": "./packages/velinstyle-motion/src/index.js",
28
+ "./attributes": "./core/attributes/index.js",
29
+ "./highlight": "./core/highlight/index.js",
30
+ "./meta": "./core/meta/index.js",
31
+ "./transparency": "./core/transparency/index.js",
32
+ "./security": "./core/security/index.js",
33
+ "./a11y": "./components/a11y-entry.js",
34
+ "./skills-registry": "./packages/velinstyle-skills/registry.json",
35
+ "./experience": "./cli/experience.js",
36
+ "./cli-core": "./packages/velinstyle-cli-core/src/index.js",
37
+ "./cli-registry": "./packages/velinstyle-cli-registry/src/index.js",
38
+ "./cli-theme": "./packages/velinstyle-cli-theme/src/index.js",
39
+ "./cli-ui": "./packages/velinstyle-cli-ui/src/index.js",
40
+ "./cli-renderer": "./packages/velinstyle-cli-renderer/src/index.js"
41
+ },
42
+ "bin": {
43
+ "velinstyle": "cli/index.js"
44
+ },
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "https://github.com/SkyliteDesign/velinstyle.git"
48
+ },
49
+ "homepage": "https://velinstyle.info",
50
+ "bugs": {
51
+ "url": "https://github.com/SkyliteDesign/velinstyle/issues"
52
+ },
53
+ "files": [
54
+ "dist/",
55
+ "src/",
56
+ "components/",
57
+ "core/",
58
+ "cli/",
59
+ "packages/skill-engine/",
60
+ "packages/velinstyle-skills/",
61
+ "schemas/",
62
+ "examples/search-index.schema.json",
63
+ "icons/velin-icons.svg",
64
+ "packages/velinstyle-cli-core/",
65
+ "packages/velinstyle-cli-registry/",
66
+ "packages/velinstyle-cli-theme/",
67
+ "packages/velinstyle-cli-ui/",
68
+ "packages/velinstyle-cli-renderer/",
69
+ "packages/velinstyle-motion/"
70
+ ],
71
+ "scripts": {
72
+ "build": "npm run build:css:min && npm run build:css:dev && npm run build:js:min && npm run build:js:dev && npm run build:js:iife && npm run build:js:chunks && npm run build:loaders && npm run build:react:src && npm run build:types && npm run build:themes && npm run build:icons",
73
+ "build:loaders": "node scripts/generate-component-loaders.mjs",
74
+ "build:react:src": "node scripts/generate-react-wrappers.mjs",
75
+ "build:react": "npm run build:react:src && npm --prefix packages/react run build",
76
+ "build:types": "node scripts/generate-types.mjs",
77
+ "build:js:chunks": "esbuild components/runtime-entry.js --bundle --splitting --format=esm --outdir=dist/chunks --chunk-names=[name]-[hash]",
78
+ "build:css:min": "lightningcss --bundle --minify src/velinstyle.css -o dist/velinstyle.min.css",
79
+ "build:css:dev": "lightningcss --bundle src/velinstyle.css -o dist/velinstyle.css",
80
+ "build:js:min": "esbuild components/index.js --bundle --minify --format=esm --outfile=dist/velinstyle-components.min.js",
81
+ "build:js:dev": "esbuild components/index.js --bundle --format=esm --outfile=dist/velinstyle-components.js",
82
+ "build:js:iife": "esbuild components/index.js --bundle --format=iife --outfile=dist/velinstyle-components.iife.js",
83
+ "build:themes": "node scripts/build-themes.js",
84
+ "build:icons": "node icons/build-sprite.js",
85
+ "dev": "npx serve . --cors -l 3000",
86
+ "watch": "lightningcss --bundle src/velinstyle.css -o dist/velinstyle.css --watch",
87
+ "lint": "stylelint \"src/**/*.css\"",
88
+ "test": "vitest run",
89
+ "test:a11y": "node tests/a11y/run.js",
90
+ "test:a11y:coverage": "node tests/a11y/coverage.js",
91
+ "test:contrast": "node scripts/check-contrast.js",
92
+ "test:motion-clip": "vitest run tests/motion-clip.test.js",
93
+ "test:security": "vitest run tests/sanitize.test.js tests/cli-security-scanner.test.js tests/security.test.js",
94
+ "test:perf": "vitest run tests/perf-audit.test.js",
95
+ "test:search:bench": "vitest run tests/search-benchmark.test.js",
96
+ "test:e2e": "playwright test",
97
+ "test:e2e:chromium": "playwright test --project=chromium",
98
+ "docs:patch-theme-picker": "node scripts/patch-docs-theme-picker.mjs",
99
+ "tokens:validate": "node cli/index.js tokens validate --input examples/tokens.sample.json",
100
+ "tokens:validate:full": "node cli/index.js tokens validate --input examples/tokens.full.json",
101
+ "docs:generate": "node cli/index.js docs generate",
102
+ "search:index": "node cli/index.js search index",
103
+ "skills:generate": "node packages/velinstyle-skills/scripts/generate-assets.mjs && node -e \"import('./packages/velinstyle-skills/index.js').then(m=>m.writeCatalogFile())\"",
104
+ "skills:validate": "node scripts/validate-skills.mjs",
105
+ "skills:doctor": "node scripts/check-skills-paths.mjs",
106
+ "meta:build": "node cli/index.js meta",
107
+ "ci:checks": "node scripts/ci-checks.mjs",
108
+ "check:blueprints": "node scripts/check-blueprint-classes.mjs",
109
+ "check:chaos": "node scripts/check-chaos-detection.mjs",
110
+ "release:check": "node scripts/check-release-sync.mjs",
111
+ "release:sync": "node scripts/check-release-sync.mjs --fix",
112
+ "intelligence:validate": "node scripts/validate-intelligence-schemas.mjs",
113
+ "prepublishOnly": "npm run build && npm run check:blueprints && npm run search:index && npm run skills:generate && npm run skills:validate && npm run skills:doctor && npm run meta:build && npm run intelligence:validate && npm run release:check -- --skip-site",
114
+ "pack:check": "npm pack --dry-run",
115
+ "docs:prepare": "npm run build && node scripts/prepare-docs-pages.js",
116
+ "docs:patch-nav": "node scripts/patch-docs-nav.js",
117
+ "docs:sync-site": "npm run build && npm run docs:generate && python ../velinstyle-site/tools/sync-framework-0.9.0.py && python ../velinstyle-site/tools/patch-site-a11y-aaa.py && python ../velinstyle-site/tools/patch-docs-090-final.py",
118
+ "readme:capture": "node tools/capture-readme-demos.mjs",
119
+ "readme:assets:webp": "node tools/readme-png-to-webp.mjs",
120
+ "demos:sync": "node tools/sync-demos-to-repo.mjs --out showcase-demos && node tools/sync-demos-to-repo.mjs --out ../velinstyle-demos",
121
+ "strategy:bootstrap-issues": "node scripts/bootstrap-github-backlog.mjs",
122
+ "strategy:bootstrap-issues:dry": "node scripts/bootstrap-github-backlog.mjs --dry-run",
123
+ "strategy:bootstrap-next30": "node scripts/bootstrap-github-backlog.mjs --issues-only --seed=../interne_docs/strategy/next-30-issues.json --map=../interne_docs/strategy/next-30-issue-map.json",
124
+ "strategy:bootstrap-next30:dry": "node scripts/bootstrap-github-backlog.mjs --dry-run --issues-only --seed=../interne_docs/strategy/next-30-issues.json --map=../interne_docs/strategy/next-30-issue-map.json"
125
+ },
126
+ "keywords": [
127
+ "css",
128
+ "framework",
129
+ "accessibility",
130
+ "a11y",
131
+ "wcag",
132
+ "mobile-first",
133
+ "container-queries",
134
+ "oklch",
135
+ "web-components",
136
+ "design-tokens",
137
+ "dark-mode",
138
+ "rtl"
139
+ ],
140
+ "author": "SkyliteDesign",
141
+ "license": "MIT",
142
+ "devDependencies": {
143
+ "@playwright/test": "^1.60.0",
144
+ "axe-core": "^4.10.0",
145
+ "esbuild": "^0.24.0",
146
+ "jsdom": "^26.1.0",
147
+ "lightningcss-cli": "^1.28.0",
148
+ "playwright": "^1.60.0",
149
+ "serve": "^14.0.0",
150
+ "sharp": "^0.34.5",
151
+ "stylelint": "^16.0.0",
152
+ "stylelint-config-standard": "^36.0.0",
153
+ "vitest": "^3.2.0"
154
+ },
155
+ "dependencies": {
156
+ "isomorphic-dompurify": "^3.21.0"
157
+ }
158
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "@birdapi/velinstyle-cli-core",
3
+ "version": "1.3.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "main": "src/index.js",
7
+ "exports": {
8
+ ".": "./src/index.js"
9
+ },
10
+ "description": "Velin Experience core — lifecycle, event bus, config, output contract"
11
+ }
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Velin Experience config — velinstyle-cli.json (+ flags/env).
3
+ */
4
+ import { existsSync, readFileSync, mkdirSync, writeFileSync } from 'fs';
5
+ import { join, resolve } from 'path';
6
+
7
+ export const DEFAULT_EXPERIENCE_CONFIG = {
8
+ theme: 'modern',
9
+ output: 'standard',
10
+ icons: true,
11
+ unicode: true,
12
+ animations: true,
13
+ progress: true,
14
+ compact: false,
15
+ analytics: false,
16
+ record: false,
17
+ };
18
+
19
+ const CONFIG_NAMES = ['velinstyle-cli.json', 'velin-experience.json'];
20
+
21
+ export function loadExperienceConfig(cwd = process.cwd(), overrides = {}) {
22
+ const root = resolve(cwd);
23
+ let fileConfig = {};
24
+ for (const name of CONFIG_NAMES) {
25
+ const path = join(root, name);
26
+ if (existsSync(path)) {
27
+ try {
28
+ fileConfig = JSON.parse(readFileSync(path, 'utf8'));
29
+ } catch {
30
+ fileConfig = {};
31
+ }
32
+ break;
33
+ }
34
+ }
35
+
36
+ const envTheme = process.env.VELIN_EXPERIENCE_THEME;
37
+ const envOutput = process.env.VELIN_EXPERIENCE_OUTPUT;
38
+
39
+ return {
40
+ ...DEFAULT_EXPERIENCE_CONFIG,
41
+ ...fileConfig,
42
+ ...(envTheme ? { theme: envTheme } : {}),
43
+ ...(envOutput ? { output: envOutput } : {}),
44
+ ...overrides,
45
+ };
46
+ }
47
+
48
+ export function analyticsPath(cwd = process.cwd()) {
49
+ return join(resolve(cwd), '.velin', 'experience-analytics.json');
50
+ }
51
+
52
+ export function recordUsage(commandId, cwd = process.cwd()) {
53
+ const path = analyticsPath(cwd);
54
+ mkdirSync(join(resolve(cwd), '.velin'), { recursive: true });
55
+ let data = { commands: {} };
56
+ if (existsSync(path)) {
57
+ try {
58
+ data = JSON.parse(readFileSync(path, 'utf8'));
59
+ } catch {
60
+ data = { commands: {} };
61
+ }
62
+ }
63
+ data.commands[commandId] = (data.commands[commandId] || 0) + 1;
64
+ data.updatedAt = new Date().toISOString();
65
+ writeFileSync(path, JSON.stringify(data, null, 2));
66
+ return data;
67
+ }
68
+
69
+ export function suggestFromAnalytics(cwd = process.cwd()) {
70
+ const path = analyticsPath(cwd);
71
+ if (!existsSync(path)) return null;
72
+ let data;
73
+ try {
74
+ data = JSON.parse(readFileSync(path, 'utf8'));
75
+ } catch {
76
+ return null;
77
+ }
78
+ const cmds = data.commands || {};
79
+ const hot = ['production', 'review', 'doctor'].filter((id) => (cmds[id] || 0) >= 2);
80
+ if (hot.length >= 2 && !(cmds.dashboard > 0)) {
81
+ return 'You often run production / review / doctor — try `velinstyle dashboard`.';
82
+ }
83
+ return null;
84
+ }
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Output Contract — every command fills the same shape (no free-form text).
3
+ */
4
+
5
+ export function createEmptyContract(partial = {}) {
6
+ return {
7
+ project: partial.project || {},
8
+ lifecycle: partial.lifecycle || { stage: 'init', stages: [] },
9
+ result: partial.result || { status: 'PASS', message: '' },
10
+ stats: partial.stats || {},
11
+ widgets: Array.isArray(partial.widgets) ? [...partial.widgets] : [],
12
+ suggestions: Array.isArray(partial.suggestions) ? [...partial.suggestions] : [],
13
+ diagnostics: Array.isArray(partial.diagnostics) ? [...partial.diagnostics] : [],
14
+ notifications: Array.isArray(partial.notifications) ? [...partial.notifications] : [],
15
+ meta: partial.meta || {},
16
+ };
17
+ }
18
+
19
+ export function validateContract(contract) {
20
+ const problems = [];
21
+ if (!contract || typeof contract !== 'object') {
22
+ return { ok: false, problems: ['contract must be an object'] };
23
+ }
24
+ for (const key of ['project', 'lifecycle', 'result', 'stats']) {
25
+ if (contract[key] == null || typeof contract[key] !== 'object') {
26
+ problems.push(`missing or invalid "${key}"`);
27
+ }
28
+ }
29
+ for (const key of ['widgets', 'suggestions', 'diagnostics']) {
30
+ if (!Array.isArray(contract[key])) problems.push(`"${key}" must be an array`);
31
+ }
32
+ if (contract.result && !['PASS', 'WARNING', 'ERROR', 'SUGGESTION'].includes(contract.result.status)) {
33
+ problems.push('result.status must be PASS|WARNING|ERROR|SUGGESTION');
34
+ }
35
+ return { ok: problems.length === 0, problems };
36
+ }
37
+
38
+ export function pushWidget(contract, id, props = {}) {
39
+ contract.widgets.push({ id, props });
40
+ return contract;
41
+ }
42
+
43
+ export function pushSuggestion(contract, text, opts = {}) {
44
+ contract.suggestions.push({ text, ...opts });
45
+ return contract;
46
+ }
47
+
48
+ export function pushDiagnostic(contract, diagnostic) {
49
+ contract.diagnostics.push(diagnostic);
50
+ return contract;
51
+ }
52
+
53
+ export function setResult(contract, status, message = '') {
54
+ contract.result = { status, message };
55
+ return contract;
56
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Velin Experience event bus — commands emit; renderers/plugins subscribe.
3
+ */
4
+ export function createEventBus() {
5
+ /** @type {Map<string, Set<Function>>} */
6
+ const listeners = new Map();
7
+
8
+ function on(event, handler) {
9
+ if (!listeners.has(event)) listeners.set(event, new Set());
10
+ listeners.get(event).add(handler);
11
+ return () => off(event, handler);
12
+ }
13
+
14
+ function off(event, handler) {
15
+ listeners.get(event)?.delete(handler);
16
+ }
17
+
18
+ function emit(event, payload) {
19
+ const set = listeners.get(event);
20
+ if (!set) return;
21
+ for (const handler of set) {
22
+ try {
23
+ handler(payload);
24
+ } catch (err) {
25
+ if (event !== 'onError') emit('onError', { error: err, source: event });
26
+ }
27
+ }
28
+ }
29
+
30
+ function once(event, handler) {
31
+ const wrap = (payload) => {
32
+ off(event, wrap);
33
+ handler(payload);
34
+ };
35
+ return on(event, wrap);
36
+ }
37
+
38
+ return { on, off, once, emit };
39
+ }
40
+
41
+ export const EXPERIENCE_EVENTS = [
42
+ 'onStart',
43
+ 'onProgress',
44
+ 'onWarning',
45
+ 'onSuggestion',
46
+ 'onResult',
47
+ 'onFinish',
48
+ 'onError',
49
+ 'onNotification',
50
+ ];
@@ -0,0 +1,18 @@
1
+ export { createEventBus, EXPERIENCE_EVENTS } from './event-bus.js';
2
+ export {
3
+ createEmptyContract,
4
+ validateContract,
5
+ pushWidget,
6
+ pushSuggestion,
7
+ pushDiagnostic,
8
+ setResult,
9
+ } from './contract.js';
10
+ export { LIFECYCLE_STAGES, createLifecycleTracker } from './lifecycle.js';
11
+ export {
12
+ DEFAULT_EXPERIENCE_CONFIG,
13
+ loadExperienceConfig,
14
+ recordUsage,
15
+ suggestFromAnalytics,
16
+ analyticsPath,
17
+ } from './config.js';
18
+ export { runExperienceCommand } from './runner.js';
@@ -0,0 +1,33 @@
1
+ /** Fixed lifecycle stages for every Experience command. */
2
+ export const LIFECYCLE_STAGES = [
3
+ 'init',
4
+ 'loadConfig',
5
+ 'environment',
6
+ 'input',
7
+ 'analysis',
8
+ 'processing',
9
+ 'validation',
10
+ 'result',
11
+ 'hints',
12
+ 'summary',
13
+ ];
14
+
15
+ export function createLifecycleTracker() {
16
+ const stages = [];
17
+ let current = 'init';
18
+
19
+ function enter(stage) {
20
+ if (!LIFECYCLE_STAGES.includes(stage)) {
21
+ throw new Error(`Unknown lifecycle stage: ${stage}`);
22
+ }
23
+ current = stage;
24
+ stages.push({ stage, at: new Date().toISOString() });
25
+ return current;
26
+ }
27
+
28
+ function snapshot() {
29
+ return { stage: current, stages: [...stages] };
30
+ }
31
+
32
+ return { enter, snapshot, get stage() { return current; } };
33
+ }