Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion renderers/lit/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions renderers/lit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@
},
"wireit": {
"copy-spec": {
"command": "mkdir -p src/0.8/schemas && cp ../../specification/0.8/json/*.json src/0.8/schemas",
"command": "node scripts/copy-spec.js",
"files": [
"../../specification/0.8/json/*.json"
"../../specification/0.8/json/*.json",
"scripts/copy-spec.js"
],
"output": [
"src/0.8/schemas/*.json"
Expand Down Expand Up @@ -105,4 +106,4 @@
"markdown-it": "^14.1.0",
"signal-utils": "^0.21.1"
}
}
}
29 changes: 29 additions & 0 deletions renderers/lit/scripts/copy-spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const srcDir = path.resolve(__dirname, '../../../specification/0.8/json');
const destDir = path.resolve(__dirname, '../src/0.8/schemas');

console.log(`Copying specs from ${srcDir} to ${destDir}`);

if (!fs.existsSync(destDir)) {
fs.mkdirSync(destDir, { recursive: true });
}

if (!fs.existsSync(srcDir)) {
console.error(`Source directory not found: ${srcDir}`);
process.exit(1);
}

const files = fs.readdirSync(srcDir);

files.forEach(file => {
if (path.extname(file) === '.json') {
fs.copyFileSync(path.join(srcDir, file), path.join(destDir, file));
console.log(`Copied ${file}`);
}
});