Skip to content

Commit f4ede09

Browse files
committed
import 방법을 변경합니다
1 parent a5d6cab commit f4ede09

File tree

6 files changed

+20
-23
lines changed

6 files changed

+20
-23
lines changed

canary-publish/dist/index.js

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -53250,7 +53250,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
5325053250
const core = __importStar(__nccwpck_require__(6108));
5325153251
const exec_1 = __nccwpck_require__(9629);
5325253252
const read_1 = __importDefault(__nccwpck_require__(1746));
53253-
const fs_extra_1 = __importDefault(__nccwpck_require__(77));
53253+
const fs = __importStar(__nccwpck_require__(77));
5325453254
const resolve_from_1 = __importDefault(__nccwpck_require__(1345));
5325553255
const apis_1 = __importDefault(__nccwpck_require__(6500));
5325653256
const utils_1 = __nccwpck_require__(3927);
@@ -53301,7 +53301,7 @@ function main() {
5330153301
// publish 스크립트에 태그를 붙여줍니다.
5330253302
const npmTag = core.getInput('npm_tag');
5330353303
const rootPackageJsonPath = `package.json`;
53304-
const rootPackageJson = JSON.parse(fs_extra_1.default.readFileSync(rootPackageJsonPath, 'utf8'));
53304+
const rootPackageJson = JSON.parse(fs.readFileSync(rootPackageJsonPath, 'utf8'));
5330553305
for (const [key, script] of Object.entries(rootPackageJson.scripts)) {
5330653306
if (script.includes('changeset publish')) {
5330753307
// 카나리배포는 태그를 남기지 않습니다
@@ -53314,14 +53314,14 @@ function main() {
5331453314
}
5331553315
}
5331653316
}
53317-
fs_extra_1.default.writeFileSync(rootPackageJsonPath, JSON.stringify(rootPackageJson, null, 2), 'utf8');
53317+
fs.writeFileSync(rootPackageJsonPath, JSON.stringify(rootPackageJson, null, 2), 'utf8');
5331853318
// 변경된 패키지들의 버전을 강제로 치환합니다
5331953319
changedPackageInfos.forEach((packageJsonPath) => {
53320-
const packageJson = JSON.parse(fs_extra_1.default.readFileSync(packageJsonPath, 'utf8'));
53320+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
5332153321
const newVersion = `${packageJson.version}-${npmTag}-${pullRequestInfo.head.sha.slice(0, 7)}`;
5332253322
core.info(`✅ [${packageJson.name}] 이전 버전: ${packageJson.version} / 😘 새로운 버전: ${newVersion}`);
5332353323
packageJson.version = newVersion;
53324-
fs_extra_1.default.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8');
53324+
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8');
5332553325
});
5332653326
// 변경된 버전으로 카나리 배포
5332753327
const publishScript = core.getInput('publish_script');
@@ -53397,7 +53397,7 @@ exports.protectUnchangedPackages = protectUnchangedPackages;
5339753397
exports.removeChangesetMdFiles = removeChangesetMdFiles;
5339853398
const core = __importStar(__nccwpck_require__(6108));
5339953399
const fast_glob_1 = __importDefault(__nccwpck_require__(6014));
53400-
const fs_extra_1 = __importDefault(__nccwpck_require__(77));
53400+
const fs = __importStar(__nccwpck_require__(77));
5340153401
const utils_1 = __nccwpck_require__(3927);
5340253402
function getChangedPackages(_a) {
5340353403
return __awaiter(this, arguments, void 0, function* ({ changedFiles, packagesDir, excludes, }) {
@@ -53434,10 +53434,10 @@ function protectUnchangedPackages(changedPackages) {
5343453434
const allPackageJSON = yield getAllPackageJSON();
5343553435
for (const packageJsonPath of allPackageJSON) {
5343653436
if (!changedPackages.includes(packageJsonPath)) {
53437-
const packageJson = JSON.parse(fs_extra_1.default.readFileSync(packageJsonPath, 'utf8'));
53437+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
5343853438
core.info(`🔨 [${packageJson.name}] private:true 를 추가합니다`);
5343953439
packageJson.private = true;
53440-
fs_extra_1.default.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8');
53440+
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8');
5344153441
}
5344253442
}
5344353443
});
@@ -53448,7 +53448,7 @@ function removeChangesetMdFiles(_a) {
5344853448
return Promise.all(markdownPaths.map((markdownPath) => __awaiter(this, void 0, void 0, function* () {
5344953449
if (changedFiles.find(({ filename }) => filename === markdownPath) == null) {
5345053450
console.log(`PR과 관련없는 ${markdownPath} 제거`); // eslint-disable-line
53451-
yield fs_extra_1.default.remove(markdownPath);
53451+
yield fs.remove(markdownPath);
5345253452
}
5345353453
})));
5345453454
});
@@ -53494,20 +53494,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
5349453494
step((generator = generator.apply(thisArg, _arguments || [])).next());
5349553495
});
5349653496
};
53497-
var __importDefault = (this && this.__importDefault) || function (mod) {
53498-
return (mod && mod.__esModule) ? mod : { "default": mod };
53499-
};
5350053497
Object.defineProperty(exports, "__esModule", ({ value: true }));
5350153498
exports.setNpmRc = setNpmRc;
5350253499
const core = __importStar(__nccwpck_require__(6108));
53503-
const fs_extra_1 = __importDefault(__nccwpck_require__(77));
53500+
const fs = __importStar(__nccwpck_require__(77));
5350453501
function setNpmRc() {
5350553502
return __awaiter(this, void 0, void 0, function* () {
5350653503
core.info('No changesets found, attempting to publish any unpublished packages to npm');
5350753504
const userNpmrcPath = `${process.env.HOME}/.npmrc`;
53508-
if (fs_extra_1.default.existsSync(userNpmrcPath)) {
53505+
if (fs.existsSync(userNpmrcPath)) {
5350953506
core.info('Found existing user .npmrc file');
53510-
const userNpmrcContent = yield fs_extra_1.default.readFile(userNpmrcPath, 'utf8');
53507+
const userNpmrcContent = yield fs.readFile(userNpmrcPath, 'utf8');
5351153508
const authLine = userNpmrcContent.split('\n').find((line) => {
5351253509
// check based on https://github.com/npm/cli/blob/8f8f71e4dd5ee66b3b17888faad5a7bf6c657eed/test/lib/adduser.js#L103-L105
5351353510
return /^\s*\/\/registry\.npmjs\.org\/:[_-]authToken=/i.test(line);
@@ -53517,12 +53514,12 @@ function setNpmRc() {
5351753514
}
5351853515
else {
5351953516
core.info("Didn't find existing auth token for the npm registry in the user .npmrc file, creating one");
53520-
fs_extra_1.default.appendFileSync(userNpmrcPath, `\n//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}\n`);
53517+
fs.appendFileSync(userNpmrcPath, `\n//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}\n`);
5352153518
}
5352253519
}
5352353520
else {
5352453521
core.info('No user .npmrc file found, creating one');
53525-
fs_extra_1.default.writeFileSync(userNpmrcPath, `//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}\n`);
53522+
fs.writeFileSync(userNpmrcPath, `//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}\n`);
5352653523
}
5352753524
});
5352853525
}

canary-publish/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as core from '@actions/core'
22
import {exec, getExecOutput} from '@actions/exec'
33
import readChangesets from '@changesets/read'
4-
import fs from 'fs-extra'
4+
import * as fs from 'fs-extra'
55
import resolveFrom from 'resolve-from'
66

77
import createFetchers from '$actions/apis'

canary-publish/src/utils/file.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as core from '@actions/core'
22
import fg from 'fast-glob'
3-
import fs from 'fs-extra'
3+
import * as fs from 'fs-extra'
44

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

canary-publish/src/utils/npm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as core from '@actions/core'
2-
import fs from 'fs-extra'
2+
import * as fs from 'fs-extra'
33

44
export async function setNpmRc() {
55
core.info('No changesets found, attempting to publish any unpublished packages to npm')

detect-add/dist/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34036,7 +34036,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
3403634036
};
3403734037
Object.defineProperty(exports, "__esModule", ({ value: true }));
3403834038
exports.getChangedPackages = getChangedPackages;
34039-
const fs_extra_1 = __nccwpck_require__(77);
34039+
const fs = __nccwpck_require__(77);
3404034040
const utils_1 = __nccwpck_require__(3927);
3404134041
function getChangedPackages(_a) {
3404234042
return __awaiter(this, arguments, void 0, function* ({ packagesDir, changedFiles, excludes, }) {
@@ -34055,7 +34055,7 @@ function getChangedPackages(_a) {
3405534055
if (패키지대상인가 && !마크다운파일인가 && !제외대상인가) {
3405634056
const packageJsonPath = isIncludedRoot ? 'package.json' : (0, utils_1.findNearestPackageJson)(filename);
3405734057
if (packageJsonPath != null) {
34058-
const packageJsonData = fs_extra_1.default.readFileSync(packageJsonPath, 'utf-8');
34058+
const packageJsonData = fs.readFileSync(packageJsonPath, 'utf-8');
3405934059
const packageJson = JSON.parse(packageJsonData);
3406034060
acc.add(packageJson.name);
3406134061
}

detect-add/src/utils/file.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import fs from 'fs-extra'
1+
import * as fs from 'fs-extra'
22

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

0 commit comments

Comments
 (0)