diff --git a/.changeset/giant-trees-turn.md b/.changeset/giant-trees-turn.md new file mode 100644 index 00000000..d1ca3205 --- /dev/null +++ b/.changeset/giant-trees-turn.md @@ -0,0 +1,5 @@ +--- +"@codemod-utils/cli": minor +--- + +Updated latestVersions and blueprints diff --git a/packages/cli/src/blueprints/.changeset/config.json b/packages/cli/src/blueprints/.changeset/config.json index 2a1d12cf..abda549c 100644 --- a/packages/cli/src/blueprints/.changeset/config.json +++ b/packages/cli/src/blueprints/.changeset/config.json @@ -1,6 +1,6 @@ { "$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json", - "changelog": "./formatter.cjs", + "changelog": "./format-changelogs.cjs", "commit": false, "fixed": [], "linked": [], diff --git a/packages/cli/src/blueprints/.changeset/formatter.cjs b/packages/cli/src/blueprints/.changeset/format-changelogs.cjs similarity index 56% rename from packages/cli/src/blueprints/.changeset/formatter.cjs rename to packages/cli/src/blueprints/.changeset/format-changelogs.cjs index ef8782c1..6c782b0b 100644 --- a/packages/cli/src/blueprints/.changeset/formatter.cjs +++ b/packages/cli/src/blueprints/.changeset/format-changelogs.cjs @@ -2,7 +2,7 @@ const { getInfo } = require('@changesets/get-github-info'); const repo = '/<%= options.codemod.name %>'; -async function extractInformation(changeset) { +async function analyze(changeset) { const { links: info } = await getInfo({ commit: changeset.commit, repo, @@ -19,17 +19,29 @@ async function extractInformation(changeset) { }; } -function getDependencyReleaseLine() { - return ''; +async function summarize(changeset) { + const { contributor, link, summary } = await analyze(changeset); + + const line = [link, summary, contributor].filter(Boolean).join(' '); + + return `- ${line}`; } -async function getReleaseLine(changeset) { +async function getDependencyReleaseLine(changesets) { try { - const { contributor, link, summary } = await extractInformation(changeset); + const lines = await Promise.all(changesets.map(summarize)); + + return lines.join('\n'); + } catch (error) { + console.error(`ERROR: getDependencyReleaseLine (${error.message})`); - const line = [link, summary, contributor].filter(Boolean).join(' '); + return ''; + } +} - return `- ${line}`; +async function getReleaseLine(changeset) { + try { + return summarize(changeset); } catch (error) { console.error(`ERROR: getReleaseLine (${error.message})`); diff --git a/packages/cli/src/blueprints/.eslintrc.cjs b/packages/cli/src/blueprints/.eslintrc.cjs index f52000ac..52d2400a 100644 --- a/packages/cli/src/blueprints/.eslintrc.cjs +++ b/packages/cli/src/blueprints/.eslintrc.cjs @@ -55,6 +55,12 @@ }, extends: ['plugin:n/recommended'], }, + { + files: ['bin/**/*.{js,ts}'], + rules: { + 'n/hashbang': 'off', + }, + }, ], };<% } else { %>module.exports = { root: true, @@ -93,5 +99,11 @@ }, extends: ['plugin:n/recommended'], }, + { + files: ['bin/**/*.{js,ts}'], + rules: { + 'n/hashbang': 'off', + }, + }, ], };<% } %> diff --git a/packages/cli/src/blueprints/bin/__codemod-name__.__js__ b/packages/cli/src/blueprints/bin/__codemod-name__.__js__ index e8279e73..76f45023 100644 --- a/packages/cli/src/blueprints/bin/__codemod-name__.__js__ +++ b/packages/cli/src/blueprints/bin/__codemod-name__.__js__ @@ -1,5 +1,4 @@ <% if (options.codemod.hasTypeScript) { %>#!/usr/bin/env node -// eslint-disable-next-line n/shebang 'use strict'; import yargs from 'yargs'; @@ -24,7 +23,6 @@ const codemodOptions: CodemodOptions = { }; runCodemod(codemodOptions);<% } else { %>#!/usr/bin/env node -// eslint-disable-next-line n/shebang 'use strict'; import yargs from 'yargs'; diff --git a/packages/cli/src/utils/blueprints/get-version.ts b/packages/cli/src/utils/blueprints/get-version.ts index c8c8fba5..5c7e6f05 100644 --- a/packages/cli/src/utils/blueprints/get-version.ts +++ b/packages/cli/src/utils/blueprints/get-version.ts @@ -1,35 +1,35 @@ import { decideVersion } from '@codemod-utils/blueprints'; const latestVersions = new Map([ - ['@babel/core', '7.24.0'], - ['@babel/eslint-parser', '7.23.10'], + ['@babel/core', '7.24.4'], + ['@babel/eslint-parser', '7.24.1'], ['@changesets/cli', '2.27.1'], ['@changesets/get-github-info', '0.6.0'], - ['@codemod-utils/ast-javascript', '1.2.4'], + ['@codemod-utils/ast-javascript', '1.2.5'], ['@codemod-utils/ast-template', '1.1.2'], ['@codemod-utils/blueprints', '1.1.2'], ['@codemod-utils/ember-cli-string', '1.1.2'], - ['@codemod-utils/files', '2.0.0'], - ['@codemod-utils/json', '1.1.5'], - ['@codemod-utils/tests', '1.1.3'], + ['@codemod-utils/files', '2.0.1'], + ['@codemod-utils/json', '1.1.6'], + ['@codemod-utils/tests', '1.1.4'], ['@sondr3/minitest', '0.1.2'], - ['@tsconfig/node18', '18.2.2'], - ['@tsconfig/strictest', '2.0.3'], - ['@types/node', '18.19.24'], + ['@tsconfig/node18', '18.2.4'], + ['@tsconfig/strictest', '2.0.5'], + ['@types/node', '18.19.31'], ['@types/yargs', '17.0.32'], - ['@typescript-eslint/eslint-plugin', '7.2.0'], - ['@typescript-eslint/parser', '7.2.0'], + ['@typescript-eslint/eslint-plugin', '7.7.0'], + ['@typescript-eslint/parser', '7.7.0'], ['concurrently', '8.2.2'], ['eslint', '8.57.0'], ['eslint-config-prettier', '9.1.0'], ['eslint-import-resolver-typescript', '3.6.1'], ['eslint-plugin-import', '2.29.1'], - ['eslint-plugin-n', '16.6.2'], + ['eslint-plugin-n', '17.2.1'], ['eslint-plugin-prettier', '5.1.3'], - ['eslint-plugin-simple-import-sort', '12.0.0'], + ['eslint-plugin-simple-import-sort', '12.1.0'], ['eslint-plugin-typescript-sort-keys', '3.2.0'], ['prettier', '3.2.5'], - ['typescript', '5.4.2'], + ['typescript', '5.4.5'], ['yargs', '17.7.2'], ]); diff --git a/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/.changeset/config.json b/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/.changeset/config.json index 2a1d12cf..abda549c 100644 --- a/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/.changeset/config.json +++ b/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/.changeset/config.json @@ -1,6 +1,6 @@ { "$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json", - "changelog": "./formatter.cjs", + "changelog": "./format-changelogs.cjs", "commit": false, "fixed": [], "linked": [], diff --git a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript-with-addons/output/ember-codemod-args-to-signature/.changeset/formatter.cjs b/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/.changeset/format-changelogs.cjs similarity index 56% rename from packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript-with-addons/output/ember-codemod-args-to-signature/.changeset/formatter.cjs rename to packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/.changeset/format-changelogs.cjs index 052d1a35..da4d20ca 100644 --- a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript-with-addons/output/ember-codemod-args-to-signature/.changeset/formatter.cjs +++ b/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/.changeset/format-changelogs.cjs @@ -2,7 +2,7 @@ const { getInfo } = require('@changesets/get-github-info'); const repo = '/ember-codemod-args-to-signature'; -async function extractInformation(changeset) { +async function analyze(changeset) { const { links: info } = await getInfo({ commit: changeset.commit, repo, @@ -19,17 +19,29 @@ async function extractInformation(changeset) { }; } -function getDependencyReleaseLine() { - return ''; +async function summarize(changeset) { + const { contributor, link, summary } = await analyze(changeset); + + const line = [link, summary, contributor].filter(Boolean).join(' '); + + return `- ${line}`; } -async function getReleaseLine(changeset) { +async function getDependencyReleaseLine(changesets) { try { - const { contributor, link, summary } = await extractInformation(changeset); + const lines = await Promise.all(changesets.map(summarize)); + + return lines.join('\n'); + } catch (error) { + console.error(`ERROR: getDependencyReleaseLine (${error.message})`); - const line = [link, summary, contributor].filter(Boolean).join(' '); + return ''; + } +} - return `- ${line}`; +async function getReleaseLine(changeset) { + try { + return summarize(changeset); } catch (error) { console.error(`ERROR: getReleaseLine (${error.message})`); diff --git a/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/.eslintrc.cjs b/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/.eslintrc.cjs index 211d9c39..9f589b55 100644 --- a/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/.eslintrc.cjs +++ b/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/.eslintrc.cjs @@ -37,5 +37,11 @@ module.exports = { }, extends: ['plugin:n/recommended'], }, + { + files: ['bin/**/*.{js,ts}'], + rules: { + 'n/hashbang': 'off', + }, + }, ], }; diff --git a/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/bin/ember-codemod-args-to-signature.js b/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/bin/ember-codemod-args-to-signature.js index 952236cc..09994389 100755 --- a/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/bin/ember-codemod-args-to-signature.js +++ b/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/bin/ember-codemod-args-to-signature.js @@ -1,5 +1,4 @@ #!/usr/bin/env node -// eslint-disable-next-line n/shebang 'use strict'; import yargs from 'yargs'; diff --git a/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/package.json b/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/package.json index 340ed7ab..6083ece9 100644 --- a/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/package.json +++ b/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/package.json @@ -31,28 +31,28 @@ "test": "mt tests --quiet" }, "dependencies": { - "@codemod-utils/ast-javascript": "^1.2.4", + "@codemod-utils/ast-javascript": "^1.2.5", "@codemod-utils/ast-template": "^1.1.2", "@codemod-utils/blueprints": "^1.1.2", "@codemod-utils/ember-cli-string": "^1.1.2", - "@codemod-utils/files": "^2.0.0", - "@codemod-utils/json": "^1.1.5", + "@codemod-utils/files": "^2.0.1", + "@codemod-utils/json": "^1.1.6", "yargs": "^17.7.2" }, "devDependencies": { - "@babel/core": "^7.24.0", - "@babel/eslint-parser": "^7.23.10", + "@babel/core": "^7.24.4", + "@babel/eslint-parser": "^7.24.1", "@changesets/cli": "^2.27.1", "@changesets/get-github-info": "^0.6.0", - "@codemod-utils/tests": "^1.1.3", + "@codemod-utils/tests": "^1.1.4", "@sondr3/minitest": "^0.1.2", "concurrently": "^8.2.2", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^16.6.2", + "eslint-plugin-n": "^17.2.1", "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-simple-import-sort": "^12.0.0", + "eslint-plugin-simple-import-sort": "^12.1.0", "prettier": "^3.2.5" }, "engines": { diff --git a/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/.changeset/config.json b/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/.changeset/config.json index 2a1d12cf..abda549c 100644 --- a/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/.changeset/config.json +++ b/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/.changeset/config.json @@ -1,6 +1,6 @@ { "$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json", - "changelog": "./formatter.cjs", + "changelog": "./format-changelogs.cjs", "commit": false, "fixed": [], "linked": [], diff --git a/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/.changeset/formatter.cjs b/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/.changeset/format-changelogs.cjs similarity index 56% rename from packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/.changeset/formatter.cjs rename to packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/.changeset/format-changelogs.cjs index 5db18ebb..57cbc075 100644 --- a/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/.changeset/formatter.cjs +++ b/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/.changeset/format-changelogs.cjs @@ -2,7 +2,7 @@ const { getInfo } = require('@changesets/get-github-info'); const repo = '/ember-codemod-pod-to-octane'; -async function extractInformation(changeset) { +async function analyze(changeset) { const { links: info } = await getInfo({ commit: changeset.commit, repo, @@ -19,17 +19,29 @@ async function extractInformation(changeset) { }; } -function getDependencyReleaseLine() { - return ''; +async function summarize(changeset) { + const { contributor, link, summary } = await analyze(changeset); + + const line = [link, summary, contributor].filter(Boolean).join(' '); + + return `- ${line}`; } -async function getReleaseLine(changeset) { +async function getDependencyReleaseLine(changesets) { try { - const { contributor, link, summary } = await extractInformation(changeset); + const lines = await Promise.all(changesets.map(summarize)); + + return lines.join('\n'); + } catch (error) { + console.error(`ERROR: getDependencyReleaseLine (${error.message})`); - const line = [link, summary, contributor].filter(Boolean).join(' '); + return ''; + } +} - return `- ${line}`; +async function getReleaseLine(changeset) { + try { + return summarize(changeset); } catch (error) { console.error(`ERROR: getReleaseLine (${error.message})`); diff --git a/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/.eslintrc.cjs b/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/.eslintrc.cjs index 211d9c39..9f589b55 100644 --- a/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/.eslintrc.cjs +++ b/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/.eslintrc.cjs @@ -37,5 +37,11 @@ module.exports = { }, extends: ['plugin:n/recommended'], }, + { + files: ['bin/**/*.{js,ts}'], + rules: { + 'n/hashbang': 'off', + }, + }, ], }; diff --git a/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/bin/ember-codemod-pod-to-octane.js b/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/bin/ember-codemod-pod-to-octane.js index bec5f43b..43259143 100755 --- a/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/bin/ember-codemod-pod-to-octane.js +++ b/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/bin/ember-codemod-pod-to-octane.js @@ -1,5 +1,4 @@ #!/usr/bin/env node -// eslint-disable-next-line n/shebang 'use strict'; import yargs from 'yargs'; diff --git a/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/package.json b/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/package.json index c8eb193b..70c94ef6 100644 --- a/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/package.json +++ b/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/package.json @@ -31,23 +31,23 @@ "test": "mt tests --quiet" }, "dependencies": { - "@codemod-utils/files": "^2.0.0", + "@codemod-utils/files": "^2.0.1", "yargs": "^17.7.2" }, "devDependencies": { - "@babel/core": "^7.24.0", - "@babel/eslint-parser": "^7.23.10", + "@babel/core": "^7.24.4", + "@babel/eslint-parser": "^7.24.1", "@changesets/cli": "^2.27.1", "@changesets/get-github-info": "^0.6.0", - "@codemod-utils/tests": "^1.1.3", + "@codemod-utils/tests": "^1.1.4", "@sondr3/minitest": "^0.1.2", "concurrently": "^8.2.2", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^16.6.2", + "eslint-plugin-n": "^17.2.1", "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-simple-import-sort": "^12.0.0", + "eslint-plugin-simple-import-sort": "^12.1.0", "prettier": "^3.2.5" }, "engines": { diff --git a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript-with-addons/output/ember-codemod-args-to-signature/.changeset/config.json b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript-with-addons/output/ember-codemod-args-to-signature/.changeset/config.json index 2a1d12cf..abda549c 100644 --- a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript-with-addons/output/ember-codemod-args-to-signature/.changeset/config.json +++ b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript-with-addons/output/ember-codemod-args-to-signature/.changeset/config.json @@ -1,6 +1,6 @@ { "$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json", - "changelog": "./formatter.cjs", + "changelog": "./format-changelogs.cjs", "commit": false, "fixed": [], "linked": [], diff --git a/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/.changeset/formatter.cjs b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript-with-addons/output/ember-codemod-args-to-signature/.changeset/format-changelogs.cjs similarity index 56% rename from packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/.changeset/formatter.cjs rename to packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript-with-addons/output/ember-codemod-args-to-signature/.changeset/format-changelogs.cjs index 052d1a35..da4d20ca 100644 --- a/packages/cli/tests/fixtures/javascript-with-addons/output/ember-codemod-args-to-signature/.changeset/formatter.cjs +++ b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript-with-addons/output/ember-codemod-args-to-signature/.changeset/format-changelogs.cjs @@ -2,7 +2,7 @@ const { getInfo } = require('@changesets/get-github-info'); const repo = '/ember-codemod-args-to-signature'; -async function extractInformation(changeset) { +async function analyze(changeset) { const { links: info } = await getInfo({ commit: changeset.commit, repo, @@ -19,17 +19,29 @@ async function extractInformation(changeset) { }; } -function getDependencyReleaseLine() { - return ''; +async function summarize(changeset) { + const { contributor, link, summary } = await analyze(changeset); + + const line = [link, summary, contributor].filter(Boolean).join(' '); + + return `- ${line}`; } -async function getReleaseLine(changeset) { +async function getDependencyReleaseLine(changesets) { try { - const { contributor, link, summary } = await extractInformation(changeset); + const lines = await Promise.all(changesets.map(summarize)); + + return lines.join('\n'); + } catch (error) { + console.error(`ERROR: getDependencyReleaseLine (${error.message})`); - const line = [link, summary, contributor].filter(Boolean).join(' '); + return ''; + } +} - return `- ${line}`; +async function getReleaseLine(changeset) { + try { + return summarize(changeset); } catch (error) { console.error(`ERROR: getReleaseLine (${error.message})`); diff --git a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript-with-addons/output/ember-codemod-args-to-signature/.eslintrc.cjs b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript-with-addons/output/ember-codemod-args-to-signature/.eslintrc.cjs index 211d9c39..9f589b55 100644 --- a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript-with-addons/output/ember-codemod-args-to-signature/.eslintrc.cjs +++ b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript-with-addons/output/ember-codemod-args-to-signature/.eslintrc.cjs @@ -37,5 +37,11 @@ module.exports = { }, extends: ['plugin:n/recommended'], }, + { + files: ['bin/**/*.{js,ts}'], + rules: { + 'n/hashbang': 'off', + }, + }, ], }; diff --git a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript-with-addons/output/ember-codemod-args-to-signature/bin/ember-codemod-args-to-signature.js b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript-with-addons/output/ember-codemod-args-to-signature/bin/ember-codemod-args-to-signature.js index 952236cc..09994389 100755 --- a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript-with-addons/output/ember-codemod-args-to-signature/bin/ember-codemod-args-to-signature.js +++ b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript-with-addons/output/ember-codemod-args-to-signature/bin/ember-codemod-args-to-signature.js @@ -1,5 +1,4 @@ #!/usr/bin/env node -// eslint-disable-next-line n/shebang 'use strict'; import yargs from 'yargs'; diff --git a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-codemod-pod-to-octane/.changeset/config.json b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-codemod-pod-to-octane/.changeset/config.json index 2a1d12cf..abda549c 100644 --- a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-codemod-pod-to-octane/.changeset/config.json +++ b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-codemod-pod-to-octane/.changeset/config.json @@ -1,6 +1,6 @@ { "$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json", - "changelog": "./formatter.cjs", + "changelog": "./format-changelogs.cjs", "commit": false, "fixed": [], "linked": [], diff --git a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-codemod-pod-to-octane/.changeset/formatter.cjs b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-codemod-pod-to-octane/.changeset/format-changelogs.cjs similarity index 56% rename from packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-codemod-pod-to-octane/.changeset/formatter.cjs rename to packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-codemod-pod-to-octane/.changeset/format-changelogs.cjs index 5db18ebb..57cbc075 100644 --- a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-codemod-pod-to-octane/.changeset/formatter.cjs +++ b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-codemod-pod-to-octane/.changeset/format-changelogs.cjs @@ -2,7 +2,7 @@ const { getInfo } = require('@changesets/get-github-info'); const repo = '/ember-codemod-pod-to-octane'; -async function extractInformation(changeset) { +async function analyze(changeset) { const { links: info } = await getInfo({ commit: changeset.commit, repo, @@ -19,17 +19,29 @@ async function extractInformation(changeset) { }; } -function getDependencyReleaseLine() { - return ''; +async function summarize(changeset) { + const { contributor, link, summary } = await analyze(changeset); + + const line = [link, summary, contributor].filter(Boolean).join(' '); + + return `- ${line}`; } -async function getReleaseLine(changeset) { +async function getDependencyReleaseLine(changesets) { try { - const { contributor, link, summary } = await extractInformation(changeset); + const lines = await Promise.all(changesets.map(summarize)); + + return lines.join('\n'); + } catch (error) { + console.error(`ERROR: getDependencyReleaseLine (${error.message})`); - const line = [link, summary, contributor].filter(Boolean).join(' '); + return ''; + } +} - return `- ${line}`; +async function getReleaseLine(changeset) { + try { + return summarize(changeset); } catch (error) { console.error(`ERROR: getReleaseLine (${error.message})`); diff --git a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-codemod-pod-to-octane/.eslintrc.cjs b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-codemod-pod-to-octane/.eslintrc.cjs index 211d9c39..9f589b55 100644 --- a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-codemod-pod-to-octane/.eslintrc.cjs +++ b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-codemod-pod-to-octane/.eslintrc.cjs @@ -37,5 +37,11 @@ module.exports = { }, extends: ['plugin:n/recommended'], }, + { + files: ['bin/**/*.{js,ts}'], + rules: { + 'n/hashbang': 'off', + }, + }, ], }; diff --git a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-codemod-pod-to-octane/bin/ember-codemod-pod-to-octane.js b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-codemod-pod-to-octane/bin/ember-codemod-pod-to-octane.js index bec5f43b..43259143 100755 --- a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-codemod-pod-to-octane/bin/ember-codemod-pod-to-octane.js +++ b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-codemod-pod-to-octane/bin/ember-codemod-pod-to-octane.js @@ -1,5 +1,4 @@ #!/usr/bin/env node -// eslint-disable-next-line n/shebang 'use strict'; import yargs from 'yargs'; diff --git a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript-with-addons/output/ember-codemod-args-to-signature/.changeset/config.json b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript-with-addons/output/ember-codemod-args-to-signature/.changeset/config.json index 2a1d12cf..abda549c 100644 --- a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript-with-addons/output/ember-codemod-args-to-signature/.changeset/config.json +++ b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript-with-addons/output/ember-codemod-args-to-signature/.changeset/config.json @@ -1,6 +1,6 @@ { "$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json", - "changelog": "./formatter.cjs", + "changelog": "./format-changelogs.cjs", "commit": false, "fixed": [], "linked": [], diff --git a/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/.changeset/formatter.cjs b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript-with-addons/output/ember-codemod-args-to-signature/.changeset/format-changelogs.cjs similarity index 56% rename from packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/.changeset/formatter.cjs rename to packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript-with-addons/output/ember-codemod-args-to-signature/.changeset/format-changelogs.cjs index 052d1a35..da4d20ca 100644 --- a/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/.changeset/formatter.cjs +++ b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript-with-addons/output/ember-codemod-args-to-signature/.changeset/format-changelogs.cjs @@ -2,7 +2,7 @@ const { getInfo } = require('@changesets/get-github-info'); const repo = '/ember-codemod-args-to-signature'; -async function extractInformation(changeset) { +async function analyze(changeset) { const { links: info } = await getInfo({ commit: changeset.commit, repo, @@ -19,17 +19,29 @@ async function extractInformation(changeset) { }; } -function getDependencyReleaseLine() { - return ''; +async function summarize(changeset) { + const { contributor, link, summary } = await analyze(changeset); + + const line = [link, summary, contributor].filter(Boolean).join(' '); + + return `- ${line}`; } -async function getReleaseLine(changeset) { +async function getDependencyReleaseLine(changesets) { try { - const { contributor, link, summary } = await extractInformation(changeset); + const lines = await Promise.all(changesets.map(summarize)); + + return lines.join('\n'); + } catch (error) { + console.error(`ERROR: getDependencyReleaseLine (${error.message})`); - const line = [link, summary, contributor].filter(Boolean).join(' '); + return ''; + } +} - return `- ${line}`; +async function getReleaseLine(changeset) { + try { + return summarize(changeset); } catch (error) { console.error(`ERROR: getReleaseLine (${error.message})`); diff --git a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript-with-addons/output/ember-codemod-args-to-signature/.eslintrc.cjs b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript-with-addons/output/ember-codemod-args-to-signature/.eslintrc.cjs index 94abfdaf..758ce769 100644 --- a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript-with-addons/output/ember-codemod-args-to-signature/.eslintrc.cjs +++ b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript-with-addons/output/ember-codemod-args-to-signature/.eslintrc.cjs @@ -55,5 +55,11 @@ module.exports = { }, extends: ['plugin:n/recommended'], }, + { + files: ['bin/**/*.{js,ts}'], + rules: { + 'n/hashbang': 'off', + }, + }, ], }; diff --git a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript-with-addons/output/ember-codemod-args-to-signature/bin/ember-codemod-args-to-signature.ts b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript-with-addons/output/ember-codemod-args-to-signature/bin/ember-codemod-args-to-signature.ts index ccbafe3e..0f8f2cb3 100755 --- a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript-with-addons/output/ember-codemod-args-to-signature/bin/ember-codemod-args-to-signature.ts +++ b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript-with-addons/output/ember-codemod-args-to-signature/bin/ember-codemod-args-to-signature.ts @@ -1,5 +1,4 @@ #!/usr/bin/env node -// eslint-disable-next-line n/shebang 'use strict'; import yargs from 'yargs'; diff --git a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-codemod-pod-to-octane/.changeset/config.json b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-codemod-pod-to-octane/.changeset/config.json index 2a1d12cf..abda549c 100644 --- a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-codemod-pod-to-octane/.changeset/config.json +++ b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-codemod-pod-to-octane/.changeset/config.json @@ -1,6 +1,6 @@ { "$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json", - "changelog": "./formatter.cjs", + "changelog": "./format-changelogs.cjs", "commit": false, "fixed": [], "linked": [], diff --git a/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/.changeset/formatter.cjs b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-codemod-pod-to-octane/.changeset/format-changelogs.cjs similarity index 56% rename from packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/.changeset/formatter.cjs rename to packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-codemod-pod-to-octane/.changeset/format-changelogs.cjs index 5db18ebb..57cbc075 100644 --- a/packages/cli/tests/fixtures/javascript/output/ember-codemod-pod-to-octane/.changeset/formatter.cjs +++ b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-codemod-pod-to-octane/.changeset/format-changelogs.cjs @@ -2,7 +2,7 @@ const { getInfo } = require('@changesets/get-github-info'); const repo = '/ember-codemod-pod-to-octane'; -async function extractInformation(changeset) { +async function analyze(changeset) { const { links: info } = await getInfo({ commit: changeset.commit, repo, @@ -19,17 +19,29 @@ async function extractInformation(changeset) { }; } -function getDependencyReleaseLine() { - return ''; +async function summarize(changeset) { + const { contributor, link, summary } = await analyze(changeset); + + const line = [link, summary, contributor].filter(Boolean).join(' '); + + return `- ${line}`; } -async function getReleaseLine(changeset) { +async function getDependencyReleaseLine(changesets) { try { - const { contributor, link, summary } = await extractInformation(changeset); + const lines = await Promise.all(changesets.map(summarize)); + + return lines.join('\n'); + } catch (error) { + console.error(`ERROR: getDependencyReleaseLine (${error.message})`); - const line = [link, summary, contributor].filter(Boolean).join(' '); + return ''; + } +} - return `- ${line}`; +async function getReleaseLine(changeset) { + try { + return summarize(changeset); } catch (error) { console.error(`ERROR: getReleaseLine (${error.message})`); diff --git a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-codemod-pod-to-octane/.eslintrc.cjs b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-codemod-pod-to-octane/.eslintrc.cjs index 94abfdaf..758ce769 100644 --- a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-codemod-pod-to-octane/.eslintrc.cjs +++ b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-codemod-pod-to-octane/.eslintrc.cjs @@ -55,5 +55,11 @@ module.exports = { }, extends: ['plugin:n/recommended'], }, + { + files: ['bin/**/*.{js,ts}'], + rules: { + 'n/hashbang': 'off', + }, + }, ], }; diff --git a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-codemod-pod-to-octane/bin/ember-codemod-pod-to-octane.ts b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-codemod-pod-to-octane/bin/ember-codemod-pod-to-octane.ts index 9e41f810..c5d87c78 100755 --- a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-codemod-pod-to-octane/bin/ember-codemod-pod-to-octane.ts +++ b/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-codemod-pod-to-octane/bin/ember-codemod-pod-to-octane.ts @@ -1,5 +1,4 @@ #!/usr/bin/env node -// eslint-disable-next-line n/shebang 'use strict'; import yargs from 'yargs'; diff --git a/packages/cli/tests/fixtures/steps/update-package-json/javascript-with-addons/output/ember-codemod-args-to-signature/package.json b/packages/cli/tests/fixtures/steps/update-package-json/javascript-with-addons/output/ember-codemod-args-to-signature/package.json index 340ed7ab..6083ece9 100644 --- a/packages/cli/tests/fixtures/steps/update-package-json/javascript-with-addons/output/ember-codemod-args-to-signature/package.json +++ b/packages/cli/tests/fixtures/steps/update-package-json/javascript-with-addons/output/ember-codemod-args-to-signature/package.json @@ -31,28 +31,28 @@ "test": "mt tests --quiet" }, "dependencies": { - "@codemod-utils/ast-javascript": "^1.2.4", + "@codemod-utils/ast-javascript": "^1.2.5", "@codemod-utils/ast-template": "^1.1.2", "@codemod-utils/blueprints": "^1.1.2", "@codemod-utils/ember-cli-string": "^1.1.2", - "@codemod-utils/files": "^2.0.0", - "@codemod-utils/json": "^1.1.5", + "@codemod-utils/files": "^2.0.1", + "@codemod-utils/json": "^1.1.6", "yargs": "^17.7.2" }, "devDependencies": { - "@babel/core": "^7.24.0", - "@babel/eslint-parser": "^7.23.10", + "@babel/core": "^7.24.4", + "@babel/eslint-parser": "^7.24.1", "@changesets/cli": "^2.27.1", "@changesets/get-github-info": "^0.6.0", - "@codemod-utils/tests": "^1.1.3", + "@codemod-utils/tests": "^1.1.4", "@sondr3/minitest": "^0.1.2", "concurrently": "^8.2.2", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^16.6.2", + "eslint-plugin-n": "^17.2.1", "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-simple-import-sort": "^12.0.0", + "eslint-plugin-simple-import-sort": "^12.1.0", "prettier": "^3.2.5" }, "engines": { diff --git a/packages/cli/tests/fixtures/steps/update-package-json/javascript/output/ember-codemod-pod-to-octane/package.json b/packages/cli/tests/fixtures/steps/update-package-json/javascript/output/ember-codemod-pod-to-octane/package.json index c8eb193b..70c94ef6 100644 --- a/packages/cli/tests/fixtures/steps/update-package-json/javascript/output/ember-codemod-pod-to-octane/package.json +++ b/packages/cli/tests/fixtures/steps/update-package-json/javascript/output/ember-codemod-pod-to-octane/package.json @@ -31,23 +31,23 @@ "test": "mt tests --quiet" }, "dependencies": { - "@codemod-utils/files": "^2.0.0", + "@codemod-utils/files": "^2.0.1", "yargs": "^17.7.2" }, "devDependencies": { - "@babel/core": "^7.24.0", - "@babel/eslint-parser": "^7.23.10", + "@babel/core": "^7.24.4", + "@babel/eslint-parser": "^7.24.1", "@changesets/cli": "^2.27.1", "@changesets/get-github-info": "^0.6.0", - "@codemod-utils/tests": "^1.1.3", + "@codemod-utils/tests": "^1.1.4", "@sondr3/minitest": "^0.1.2", "concurrently": "^8.2.2", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^16.6.2", + "eslint-plugin-n": "^17.2.1", "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-simple-import-sort": "^12.0.0", + "eslint-plugin-simple-import-sort": "^12.1.0", "prettier": "^3.2.5" }, "engines": { diff --git a/packages/cli/tests/fixtures/steps/update-package-json/typescript-with-addons/output/ember-codemod-args-to-signature/package.json b/packages/cli/tests/fixtures/steps/update-package-json/typescript-with-addons/output/ember-codemod-args-to-signature/package.json index 8afb2693..16edec51 100644 --- a/packages/cli/tests/fixtures/steps/update-package-json/typescript-with-addons/output/ember-codemod-args-to-signature/package.json +++ b/packages/cli/tests/fixtures/steps/update-package-json/typescript-with-addons/output/ember-codemod-args-to-signature/package.json @@ -33,37 +33,37 @@ "test": "./build.sh --test && mt dist-for-testing --quiet" }, "dependencies": { - "@codemod-utils/ast-javascript": "^1.2.4", + "@codemod-utils/ast-javascript": "^1.2.5", "@codemod-utils/ast-template": "^1.1.2", "@codemod-utils/blueprints": "^1.1.2", "@codemod-utils/ember-cli-string": "^1.1.2", - "@codemod-utils/files": "^2.0.0", - "@codemod-utils/json": "^1.1.5", + "@codemod-utils/files": "^2.0.1", + "@codemod-utils/json": "^1.1.6", "yargs": "^17.7.2" }, "devDependencies": { - "@babel/core": "^7.24.0", + "@babel/core": "^7.24.4", "@changesets/cli": "^2.27.1", "@changesets/get-github-info": "^0.6.0", - "@codemod-utils/tests": "^1.1.3", + "@codemod-utils/tests": "^1.1.4", "@sondr3/minitest": "^0.1.2", - "@tsconfig/node18": "^18.2.2", - "@tsconfig/strictest": "^2.0.3", - "@types/node": "^18.19.24", + "@tsconfig/node18": "^18.2.4", + "@tsconfig/strictest": "^2.0.5", + "@types/node": "^18.19.31", "@types/yargs": "^17.0.32", - "@typescript-eslint/eslint-plugin": "^7.2.0", - "@typescript-eslint/parser": "^7.2.0", + "@typescript-eslint/eslint-plugin": "^7.7.0", + "@typescript-eslint/parser": "^7.7.0", "concurrently": "^8.2.2", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^16.6.2", + "eslint-plugin-n": "^17.2.1", "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-simple-import-sort": "^12.0.0", + "eslint-plugin-simple-import-sort": "^12.1.0", "eslint-plugin-typescript-sort-keys": "^3.2.0", "prettier": "^3.2.5", - "typescript": "^5.4.2" + "typescript": "^5.4.5" }, "engines": { "node": "18.* || >= 20" diff --git a/packages/cli/tests/fixtures/steps/update-package-json/typescript/output/ember-codemod-pod-to-octane/package.json b/packages/cli/tests/fixtures/steps/update-package-json/typescript/output/ember-codemod-pod-to-octane/package.json index 4b761110..cb4e07d4 100644 --- a/packages/cli/tests/fixtures/steps/update-package-json/typescript/output/ember-codemod-pod-to-octane/package.json +++ b/packages/cli/tests/fixtures/steps/update-package-json/typescript/output/ember-codemod-pod-to-octane/package.json @@ -33,32 +33,32 @@ "test": "./build.sh --test && mt dist-for-testing --quiet" }, "dependencies": { - "@codemod-utils/files": "^2.0.0", + "@codemod-utils/files": "^2.0.1", "yargs": "^17.7.2" }, "devDependencies": { - "@babel/core": "^7.24.0", + "@babel/core": "^7.24.4", "@changesets/cli": "^2.27.1", "@changesets/get-github-info": "^0.6.0", - "@codemod-utils/tests": "^1.1.3", + "@codemod-utils/tests": "^1.1.4", "@sondr3/minitest": "^0.1.2", - "@tsconfig/node18": "^18.2.2", - "@tsconfig/strictest": "^2.0.3", - "@types/node": "^18.19.24", + "@tsconfig/node18": "^18.2.4", + "@tsconfig/strictest": "^2.0.5", + "@types/node": "^18.19.31", "@types/yargs": "^17.0.32", - "@typescript-eslint/eslint-plugin": "^7.2.0", - "@typescript-eslint/parser": "^7.2.0", + "@typescript-eslint/eslint-plugin": "^7.7.0", + "@typescript-eslint/parser": "^7.7.0", "concurrently": "^8.2.2", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^16.6.2", + "eslint-plugin-n": "^17.2.1", "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-simple-import-sort": "^12.0.0", + "eslint-plugin-simple-import-sort": "^12.1.0", "eslint-plugin-typescript-sort-keys": "^3.2.0", "prettier": "^3.2.5", - "typescript": "^5.4.2" + "typescript": "^5.4.5" }, "engines": { "node": "18.* || >= 20" diff --git a/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/.changeset/config.json b/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/.changeset/config.json index 2a1d12cf..abda549c 100644 --- a/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/.changeset/config.json +++ b/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/.changeset/config.json @@ -1,6 +1,6 @@ { "$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json", - "changelog": "./formatter.cjs", + "changelog": "./format-changelogs.cjs", "commit": false, "fixed": [], "linked": [], diff --git a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript-with-addons/output/ember-codemod-args-to-signature/.changeset/formatter.cjs b/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/.changeset/format-changelogs.cjs similarity index 56% rename from packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript-with-addons/output/ember-codemod-args-to-signature/.changeset/formatter.cjs rename to packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/.changeset/format-changelogs.cjs index 052d1a35..da4d20ca 100644 --- a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/javascript-with-addons/output/ember-codemod-args-to-signature/.changeset/formatter.cjs +++ b/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/.changeset/format-changelogs.cjs @@ -2,7 +2,7 @@ const { getInfo } = require('@changesets/get-github-info'); const repo = '/ember-codemod-args-to-signature'; -async function extractInformation(changeset) { +async function analyze(changeset) { const { links: info } = await getInfo({ commit: changeset.commit, repo, @@ -19,17 +19,29 @@ async function extractInformation(changeset) { }; } -function getDependencyReleaseLine() { - return ''; +async function summarize(changeset) { + const { contributor, link, summary } = await analyze(changeset); + + const line = [link, summary, contributor].filter(Boolean).join(' '); + + return `- ${line}`; } -async function getReleaseLine(changeset) { +async function getDependencyReleaseLine(changesets) { try { - const { contributor, link, summary } = await extractInformation(changeset); + const lines = await Promise.all(changesets.map(summarize)); + + return lines.join('\n'); + } catch (error) { + console.error(`ERROR: getDependencyReleaseLine (${error.message})`); - const line = [link, summary, contributor].filter(Boolean).join(' '); + return ''; + } +} - return `- ${line}`; +async function getReleaseLine(changeset) { + try { + return summarize(changeset); } catch (error) { console.error(`ERROR: getReleaseLine (${error.message})`); diff --git a/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/.eslintrc.cjs b/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/.eslintrc.cjs index 94abfdaf..758ce769 100644 --- a/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/.eslintrc.cjs +++ b/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/.eslintrc.cjs @@ -55,5 +55,11 @@ module.exports = { }, extends: ['plugin:n/recommended'], }, + { + files: ['bin/**/*.{js,ts}'], + rules: { + 'n/hashbang': 'off', + }, + }, ], }; diff --git a/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/bin/ember-codemod-args-to-signature.ts b/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/bin/ember-codemod-args-to-signature.ts index ccbafe3e..0f8f2cb3 100755 --- a/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/bin/ember-codemod-args-to-signature.ts +++ b/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/bin/ember-codemod-args-to-signature.ts @@ -1,5 +1,4 @@ #!/usr/bin/env node -// eslint-disable-next-line n/shebang 'use strict'; import yargs from 'yargs'; diff --git a/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/package.json b/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/package.json index 8afb2693..16edec51 100644 --- a/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/package.json +++ b/packages/cli/tests/fixtures/typescript-with-addons/output/ember-codemod-args-to-signature/package.json @@ -33,37 +33,37 @@ "test": "./build.sh --test && mt dist-for-testing --quiet" }, "dependencies": { - "@codemod-utils/ast-javascript": "^1.2.4", + "@codemod-utils/ast-javascript": "^1.2.5", "@codemod-utils/ast-template": "^1.1.2", "@codemod-utils/blueprints": "^1.1.2", "@codemod-utils/ember-cli-string": "^1.1.2", - "@codemod-utils/files": "^2.0.0", - "@codemod-utils/json": "^1.1.5", + "@codemod-utils/files": "^2.0.1", + "@codemod-utils/json": "^1.1.6", "yargs": "^17.7.2" }, "devDependencies": { - "@babel/core": "^7.24.0", + "@babel/core": "^7.24.4", "@changesets/cli": "^2.27.1", "@changesets/get-github-info": "^0.6.0", - "@codemod-utils/tests": "^1.1.3", + "@codemod-utils/tests": "^1.1.4", "@sondr3/minitest": "^0.1.2", - "@tsconfig/node18": "^18.2.2", - "@tsconfig/strictest": "^2.0.3", - "@types/node": "^18.19.24", + "@tsconfig/node18": "^18.2.4", + "@tsconfig/strictest": "^2.0.5", + "@types/node": "^18.19.31", "@types/yargs": "^17.0.32", - "@typescript-eslint/eslint-plugin": "^7.2.0", - "@typescript-eslint/parser": "^7.2.0", + "@typescript-eslint/eslint-plugin": "^7.7.0", + "@typescript-eslint/parser": "^7.7.0", "concurrently": "^8.2.2", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^16.6.2", + "eslint-plugin-n": "^17.2.1", "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-simple-import-sort": "^12.0.0", + "eslint-plugin-simple-import-sort": "^12.1.0", "eslint-plugin-typescript-sort-keys": "^3.2.0", "prettier": "^3.2.5", - "typescript": "^5.4.2" + "typescript": "^5.4.5" }, "engines": { "node": "18.* || >= 20" diff --git a/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/.changeset/config.json b/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/.changeset/config.json index 2a1d12cf..abda549c 100644 --- a/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/.changeset/config.json +++ b/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/.changeset/config.json @@ -1,6 +1,6 @@ { "$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json", - "changelog": "./formatter.cjs", + "changelog": "./format-changelogs.cjs", "commit": false, "fixed": [], "linked": [], diff --git a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-codemod-pod-to-octane/.changeset/formatter.cjs b/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/.changeset/format-changelogs.cjs similarity index 56% rename from packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-codemod-pod-to-octane/.changeset/formatter.cjs rename to packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/.changeset/format-changelogs.cjs index 5db18ebb..57cbc075 100644 --- a/packages/cli/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-codemod-pod-to-octane/.changeset/formatter.cjs +++ b/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/.changeset/format-changelogs.cjs @@ -2,7 +2,7 @@ const { getInfo } = require('@changesets/get-github-info'); const repo = '/ember-codemod-pod-to-octane'; -async function extractInformation(changeset) { +async function analyze(changeset) { const { links: info } = await getInfo({ commit: changeset.commit, repo, @@ -19,17 +19,29 @@ async function extractInformation(changeset) { }; } -function getDependencyReleaseLine() { - return ''; +async function summarize(changeset) { + const { contributor, link, summary } = await analyze(changeset); + + const line = [link, summary, contributor].filter(Boolean).join(' '); + + return `- ${line}`; } -async function getReleaseLine(changeset) { +async function getDependencyReleaseLine(changesets) { try { - const { contributor, link, summary } = await extractInformation(changeset); + const lines = await Promise.all(changesets.map(summarize)); + + return lines.join('\n'); + } catch (error) { + console.error(`ERROR: getDependencyReleaseLine (${error.message})`); - const line = [link, summary, contributor].filter(Boolean).join(' '); + return ''; + } +} - return `- ${line}`; +async function getReleaseLine(changeset) { + try { + return summarize(changeset); } catch (error) { console.error(`ERROR: getReleaseLine (${error.message})`); diff --git a/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/.eslintrc.cjs b/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/.eslintrc.cjs index 94abfdaf..758ce769 100644 --- a/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/.eslintrc.cjs +++ b/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/.eslintrc.cjs @@ -55,5 +55,11 @@ module.exports = { }, extends: ['plugin:n/recommended'], }, + { + files: ['bin/**/*.{js,ts}'], + rules: { + 'n/hashbang': 'off', + }, + }, ], }; diff --git a/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/bin/ember-codemod-pod-to-octane.ts b/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/bin/ember-codemod-pod-to-octane.ts index 9e41f810..c5d87c78 100755 --- a/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/bin/ember-codemod-pod-to-octane.ts +++ b/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/bin/ember-codemod-pod-to-octane.ts @@ -1,5 +1,4 @@ #!/usr/bin/env node -// eslint-disable-next-line n/shebang 'use strict'; import yargs from 'yargs'; diff --git a/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/package.json b/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/package.json index 4b761110..cb4e07d4 100644 --- a/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/package.json +++ b/packages/cli/tests/fixtures/typescript/output/ember-codemod-pod-to-octane/package.json @@ -33,32 +33,32 @@ "test": "./build.sh --test && mt dist-for-testing --quiet" }, "dependencies": { - "@codemod-utils/files": "^2.0.0", + "@codemod-utils/files": "^2.0.1", "yargs": "^17.7.2" }, "devDependencies": { - "@babel/core": "^7.24.0", + "@babel/core": "^7.24.4", "@changesets/cli": "^2.27.1", "@changesets/get-github-info": "^0.6.0", - "@codemod-utils/tests": "^1.1.3", + "@codemod-utils/tests": "^1.1.4", "@sondr3/minitest": "^0.1.2", - "@tsconfig/node18": "^18.2.2", - "@tsconfig/strictest": "^2.0.3", - "@types/node": "^18.19.24", + "@tsconfig/node18": "^18.2.4", + "@tsconfig/strictest": "^2.0.5", + "@types/node": "^18.19.31", "@types/yargs": "^17.0.32", - "@typescript-eslint/eslint-plugin": "^7.2.0", - "@typescript-eslint/parser": "^7.2.0", + "@typescript-eslint/eslint-plugin": "^7.7.0", + "@typescript-eslint/parser": "^7.7.0", "concurrently": "^8.2.2", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^16.6.2", + "eslint-plugin-n": "^17.2.1", "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-simple-import-sort": "^12.0.0", + "eslint-plugin-simple-import-sort": "^12.1.0", "eslint-plugin-typescript-sort-keys": "^3.2.0", "prettier": "^3.2.5", - "typescript": "^5.4.2" + "typescript": "^5.4.5" }, "engines": { "node": "18.* || >= 20"