@pure-ds/core 0.5.21 → 0.5.23

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pure-ds/core",
3
3
  "shortname": "pds",
4
- "version": "0.5.21",
4
+ "version": "0.5.23",
5
5
  "description": "Pure Design System - Why develop a Design System when you can generate one?",
6
6
  "repository": {
7
7
  "type": "git",
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { readFile, writeFile, mkdir, access } from 'fs/promises';
3
+ import { readFile, writeFile, mkdir, access, rename, rm } from 'fs/promises';
4
4
  import { existsSync } from 'fs';
5
5
  import path from 'path';
6
6
  import { spawn } from 'child_process';
@@ -250,7 +250,7 @@ customElements.define(
250
250
  this.shadowRoot.addEventListener("change", (e) => {
251
251
  if (e.target.type === "radio" && e.target.name === "theme") {
252
252
  PDS.theme = e.target.value;
253
- PDS.toast(\`Theme changed to ${e.target.value}\`, { duration: 2000 });
253
+ PDS.toast("Theme changed to " + e.target.value, { duration: 2000 });
254
254
  }
255
255
  });
256
256
 
@@ -546,8 +546,30 @@ async function runDevServer() {
546
546
 
547
547
  async function ensurePdsAssets() {
548
548
  const pdsAssetsDir = path.join(projectRoot, 'public', 'assets', 'pds');
549
+ const repoAssetsDir = path.join(projectRoot, 'assets', 'pds');
550
+
551
+ const normalizeAssetsLocation = async () => {
552
+ if (!existsSync(repoAssetsDir)) return;
553
+
554
+ if (!existsSync(pdsAssetsDir)) {
555
+ await ensureDir(path.dirname(pdsAssetsDir));
556
+ await rename(repoAssetsDir, pdsAssetsDir);
557
+ log('✅ Moved assets/pds to public/assets/pds');
558
+ return true;
559
+ }
560
+
561
+ await rm(repoAssetsDir, { recursive: true, force: true });
562
+ log('🧹 Removed duplicate assets/pds folder');
563
+ return false;
564
+ };
565
+
566
+ const movedAssets = await normalizeAssetsLocation();
567
+ if (movedAssets) {
568
+ return;
569
+ }
570
+
549
571
  if (existsSync(pdsAssetsDir)) {
550
- log('↪️ PDS assets already present');
572
+ log('↪️ public/assets/pds already present');
551
573
  return;
552
574
  }
553
575
 
@@ -566,6 +588,8 @@ async function ensurePdsAssets() {
566
588
  else reject(new Error(`npm run pds:build exited with code ${code}`));
567
589
  });
568
590
  });
591
+
592
+ await normalizeAssetsLocation();
569
593
  }
570
594
 
571
595
  async function main() {