mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
Add prettier
This commit is contained in:
@@ -62,10 +62,10 @@ import readChangesets from "@changesets/read";
|
||||
publishScript: core.getInput("publish"),
|
||||
versionScript: core.getInput("version"),
|
||||
commit: core.getInput("commit") || "Version Packages",
|
||||
prTitle: core.getInput("title") || "Version Packages",
|
||||
}
|
||||
core.setOutput('published', 'false');
|
||||
core.setOutput('publishedPackages', '[]');
|
||||
prTitle: core.getInput("title") || "Version Packages"
|
||||
};
|
||||
core.setOutput("published", "false");
|
||||
core.setOutput("publishedPackages", "[]");
|
||||
|
||||
if (!hasChangesets && !inputs.publishScript) {
|
||||
console.log("No changesets found");
|
||||
@@ -78,7 +78,7 @@ import readChangesets from "@changesets/read";
|
||||
let { packages } = await getPackages(process.cwd());
|
||||
let packagesByName = new Map(packages.map(x => [x.packageJson.name, x]));
|
||||
|
||||
let npmrcPath = `${process.env.HOME}/.npmrc`
|
||||
let npmrcPath = `${process.env.HOME}/.npmrc`;
|
||||
if (fs.existsSync(npmrcPath)) {
|
||||
console.log("Found existing .npmrc file");
|
||||
} else {
|
||||
@@ -155,10 +155,16 @@ import readChangesets from "@changesets/read";
|
||||
);
|
||||
|
||||
if (releasedPackages.length) {
|
||||
core.setOutput('published', 'true');
|
||||
core.setOutput('publishedPackages', JSON.stringify(releasedPackages.map(
|
||||
pkg => ({name: pkg.packageJson.name, version: pkg.packageJson.version})
|
||||
)));
|
||||
core.setOutput("published", "true");
|
||||
core.setOutput(
|
||||
"publishedPackages",
|
||||
JSON.stringify(
|
||||
releasedPackages.map(pkg => ({
|
||||
name: pkg.packageJson.name,
|
||||
version: pkg.packageJson.version
|
||||
}))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -246,8 +252,12 @@ ${
|
||||
);
|
||||
})();
|
||||
|
||||
const prTitle = `${inputs.prTitle}${isInPreMode ? ` (${preState.tag})` : ""}`;
|
||||
const commitMsg = `${inputs.commit}${isInPreMode ? ` (${preState.tag})` : ""}`;
|
||||
const prTitle = `${inputs.prTitle}${
|
||||
isInPreMode ? ` (${preState.tag})` : ""
|
||||
}`;
|
||||
const commitMsg = `${inputs.commit}${
|
||||
isInPreMode ? ` (${preState.tag})` : ""
|
||||
}`;
|
||||
|
||||
await exec("git", ["add", "."]);
|
||||
await exec("git", ["commit", "-m", commitMsg]);
|
||||
|
||||
+3
-1
@@ -5,6 +5,7 @@
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"parcel": "^1.12.3",
|
||||
"prettier": "^2.0.5",
|
||||
"typescript": "^3.5.3"
|
||||
},
|
||||
"scripts": {
|
||||
@@ -39,5 +40,6 @@
|
||||
"hooks": {
|
||||
"pre-commit": "yarn build && git add dist/index.js"
|
||||
}
|
||||
}
|
||||
},
|
||||
"prettier": {}
|
||||
}
|
||||
|
||||
@@ -6177,6 +6177,11 @@ prelude-ls@~1.1.2:
|
||||
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
|
||||
integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=
|
||||
|
||||
prettier@^2.0.5:
|
||||
version "2.0.5"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.5.tgz#d6d56282455243f2f92cc1716692c08aa31522d4"
|
||||
integrity sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==
|
||||
|
||||
pretty-format@^24.9.0:
|
||||
version "24.9.0"
|
||||
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.9.0.tgz#12fac31b37019a4eea3c11aa9a959eb7628aa7c9"
|
||||
|
||||
Reference in New Issue
Block a user