Skip to content
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
31 changes: 14 additions & 17 deletions canary-publish/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53250,7 +53250,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
const core = __importStar(__nccwpck_require__(6108));
const exec_1 = __nccwpck_require__(9629);
const read_1 = __importDefault(__nccwpck_require__(1746));
const fs_extra_1 = __importDefault(__nccwpck_require__(77));
const fs = __importStar(__nccwpck_require__(77));
const resolve_from_1 = __importDefault(__nccwpck_require__(1345));
const apis_1 = __importDefault(__nccwpck_require__(6500));
const utils_1 = __nccwpck_require__(3927);
Expand Down Expand Up @@ -53301,7 +53301,7 @@ function main() {
// publish 스크립트에 태그를 붙여줍니다.
const npmTag = core.getInput('npm_tag');
const rootPackageJsonPath = `package.json`;
const rootPackageJson = JSON.parse(fs_extra_1.default.readFileSync(rootPackageJsonPath, 'utf8'));
const rootPackageJson = JSON.parse(fs.readFileSync(rootPackageJsonPath, 'utf8'));
for (const [key, script] of Object.entries(rootPackageJson.scripts)) {
if (script.includes('changeset publish')) {
// 카나리배포는 태그를 남기지 않습니다
Expand All @@ -53314,14 +53314,14 @@ function main() {
}
}
}
fs_extra_1.default.writeFileSync(rootPackageJsonPath, JSON.stringify(rootPackageJson, null, 2), 'utf8');
fs.writeFileSync(rootPackageJsonPath, JSON.stringify(rootPackageJson, null, 2), 'utf8');
// 변경된 패키지들의 버전을 강제로 치환합니다
changedPackageInfos.forEach((packageJsonPath) => {
const packageJson = JSON.parse(fs_extra_1.default.readFileSync(packageJsonPath, 'utf8'));
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
const newVersion = `${packageJson.version}-${npmTag}-${pullRequestInfo.head.sha.slice(0, 7)}`;
core.info(`✅ [${packageJson.name}] 이전 버전: ${packageJson.version} / 😘 새로운 버전: ${newVersion}`);
packageJson.version = newVersion;
fs_extra_1.default.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8');
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8');
});
// 변경된 버전으로 카나리 배포
const publishScript = core.getInput('publish_script');
Expand Down Expand Up @@ -53397,7 +53397,7 @@ exports.protectUnchangedPackages = protectUnchangedPackages;
exports.removeChangesetMdFiles = removeChangesetMdFiles;
const core = __importStar(__nccwpck_require__(6108));
const fast_glob_1 = __importDefault(__nccwpck_require__(6014));
const fs_extra_1 = __importDefault(__nccwpck_require__(77));
const fs = __importStar(__nccwpck_require__(77));
const utils_1 = __nccwpck_require__(3927);
function getChangedPackages(_a) {
return __awaiter(this, arguments, void 0, function* ({ changedFiles, packagesDir, excludes, }) {
Expand Down Expand Up @@ -53434,10 +53434,10 @@ function protectUnchangedPackages(changedPackages) {
const allPackageJSON = yield getAllPackageJSON();
for (const packageJsonPath of allPackageJSON) {
if (!changedPackages.includes(packageJsonPath)) {
const packageJson = JSON.parse(fs_extra_1.default.readFileSync(packageJsonPath, 'utf8'));
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
core.info(`🔨 [${packageJson.name}] private:true 를 추가합니다`);
packageJson.private = true;
fs_extra_1.default.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8');
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8');
}
}
});
Expand All @@ -53448,7 +53448,7 @@ function removeChangesetMdFiles(_a) {
return Promise.all(markdownPaths.map((markdownPath) => __awaiter(this, void 0, void 0, function* () {
if (changedFiles.find(({ filename }) => filename === markdownPath) == null) {
console.log(`PR과 관련없는 ${markdownPath} 제거`); // eslint-disable-line
yield fs_extra_1.default.remove(markdownPath);
yield fs.remove(markdownPath);
}
})));
});
Expand Down Expand Up @@ -53494,20 +53494,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.setNpmRc = setNpmRc;
const core = __importStar(__nccwpck_require__(6108));
const fs_extra_1 = __importDefault(__nccwpck_require__(77));
const fs = __importStar(__nccwpck_require__(77));
function setNpmRc() {
return __awaiter(this, void 0, void 0, function* () {
core.info('No changesets found, attempting to publish any unpublished packages to npm');
const userNpmrcPath = `${process.env.HOME}/.npmrc`;
if (fs_extra_1.default.existsSync(userNpmrcPath)) {
if (fs.existsSync(userNpmrcPath)) {
core.info('Found existing user .npmrc file');
const userNpmrcContent = yield fs_extra_1.default.readFile(userNpmrcPath, 'utf8');
const userNpmrcContent = yield fs.readFile(userNpmrcPath, 'utf8');
const authLine = userNpmrcContent.split('\n').find((line) => {
// check based on https://github.com/npm/cli/blob/8f8f71e4dd5ee66b3b17888faad5a7bf6c657eed/test/lib/adduser.js#L103-L105
return /^\s*\/\/registry\.npmjs\.org\/:[_-]authToken=/i.test(line);
Expand All @@ -53517,12 +53514,12 @@ function setNpmRc() {
}
else {
core.info("Didn't find existing auth token for the npm registry in the user .npmrc file, creating one");
fs_extra_1.default.appendFileSync(userNpmrcPath, `\n//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}\n`);
fs.appendFileSync(userNpmrcPath, `\n//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}\n`);
}
}
else {
core.info('No user .npmrc file found, creating one');
fs_extra_1.default.writeFileSync(userNpmrcPath, `//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}\n`);
fs.writeFileSync(userNpmrcPath, `//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}\n`);
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion canary-publish/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as core from '@actions/core'
import {exec, getExecOutput} from '@actions/exec'
import readChangesets from '@changesets/read'
import fs from 'fs-extra'
import * as fs from 'fs-extra'
import resolveFrom from 'resolve-from'

import createFetchers from '$actions/apis'
Expand Down
2 changes: 1 addition & 1 deletion canary-publish/src/utils/file.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as core from '@actions/core'
import fg from 'fast-glob'
import fs from 'fs-extra'
import * as fs from 'fs-extra'

import {findNearestPackageJson, getChangedAllFiles} from '$actions/utils'

Expand Down
2 changes: 1 addition & 1 deletion canary-publish/src/utils/npm.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as core from '@actions/core'
import fs from 'fs-extra'
import * as fs from 'fs-extra'

export async function setNpmRc() {
core.info('No changesets found, attempting to publish any unpublished packages to npm')
Expand Down
4 changes: 2 additions & 2 deletions detect-add/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34036,7 +34036,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getChangedPackages = getChangedPackages;
const fs_extra_1 = __nccwpck_require__(77);
const fs = __nccwpck_require__(77);
const utils_1 = __nccwpck_require__(3927);
function getChangedPackages(_a) {
return __awaiter(this, arguments, void 0, function* ({ packagesDir, changedFiles, excludes, }) {
Expand All @@ -34055,7 +34055,7 @@ function getChangedPackages(_a) {
if (패키지대상인가 && !마크다운파일인가 && !제외대상인가) {
const packageJsonPath = isIncludedRoot ? 'package.json' : (0, utils_1.findNearestPackageJson)(filename);
if (packageJsonPath != null) {
const packageJsonData = fs_extra_1.default.readFileSync(packageJsonPath, 'utf-8');
const packageJsonData = fs.readFileSync(packageJsonPath, 'utf-8');
const packageJson = JSON.parse(packageJsonData);
acc.add(packageJson.name);
}
Expand Down
2 changes: 1 addition & 1 deletion detect-add/src/utils/file.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import fs from 'fs-extra'
import * as fs from 'fs-extra'

import {findNearestPackageJson, getChangedAllFiles} from '$actions/utils'

Expand Down
Loading