Skip to content

Commit

Permalink
remove automated 'npm install'
Browse files Browse the repository at this point in the history
  • Loading branch information
TimurRin committed Jan 18, 2025
1 parent d72aec0 commit 32f23dd
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 47 deletions.
14 changes: 2 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,7 @@ Visit the link above to see all unreleased changes.
- enhance utils file ([8ee803b])
- refactor actions to separate file ([3c1cd5e])
- remove unused npm packages ([8e91e03])
- update npm package '@cinnabar-forge/eslint-plugin' to 0.7.2 ([9ee6f16])
- update npm package '@types/chai' to 5.0.0 ([0b054ab])
- update npm package '@types/mocha' to 10.0.8 ([0b054ab])
- update npm package '@types/node' to 22.7.0 ([0b054ab])
- update npm package '@types/node' to 22.7.1 ([9ee6f16])
- update npm package 'clivo' to 0.5.2 ([0b054ab])
- update npm package 'diff' to 7.0.0 ([0b054ab])
- update npm package 'esbuild' to 0.24.0 ([0b054ab])
- update npm package 'simple-git' to 3.27.0 ([0b054ab])
- update npm package 'typescript' to 5.6.2 ([0b054ab])
- update npm packages ([0b054ab], [9ee6f16])

[9ee6f16]: https://github.com/cinnabar-forge/anca/commit/9ee6f16
[3c1cd5e]: https://github.com/cinnabar-forge/anca/commit/3c1cd5e
Expand Down Expand Up @@ -107,8 +98,7 @@ Visit the link above to see all unreleased changes.
- update nodejs action ([c622d86])
- update nodejs versions ([3ac4fd7], [f032267])
- update nodejs-prettier action ([c622d86])
- update npm package '@cinnabar-forge/eslint-plugin' to 0.7.1 ([07d084e])
- update npm packages ([0849688], [1ffa30d], [4f2dfba], [509943e], [71b77eb], [9ed6c0c])
- update npm packages ([0849688], [1ffa30d], [4f2dfba], [509943e], [71b77eb], [9ed6c0c], [07d084e])

[4d66224]: https://github.com/cinnabar-forge/anca/commit/4d66224
[7e10412]: https://github.com/cinnabar-forge/anca/commit/7e10412
Expand Down
6 changes: 0 additions & 6 deletions src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import {
type NodejsPackageJson,
type NpmUpdate,
fixNodejsPackageJson,
getUpdatedPackagesCommitMessage,
installNodejsDependencies,
updateNodejsPackageJsonDependencies,
updateNodejsPackageJsonDevDependencies,
Expand Down Expand Up @@ -157,11 +156,6 @@ const actionMappings: Record<
true,
)),
);
if (npmUpdate.length > 0) {
console.log("\nAdd to commit message: \n");
console.log(getUpdatedPackagesCommitMessage(npmUpdate));
console.log();
}
fileContents.dependencies = rebuildFile.dependencies;
fileContents.devDependencies = rebuildFile.devDependencies;
await writeNodejsPackageJson(development);
Expand Down
30 changes: 1 addition & 29 deletions src/actions/nodejs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -775,19 +775,7 @@ export async function fixNodejsPackageJson(
* @param development
*/
export async function installNodejsDependencies(development: AncaDevelopment) {
// eslint-disable-next-line security/detect-child-process
exec(`cd ${development.fullPath} && npm i`, (error, stdout, stderr) => {
if (error) {
console.log(
`package.json has been updated, but can't use 'npm i', please use it in ${development.fullPath} to install dependencies manually`,
);
return;
}
console.log(`npm install output: ${stdout}`);
if (stderr) {
console.error(`npm install errors: ${stderr}`);
}
});
console.log("Update your dependencies with 'npm i'");
}

/**
Expand Down Expand Up @@ -1296,22 +1284,6 @@ export async function updateNodejsPackageJsonDevDependencies(
return updatedPackages;
}

/**
* Get the commit message for the updated packages
* @param npmUpdate
*/
export function getUpdatedPackagesCommitMessage(npmUpdate: NpmUpdate) {
if (!npmUpdate) {
return null;
}
let text = "";
const sorted = npmUpdate.sort();
for (const pkg of sorted) {
text += `update npm package '${pkg.name}' to ${pkg.version}\n`;
}
return text;
}

/**
*
* @param rebuildFile
Expand Down
1 change: 1 addition & 0 deletions update.cinnabarmeta
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
prerelease-release

0 comments on commit 32f23dd

Please sign in to comment.