mirror of
https://github.com/pezkuwichain/pezkuwi-dev.git
synced 2026-04-22 02:08:01 +00:00
cb6801a3cc
- Updated all copyright headers from 2025 to 2026 (system date shows 2026)
- Added build output files to eslint ignore list in packages/dev/config/eslint.js
- Added build output patterns to .gitignore
- Ignored: packages/*/*.{d.ts,js,mjs,cjs}, packages/*/cjs/**, packages/*/env/**,
packages/*/rootJs/**, packages/*/rootStatic/**
- Successfully resolved 521 lint errors by properly ignoring generated files
- Build outputs should not be linted (source files are linted instead)
- Lint and build now pass successfully
54 lines
1.4 KiB
JavaScript
Executable File
54 lines
1.4 KiB
JavaScript
Executable File
#!/usr/bin/env node
|
|
// Copyright 2017-2026 @pezkuwi/dev authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import fs from 'node:fs';
|
|
import path from 'node:path';
|
|
|
|
import { copyDirSync, execPm, exitFatal, logBin, mkdirpSync, rimrafSync } from './util.mjs';
|
|
|
|
const args = process.argv.slice(2);
|
|
|
|
logBin('pezkuwi-dev-copy-to');
|
|
|
|
if (args.length !== 1) {
|
|
exitFatal('Expected one <destination> argument');
|
|
}
|
|
|
|
const dest = path.join(process.cwd(), '..', args[0], 'node_modules');
|
|
|
|
if (!fs.existsSync(dest)) {
|
|
exitFatal('Destination node_modules folder does not exist');
|
|
}
|
|
|
|
// build to ensure we actually have latest
|
|
execPm('build');
|
|
|
|
// map across what is available and copy it
|
|
fs
|
|
.readdirSync('packages')
|
|
.map((dir) => {
|
|
const pkgPath = path.join(process.cwd(), 'packages', dir);
|
|
|
|
return [pkgPath, path.join(pkgPath, 'package.json')];
|
|
})
|
|
.filter(([, jsonPath]) => fs.existsSync(jsonPath))
|
|
.map(([pkgPath, json]) => [JSON.parse(fs.readFileSync(json, 'utf8')).name, pkgPath])
|
|
.forEach(([name, pkgPath]) => {
|
|
console.log(`*** Copying ${name} to ${dest}`);
|
|
|
|
const outDest = path.join(dest, name);
|
|
|
|
// remove the destination
|
|
rimrafSync(outDest);
|
|
|
|
// create the root
|
|
mkdirpSync(outDest);
|
|
|
|
// copy the build output
|
|
copyDirSync(path.join(pkgPath, 'build'), outDest);
|
|
|
|
// copy node_modules, as available
|
|
copyDirSync(path.join(pkgPath, 'node_modules'), path.join(outDest, 'node_modules'));
|
|
});
|