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
4 changes: 2 additions & 2 deletions scripts/gen-changelog.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { git, readPackageJSON } from './utils';
import packageJSON from '../package.json' with { type: 'json' };

Check failure on line 1 in scripts/gen-changelog.ts

View workflow job for this annotation

GitHub Actions / changelog / Generate changelog

Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'.
import { git } from './utils';

const packageJSON = readPackageJSON();
const labelsConfig: { [label: string]: { section: string; fold?: boolean } } = {
'PR: breaking change 💥': {
section: 'Breaking Change 💥',
Expand Down
28 changes: 0 additions & 28 deletions scripts/utils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import * as childProcess from 'node:child_process';
import * as fs from 'node:fs';
import * as path from 'node:path';

export function localRepoPath(...paths: ReadonlyArray<string>): string {
const repoDir = path.resolve(__dirname, '..');
return path.join(repoDir, ...paths);
}

interface GITOptions extends SpawnOptions {
quiet?: boolean;
Expand Down Expand Up @@ -74,24 +67,3 @@ function spawn(
throw new Error(`Command failed: ${command} ${args.join(' ')}`);
}
}

interface PackageJSON {
description: string;
version: string;
private?: boolean;
repository?: { url?: string };
scripts?: { [name: string]: string };
type?: string;
exports: { [path: string]: string };
types?: string;
typesVersions: { [ranges: string]: { [path: string]: Array<string> } };
devDependencies?: { [name: string]: string };
publishConfig: { tag: string };
}

export function readPackageJSON(
dirPath: string = localRepoPath(),
): PackageJSON {
const filepath = path.join(dirPath, 'package.json');
return JSON.parse(fs.readFileSync(filepath, 'utf-8'));
}
Loading