mirror of
https://github.com/pezkuwichain/pezkuwi-dev.git
synced 2026-04-21 23:48:03 +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
75 lines
2.0 KiB
JavaScript
Executable File
75 lines
2.0 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 { execGit, logBin, mkdirpSync } from './util.mjs';
|
|
|
|
const tmpDir = 'packages/build';
|
|
const tmpFile = `${tmpDir}/CONTRIBUTORS`;
|
|
|
|
logBin('pezkuwi-dev-contrib');
|
|
|
|
mkdirpSync(tmpDir);
|
|
execGit(`shortlog master -e -n -s > ${tmpFile}`);
|
|
|
|
fs.writeFileSync(
|
|
'CONTRIBUTORS',
|
|
Object
|
|
.entries(
|
|
fs
|
|
.readFileSync(tmpFile, 'utf-8')
|
|
.split('\n')
|
|
.map((l) => l.trim())
|
|
.filter((l) => !!l)
|
|
.reduce((/** @type {Record<string, { count: number; name: string; }>} */ all, line) => {
|
|
const [c, e] = line.split('\t');
|
|
const count = parseInt(c, 10);
|
|
const [name, rest] = e.split(' <');
|
|
const isExcluded = (
|
|
['GitHub', 'Travis CI'].some((n) => name.startsWith(n)) ||
|
|
['>', 'action@github.com>'].some((e) => rest === e) ||
|
|
[name, rest].some((n) => n.includes('[bot]'))
|
|
);
|
|
|
|
if (!isExcluded) {
|
|
let [email] = rest.split('>');
|
|
|
|
if (!all[email]) {
|
|
email = Object.keys(all).find((k) =>
|
|
name.includes(' ') &&
|
|
all[k].name === name
|
|
) || email;
|
|
}
|
|
|
|
if (all[email]) {
|
|
all[email].count += count;
|
|
} else {
|
|
all[email] = { count, name };
|
|
}
|
|
}
|
|
|
|
return all;
|
|
}, {})
|
|
)
|
|
.sort((a, b) => {
|
|
const diff = b[1].count - a[1].count;
|
|
|
|
return diff === 0
|
|
? a[1].name.localeCompare(b[1].name)
|
|
: diff;
|
|
})
|
|
.map(([email, { count, name }], i) => {
|
|
execGit(`log master -1 --author=${email} > ${tmpFile}-${i}`);
|
|
|
|
const commit = fs
|
|
.readFileSync(`${tmpFile}-${i}`, 'utf-8')
|
|
.split('\n')[4]
|
|
.trim();
|
|
|
|
return `${`${count}`.padStart(8)}\t${name.padEnd(30)}\t${commit}`;
|
|
})
|
|
.join('\n')
|
|
);
|