@smarthr/create-lint-set
Advanced tools
Comparing version 1.1.4 to 1.1.5
@@ -97,14 +97,20 @@ "use strict"; | ||
// インストール | ||
var installPackages = function (targetDir, itemList, useYarn) { return __awaiter(void 0, void 0, void 0, function () { | ||
var installPackages = function (targetDir, itemList, pmName) { return __awaiter(void 0, void 0, void 0, function () { | ||
var targetPackages, command, args; | ||
return __generator(this, function (_a) { | ||
targetPackages = itemList.map(function (item) { return item.packages; }).flat(); | ||
if (useYarn) { | ||
command = 'yarn'; | ||
args = __spreadArray(['add', '--dev', '--exact', '--cwd', targetDir], targetPackages, true); | ||
switch (pmName) { | ||
case 'pnpm': | ||
command = 'pnpm'; | ||
args = __spreadArray(['add', '--save-dev', '--save-exact', '--dir', targetDir], targetPackages, true); | ||
break; | ||
case 'yarn': | ||
command = 'yarn'; | ||
args = __spreadArray(['add', '--dev', '--exact', '--cwd', targetDir], targetPackages, true); | ||
break; | ||
case 'npm': | ||
command = 'npm'; | ||
args = __spreadArray(['install', '--save-dev', '--save-exact', '--prefix', targetDir], targetPackages, true); | ||
break; | ||
} | ||
else { | ||
command = 'npm'; | ||
args = __spreadArray(['install', '--save-dev', '--save-exact', '--prefix', targetDir], targetPackages, true); | ||
} | ||
return [2 /*return*/, new Promise(function (resolve, reject) { | ||
@@ -163,3 +169,3 @@ var child = (0, cross_spawn_1.default)(command, args, { stdio: 'inherit' }); | ||
var init = function () { return __awaiter(void 0, void 0, void 0, function () { | ||
var projectPath, scriptDir, currentDir, targetDir, targetDirFiles, isUsingYarn, itemsWithFilteredPackages; | ||
var projectPath, scriptDir, currentDir, targetDir, targetDirFiles, pmName, itemsWithFilteredPackages; | ||
return __generator(this, function (_a) { | ||
@@ -177,5 +183,13 @@ switch (_a.label) { | ||
; | ||
isUsingYarn = targetDirFiles.includes('yarn.lock'); | ||
pmName = (function () { | ||
if (targetDirFiles.includes('pnpm-lock.yaml')) { | ||
return 'pnpm'; | ||
} | ||
if (targetDirFiles.includes('yarn.lock')) { | ||
return 'yarn'; | ||
} | ||
return 'npm'; | ||
})(); | ||
itemsWithFilteredPackages = filterInstallPackages(targetDir, items_1.items); | ||
return [4 /*yield*/, installPackages(targetDir, itemsWithFilteredPackages, isUsingYarn)]; | ||
return [4 /*yield*/, installPackages(targetDir, itemsWithFilteredPackages, pmName)]; | ||
case 1: | ||
@@ -182,0 +196,0 @@ _a.sent(); |
{ | ||
"name": "@smarthr/create-lint-set", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "Lint installer", | ||
@@ -25,3 +25,3 @@ "author": "SmartHR", | ||
"scripts": { | ||
"prebuild": "yarn copy-templates", | ||
"prebuild": "pnpm clean && pnpm copy-templates", | ||
"copy-templates": "mkdir lib && cp -r src/templates lib/templates", | ||
@@ -39,3 +39,3 @@ "clean": "rimraf lib" | ||
}, | ||
"gitHead": "4f3c5e5bb5058f40344a8945b42089dd201e9ead" | ||
"gitHead": "32268ddecb4340a1311b869f09888085e5c12502" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
21096
268
0