@ui5/create-webcomponents-package
Advanced tools
Comparing version 1.12.0-rc.2 to 1.12.0-rc.3
@@ -6,2 +6,10 @@ # Change Log | ||
# [1.12.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.2...v1.12.0-rc.3) (2023-03-30) | ||
**Note:** Version bump only for package @ui5/create-webcomponents-package | ||
# [1.12.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.1...v1.12.0-rc.2) (2023-03-23) | ||
@@ -8,0 +16,0 @@ |
@@ -26,5 +26,14 @@ #!/usr/bin/env node | ||
}; | ||
const isTypescriptRelatedFile = sourcePath => { | ||
const isTSRelatedFile = sourcePath => { | ||
return ["Assets.ts", "MyFirstComponent.ts", "tsconfig.json", "global.d.ts"].some(fileName => sourcePath.includes(fileName)); | ||
}; | ||
const isJSRelatedFile = sourcePath => { | ||
return ["Assets.js", "MyFirstComponent.js"].some(fileName => sourcePath.includes(fileName)); | ||
}; | ||
const isGitIgnore = sourcePath => { | ||
return sourcePath.includes("gitignore"); | ||
}; | ||
const isNPMRC = sourcePath => { | ||
return sourcePath.includes("npmrc"); | ||
}; | ||
@@ -49,4 +58,4 @@ // Validation of user input | ||
const copyFile = (vars, sourcePath, destPath) => { | ||
const ignoreJsRelated = vars.INIT_PACKAGE_VAR_TYPESCRIPT && sourcePath.includes("MyFirstComponent.js"); | ||
const ignoreTsRelated = !vars.INIT_PACKAGE_VAR_TYPESCRIPT && isTypescriptRelatedFile(sourcePath); | ||
const ignoreJsRelated = vars.INIT_PACKAGE_VAR_TYPESCRIPT && isJSRelatedFile(sourcePath); | ||
const ignoreTsRelated = !vars.INIT_PACKAGE_VAR_TYPESCRIPT && isTSRelatedFile(sourcePath); | ||
@@ -60,3 +69,14 @@ if (ignoreJsRelated || ignoreTsRelated) { | ||
destPath = replaceVarsInFileName(vars, destPath); | ||
fs.writeFileSync(destPath, content); | ||
// Rename "gitignore" to ".gitignore" (npm init won't include ".gitignore", so we add it as "gitignore" and rename it later) | ||
if (isGitIgnore(sourcePath)) { | ||
fs.renameSync(destPath, destPath.replace("gitignore", ".gitignore")) | ||
} | ||
// Rename "npmrc" to ".npmrc" (npm init won't include ".npmrc", so we add it as "npmrc" and rename it later) | ||
if (isNPMRC(sourcePath)) { | ||
fs.renameSync(destPath, destPath.replace("npmrc", ".npmrc")); | ||
} | ||
}; | ||
@@ -63,0 +83,0 @@ |
{ | ||
"name": "@ui5/create-webcomponents-package", | ||
"version": "1.12.0-rc.2", | ||
"version": "1.12.0-rc.3", | ||
"description": "UI5 Web Components: create package", | ||
@@ -27,3 +27,3 @@ "author": "SAP SE (https://www.sap.com)", | ||
}, | ||
"gitHead": "2af8e0fa36a3c85253cbc4f76f6b92b1c5a7a47f" | ||
"gitHead": "ae6ca4708b81a04de42ec2be50383fa80630e250" | ||
} |
36220
35
407