Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: test on node 14, 16, 18, 20, and 21 #866

Merged
merged 3 commits into from
Mar 26, 2024
Merged
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
12 changes: 6 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
on:
push:
branches: [ $default-branch ]
branches: [$default-branch]
pull_request:
name: ci
jobs:
Expand All @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [14, 16, 18]
node: [14, 16, 18, 20, 21]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-node@v4
Expand All @@ -29,7 +29,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
- run: npm ci
- run: npm run system-test
system_test:
Expand All @@ -38,7 +38,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
- run: npm ci
- run: npm run system-test
lint:
Expand All @@ -47,7 +47,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
- run: npm ci
- run: npm run lint
license_check:
Expand All @@ -56,6 +56,6 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
- run: npm ci
- run: npm run license-check
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
registry-url: 'https://wombat-dressing-room.appspot.com'
- run: npm ci
- run: npm publish
Expand Down
13 changes: 1 addition & 12 deletions package-lock.json

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

8 changes: 1 addition & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@
"engines": {
"node": ">=14"
},
"keywords": [
"typescript",
"linter",
"formatter",
"google"
],
"keywords": ["typescript", "linter", "formatter", "google"],
"author": "Google Inc.",
"license": "Apache-2.0",
"dependencies": {
Expand Down Expand Up @@ -69,7 +64,6 @@
"@types/mocha": "^10.0.0",
"@types/ncp": "^2.0.4",
"@types/node": "20.11.30",
"@types/prettier": "^3.0.0",
"@types/rimraf": "^3.0.0",
"@types/sinon": "^17.0.0",
"@types/tmp": "^0.2.0",
Expand Down
6 changes: 3 additions & 3 deletions src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ import * as inquirer from 'inquirer';
import * as path from 'path';
import {ncp} from 'ncp';
import * as util from 'util';
import * as writeFileAtomic from 'write-file-atomic';

import {
getPkgManagerCommand,
readFilep as read,
readJsonp as readJson,
writeFileAtomicp as write,
Bag,
DefaultPackage,
} from './util';
Expand Down Expand Up @@ -168,7 +168,7 @@ async function writePackageJson(
): Promise<void> {
options.logger.log('Writing package.json...');
if (!options.dryRun) {
await write('./package.json', formatJson(packageJson));
await writeFileAtomic('./package.json', formatJson(packageJson));
}
const preview = {
scripts: packageJson.scripts,
Expand Down Expand Up @@ -216,7 +216,7 @@ async function generateConfigFile(
if (writeFile) {
options.logger.log(`Writing ${filename}...`);
if (!options.dryRun) {
await write(filename, contents);
await writeFileAtomic(filename, contents);
}
options.logger.log(contents);
}
Expand Down
2 changes: 0 additions & 2 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ import * as path from 'path';
import * as rimraf from 'rimraf';
import {promisify} from 'util';
import * as ncp from 'ncp';
import * as writeFileAtomic from 'write-file-atomic';
import * as JSON5 from 'json5';

export const readFilep = promisify(fs.readFile);
export const rimrafp = promisify(rimraf);
export const writeFileAtomicp = promisify(writeFileAtomic);
export const ncpp = promisify(ncp.ncp);

export interface Bag<T> {
Expand Down