@pure-ds/core 0.4.11 → 0.4.13

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.
@@ -1 +1 @@
1
- {"version":3,"file":"pds-generator.d.ts","sourceRoot":"","sources":["../../../../../src/js/pds-core/pds-generator.js"],"names":[],"mappings":"AAurKA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,4CAjBW,UAAU,qBACV,aAAa,EAAE,GACb,OAAO,CAAC,IAAI,CAAC,CAqCzB;AAED;;;;;;;;GAQG;AACH,wCALW,UAAU,WACV,MAAM,EAAE,qBACR,aAAa,EAAE,GACb,OAAO,CAAC,IAAI,CAAC,CAmDzB;AAED;;;;;;GAMG;AACH,sCAHW,MAAM,GACJ,aAAa,CAMzB;AAzyKD;;;GAGG;AACH;IAEE,mCAAiB;IAEjB,2BAEC;IA6kKD;;;;OAIG;IACH,+BAFW,SAAS,QAgCnB;IAED;;;;OAIG;IACH,gDA6CC;IA7pKD,0BA6CC;IA5CC;;MAIC;IAaD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAmC;IA6BrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgBC;IAycD;;;;OAIG;IACH,kDAyBC;IA0ED;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA6DC;IAg8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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgBC;IAycD;;;;OAIG;IACH,kDAyBC;IA0ED;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA6DC;IA+mGD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAEC;IAGD,oBAEC;IA8sBD,qBAEC;IACD,yBAEC;IACD,yBAEC;IACD,wBAEC;IACD,yBAMC;IAED;;;;;;OAMG;IACH,oBA6JC;IAGD,4BAEC;IACD,gCAEC;IACD,gCAEC;IACD,+BAEC;IAmBD;;;OAGG;IACH;;;;;;MAoBC;;CA2GF"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pure-ds/core",
3
3
  "shortname": "pds",
4
- "version": "0.4.11",
4
+ "version": "0.4.13",
5
5
  "description": "Pure Design System - Why develop a Design System when you can generate one?",
6
6
  "repository": {
7
7
  "type": "git",
@@ -28,7 +28,8 @@
28
28
  "bin": {
29
29
  "pds-export": "packages/pds-cli/bin/pds-static.js",
30
30
  "pds-sync-assets": "packages/pds-cli/bin/sync-assets.js",
31
- "pds-build-icons": "packages/pds-cli/bin/pds-build-icons.js"
31
+ "pds-build-icons": "packages/pds-cli/bin/pds-build-icons.js",
32
+ "pds-setup-copilot": "packages/pds-cli/bin/pds-setup-copilot.js"
32
33
  },
33
34
  "exports": {
34
35
  ".": {
@@ -40,6 +41,8 @@
40
41
  "./auto-define/*": "./public/auto-define/*"
41
42
  },
42
43
  "files": [
44
+ ".github/copilot-instructions.md",
45
+ ".cursorrules",
43
46
  "dist/types/",
44
47
  "public/assets/js/",
45
48
  "public/assets/pds/components/",
@@ -0,0 +1,106 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * PDS Setup Copilot Instructions
5
+ *
6
+ * Copies PDS Copilot instructions to the consuming project's .github folder.
7
+ * Run: npx pds-setup-copilot
8
+ *
9
+ * Options:
10
+ * --force Overwrite existing copilot-instructions.md even if it's not a PDS file
11
+ */
12
+
13
+ import { copyFile, mkdir, readFile, access } from 'fs/promises';
14
+ import path from 'path';
15
+ import { fileURLToPath } from 'url';
16
+
17
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
18
+ const repoRoot = path.resolve(__dirname, '../../../');
19
+
20
+ async function main() {
21
+ const args = process.argv.slice(2);
22
+ const force = args.includes('--force') || args.includes('-f');
23
+ const projectRoot = process.cwd();
24
+
25
+ console.log('šŸ“‹ PDS Copilot Instructions Setup\n');
26
+
27
+ const sourceFile = path.join(repoRoot, '.github', 'copilot-instructions.md');
28
+ const targetDir = path.join(projectRoot, '.github');
29
+ const targetFile = path.join(targetDir, 'copilot-instructions.md');
30
+
31
+ // Verify source exists
32
+ try {
33
+ await access(sourceFile);
34
+ } catch {
35
+ console.error('āŒ Could not find PDS copilot-instructions.md');
36
+ console.log(' Make sure @pure-ds/core is properly installed.');
37
+ process.exit(1);
38
+ }
39
+
40
+ // Create .github directory if it doesn't exist
41
+ await mkdir(targetDir, { recursive: true });
42
+
43
+ // Check if file already exists
44
+ try {
45
+ await access(targetFile);
46
+ const existingContent = await readFile(targetFile, 'utf8');
47
+
48
+ if (!force && !existingContent.includes('Pure Design System (PDS)')) {
49
+ console.log('āš ļø Existing .github/copilot-instructions.md found (not PDS)');
50
+ console.log(' Use --force to overwrite: npx pds-setup-copilot --force');
51
+ process.exit(0);
52
+ }
53
+
54
+ if (!force) {
55
+ console.log('šŸ“ Updating existing PDS Copilot instructions...');
56
+ } else {
57
+ console.log('šŸ“ Overwriting existing Copilot instructions (--force)...');
58
+ }
59
+ } catch {
60
+ console.log('šŸ“ Creating new Copilot instructions...');
61
+ }
62
+
63
+ await copyFile(sourceFile, targetFile);
64
+
65
+ console.log('\nāœ… PDS Copilot instructions installed at .github/copilot-instructions.md');
66
+
67
+ // Also copy .cursorrules for Cursor IDE
68
+ try {
69
+ const cursorSource = path.join(repoRoot, '.cursorrules');
70
+ const cursorTarget = path.join(projectRoot, '.cursorrules');
71
+
72
+ try {
73
+ await access(cursorSource);
74
+
75
+ // Check existing .cursorrules
76
+ try {
77
+ await access(cursorTarget);
78
+ const existingCursor = await readFile(cursorTarget, 'utf8');
79
+ if (!force && !existingCursor.includes('Pure Design System (PDS)')) {
80
+ console.log('āš ļø Existing .cursorrules found (not PDS), skipping...');
81
+ } else {
82
+ await copyFile(cursorSource, cursorTarget);
83
+ console.log('āœ… PDS instructions also installed at .cursorrules (for Cursor IDE)');
84
+ }
85
+ } catch {
86
+ await copyFile(cursorSource, cursorTarget);
87
+ console.log('āœ… PDS instructions also installed at .cursorrules (for Cursor IDE)');
88
+ }
89
+ } catch {
90
+ // .cursorrules source doesn't exist, skip
91
+ }
92
+ } catch {
93
+ // Optional, don't fail
94
+ }
95
+
96
+ console.log('\nšŸ“š SSoT files available at node_modules/@pure-ds/core/:');
97
+ console.log(' • custom-elements.json (Web Component APIs)');
98
+ console.log(' • public/assets/pds/pds.css-data.json (CSS tokens)');
99
+ console.log(' • src/js/pds-core/pds-ontology.js (Primitives & utilities)');
100
+ console.log(' • src/js/pds-core/pds-enhancer-metadata.js (Enhancements)');
101
+ }
102
+
103
+ main().catch(err => {
104
+ console.error('āŒ Error:', err.message);
105
+ process.exit(1);
106
+ });
@@ -135,6 +135,62 @@ async function ensureExportScript(consumerRoot) {
135
135
  }
136
136
  }
137
137
 
138
+ /**
139
+ * Copy PDS Copilot instructions to consumer's .github folder
140
+ */
141
+ async function copyCopilotInstructions(consumerRoot) {
142
+ try {
143
+ const sourceFile = path.join(repoRoot, '.github', 'copilot-instructions.md');
144
+ const targetDir = path.join(consumerRoot, '.github');
145
+ const targetFile = path.join(targetDir, 'copilot-instructions.md');
146
+
147
+ // Create .github directory if it doesn't exist
148
+ await mkdir(targetDir, { recursive: true });
149
+
150
+ // Check if file already exists
151
+ try {
152
+ await access(targetFile);
153
+ // File exists - check if it's a PDS file by looking for our marker
154
+ const existingContent = await readFile(targetFile, 'utf8');
155
+ if (!existingContent.includes('Pure Design System (PDS)')) {
156
+ // Not a PDS file, don't overwrite
157
+ console.log('šŸ“‹ Existing .github/copilot-instructions.md found (not PDS), skipping...');
158
+ console.log(' šŸ’” To use PDS instructions, run: npx pds-setup-copilot --force');
159
+ return;
160
+ }
161
+ } catch {
162
+ // File doesn't exist, we'll create it
163
+ }
164
+
165
+ await copyFile(sourceFile, targetFile);
166
+ console.log('šŸ“‹ Copied PDS Copilot instructions to .github/copilot-instructions.md');
167
+
168
+ // Also copy .cursorrules for Cursor IDE users
169
+ try {
170
+ const cursorSource = path.join(repoRoot, '.cursorrules');
171
+ const cursorTarget = path.join(consumerRoot, '.cursorrules');
172
+
173
+ try {
174
+ await access(cursorTarget);
175
+ const existingCursor = await readFile(cursorTarget, 'utf8');
176
+ if (!existingCursor.includes('Pure Design System (PDS)')) {
177
+ console.log('šŸ“‹ Existing .cursorrules found (not PDS), skipping...');
178
+ return;
179
+ }
180
+ } catch {
181
+ // File doesn't exist
182
+ }
183
+
184
+ await copyFile(cursorSource, cursorTarget);
185
+ console.log('šŸ“‹ Copied PDS instructions to .cursorrules (for Cursor IDE)');
186
+ } catch (e) {
187
+ // .cursorrules copy is optional
188
+ }
189
+ } catch (e) {
190
+ console.warn('āš ļø Could not copy Copilot instructions:', e.message);
191
+ }
192
+ }
193
+
138
194
  /**
139
195
  * Discover the web root directory using common patterns
140
196
  */
@@ -275,6 +331,9 @@ async function copyPdsAssets() {
275
331
 
276
332
  console.log('šŸ“¦ Proceeding with asset copying...');
277
333
 
334
+ // Copy Copilot instructions to consumer project
335
+ await copyCopilotInstructions(consumerRoot);
336
+
278
337
  // Proactively add export & build-icons scripts to consumer package.json (still helpful)
279
338
  await ensureExportScript(consumerRoot);
280
339
  try {