Files
pezkuwi-dev/packages/dev/scripts/pezkuwi-dev-deno-map.mjs
T
pezkuwichain cb6801a3cc Fix lint errors: Update copyright years to 2026 and ignore build outputs
- 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
2026-01-17 21:02:45 +03:00

36 lines
1.2 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 { DENO_POL_PRE } from './util.mjs';
const [e, i] = fs
.readdirSync('packages')
.filter((p) => fs.existsSync(`packages/${p}/src/mod.ts`))
.sort()
.reduce((/** @type {[string[], Record<String, string>]} */ [e, i], p) => {
e.push(`export * as ${p.replace(/-/g, '_')} from '${DENO_POL_PRE}/${p}/mod.ts';`);
i[`${DENO_POL_PRE}/${p}/`] = `./packages/${p}/build-deno/`;
return [e, i];
}, [[], {}]);
if (!fs.existsSync('mod.ts')) {
fs.writeFileSync('mod.ts', `// Copyright 2017-${new Date().getFullYear()} @pezkuwi/dev authors & contributors\n// SPDX-License-Identifier: Apache-2.0\n\n// auto-generated via pezkuwi-dev-deno-map, do not edit\n\n// This is a Deno file, so we can allow .ts imports
/* eslint-disable import/extensions */\n\n${e.join('\n')}\n`);
}
if (fs.existsSync('import_map.in.json')) {
const o = JSON.parse(fs.readFileSync('import_map.in.json', 'utf-8'));
Object
.entries(o.imports)
.forEach(([k, v]) => {
i[k] = v;
});
}
fs.writeFileSync('import_map.json', JSON.stringify({ imports: i }, null, 2));