Skip to content

Commit 12e2c3c

Browse files
authored
Supported Windows (#113)
* chore: Downstreamed changes from @codemod-utils/[email protected] * refactor: Removed unused code * chore: Updated source code * chore: Updated tests * chore: Added lockfile * chore: Added changeset
1 parent c4e8fca commit 12e2c3c

File tree

20 files changed

+249
-341
lines changed

20 files changed

+249
-341
lines changed

.changeset/config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
3-
"changelog": "./format-changelogs.cjs",
2+
"$schema": "https://unpkg.com/@changesets/config/schema.json",
3+
"changelog": "./format-changelogs.mjs",
44
"commit": false,
55
"fixed": [],
66
"linked": [],

.changeset/format-changelogs.cjs renamed to .changeset/format-changelogs.mjs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
const { getInfo } = require('@changesets/get-github-info');
1+
import { EOL } from 'node:os';
2+
3+
import { getInfo } from '@changesets/get-github-info';
24

35
const repo = 'ijlee2/ember-codemod-v1-to-v2';
46

@@ -10,7 +12,7 @@ async function analyze(changeset) {
1012

1113
const contributor = info.user ? `(${info.user})` : undefined;
1214
const link = info.pull ?? info.commit ?? undefined;
13-
const summary = (changeset.summary ?? '').split('\n')[0].trim();
15+
const summary = (changeset.summary ?? '').split(EOL)[0].trim();
1416

1517
return {
1618
contributor,
@@ -31,7 +33,7 @@ async function getDependencyReleaseLine(changesets) {
3133
try {
3234
const lines = await Promise.all(changesets.map(summarize));
3335

34-
return lines.join('\n');
36+
return lines.join(EOL);
3537
} catch (error) {
3638
console.error(`ERROR: getDependencyReleaseLine (${error.message})`);
3739

@@ -49,7 +51,7 @@ async function getReleaseLine(changeset) {
4951
}
5052
}
5153

52-
module.exports = {
54+
export default {
5355
getDependencyReleaseLine,
5456
getReleaseLine,
5557
};

.changeset/forty-hounds-bet.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"ember-codemod-v1-to-v2": minor
3+
---
4+
5+
Supported Windows

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,27 @@ jobs:
5656

5757
- name: Test
5858
run: pnpm test
59+
60+
61+
test-on-windows:
62+
name: Test on Windows
63+
runs-on: windows-latest
64+
timeout-minutes: 5
65+
steps:
66+
- name: Check out a copy of the repo
67+
uses: actions/checkout@v5
68+
69+
- name: Set up pnpm
70+
uses: pnpm/action-setup@v4
71+
72+
- name: Use Node.js ${{ env.NODE_VERSION }}
73+
uses: actions/setup-node@v5
74+
with:
75+
cache: 'pnpm'
76+
node-version: ${{ env.NODE_VERSION }}
77+
78+
- name: Install dependencies
79+
run: pnpm install --frozen-lockfile
80+
81+
- name: Test
82+
run: pnpm test

package.json

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"dist"
2828
],
2929
"scripts": {
30-
"build": "./build.sh --production",
30+
"build": "sh build.sh --production",
3131
"format": "prettier . --cache --write",
3232
"lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\"",
3333
"lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\" && pnpm format",
@@ -38,32 +38,31 @@
3838
"prepare": "pnpm build",
3939
"release:prepare": "changeset version",
4040
"release:publish": "pnpm build && changeset publish",
41-
"test": "./build.sh --test && mt dist-for-testing --quiet"
41+
"test": "sh build.sh --test && mt dist-for-testing --quiet"
4242
},
4343
"dependencies": {
44-
"@codemod-utils/blueprints": "^2.0.3",
45-
"@codemod-utils/files": "^3.0.6",
46-
"@codemod-utils/package-json": "^3.2.3",
47-
"strip-json-comments": "^5.0.3",
44+
"@codemod-utils/blueprints": "^2.1.0",
45+
"@codemod-utils/files": "^3.2.1",
46+
"@codemod-utils/package-json": "^3.3.0",
4847
"yargs": "^18.0.0"
4948
},
5049
"devDependencies": {
51-
"@changesets/cli": "^2.29.7",
52-
"@changesets/get-github-info": "^0.6.0",
53-
"@codemod-utils/tests": "^2.0.6",
54-
"@ijlee2-frontend-configs/eslint-config-node": "^2.2.3",
55-
"@ijlee2-frontend-configs/prettier": "^2.2.0",
50+
"@changesets/cli": "^2.29.8",
51+
"@changesets/get-github-info": "^0.7.0",
52+
"@codemod-utils/tests": "^2.2.0",
53+
"@ijlee2-frontend-configs/eslint-config-node": "^2.3.0",
54+
"@ijlee2-frontend-configs/prettier": "^2.3.0",
5655
"@sondr3/minitest": "^0.1.2",
5756
"@tsconfig/node20": "^20.1.8",
5857
"@tsconfig/strictest": "^2.0.8",
5958
"@types/node": "^20.19.25",
6059
"@types/yargs": "^17.0.35",
6160
"concurrently": "^9.2.1",
6261
"eslint": "^9.39.1",
63-
"prettier": "^3.6.2",
62+
"prettier": "^3.7.4",
6463
"typescript": "^5.9.3"
6564
},
66-
"packageManager": "pnpm@10.22.0",
65+
"packageManager": "pnpm@10.24.0",
6766
"engines": {
6867
"node": "20.* || >= 22"
6968
}

0 commit comments

Comments
 (0)