diff --git a/HISTORY.md b/HISTORY.md index e3d4919..8c6632b 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,9 @@ # History +## v1.79.0 2023 October 30 + +- Made the generated npm scripts compatible with Windows by use `printf` instead of `echo` + ## v1.78.0 2023 October 30 - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) diff --git a/package-lock.json b/package-lock.json index 77d65a9..435310e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "boundation", - "version": "1.78.0", + "version": "1.79.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "boundation", - "version": "1.78.0", + "version": "1.79.0", "license": "Artistic-2.0", "dependencies": { "@bevry/ansi": "^3.3.0", diff --git a/package.json b/package.json index d72e683..b8b6947 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "boundation", - "version": "1.78.0", + "version": "1.79.0", "description": "Automatic scaffolding and upgrading of your JavaScript ecosystem projects using Bevry's best practices", "homepage": "https://github.com/bevry/boundation", "license": "Artistic-2.0", @@ -132,17 +132,17 @@ "scripts": { "our:bin": "node ./bin.mjs", "our:clean": "rm -Rf ./docs ./edition* ./es2015 ./es5 ./out ./.next", - "our:compile": "echo no need for this project", - "our:deploy": "echo no need for this project", + "our:compile": "printf '%s\n' 'no need for this project'", + "our:deploy": "printf '%s\n' 'no need for this project'", "our:meta": "npm run our:meta:contributors && npm run our:meta:projectz", "our:meta:contributors": "update-contributors", "our:meta:projectz": "projectz compile", "our:release": "npm run our:release:prepare && npm run our:release:check-changelog && npm run our:release:check-dirty && npm run our:release:tag && npm run our:release:push", - "our:release:check-changelog": "cat ./HISTORY.md | grep v$npm_package_version || (echo add a changelog entry for v$npm_package_version && exit -1)", + "our:release:check-changelog": "cat ./HISTORY.md | grep \"v$npm_package_version\" || (printf '%s\n' \"add a changelog entry for v$npm_package_version\" && exit -1)", "our:release:check-dirty": "git diff --exit-code", "our:release:prepare": "npm run our:clean && npm run our:compile && npm run our:test && npm run our:meta", "our:release:push": "git push origin && git push origin --tags", - "our:release:tag": "export MESSAGE=$(cat ./HISTORY.md | sed -n \"/## v$npm_package_version/,/##/p\" | sed 's/## //' | awk 'NR>1{print buf}{buf = $0}') && test \"$MESSAGE\" || (echo 'proper changelog entry not found' && exit -1) && git tag v$npm_package_version -am \"$MESSAGE\"", + "our:release:tag": "export MESSAGE=$(cat ./HISTORY.md | sed -n \"/## v$npm_package_version/,/##/p\" | sed 's/## //' | awk 'NR>1{print buf}{buf = $0}') && test \"$MESSAGE\" || (printf '%s\n' 'proper changelog entry not found' && exit -1) && git tag \"v$npm_package_version\" -am \"$MESSAGE\"", "our:setup": "npm run our:setup:install", "our:setup:install": "npm install", "our:test": "npm run our:verify && npm test", diff --git a/source/editions.js b/source/editions.js index e11bab0..605c162 100644 --- a/source/editions.js +++ b/source/editions.js @@ -607,7 +607,7 @@ export function updateEditionFields(state) { const packageType = has(edition.tags, 'require') ? 'commonjs' : 'module' edition.scripts[ compileScriptName - ] += ` && echo '{"type": "${packageType}"}' > ${edition.directory}/package.json` + ] += ` && printf '%s' '{"type": "${packageType}"}' > ${edition.directory}/package.json` } // ensure description exists @@ -745,7 +745,7 @@ export async function scaffoldEditions(state) { answers.keywords.delete('export-default') if (answers.sourceModule) { try { - await exec(`cat ${sourceEdition.indexPath} | grep "export default"`) + await exec(`cat ${sourceEdition.indexPath} | grep 'export default'`) exportDefault = true answers.keywords.add('export-default') } catch (err) {} diff --git a/source/runtime.js b/source/runtime.js index ec76944..4581771 100644 --- a/source/runtime.js +++ b/source/runtime.js @@ -408,11 +408,9 @@ export async function updateRuntime(state) { // add our package scripts if (answers.npm) Object.assign(state.scripts, { - 'our:release:check-changelog': - 'cat ./HISTORY.md | grep v$npm_package_version || (echo add a changelog entry for v$npm_package_version && exit -1)', + 'our:release:check-changelog': `cat ./HISTORY.md | grep "v$npm_package_version" || (printf '%s\n' "add a changelog entry for v$npm_package_version" && exit -1)`, 'our:release:check-dirty': 'git diff --exit-code', - 'our:release:tag': - 'export MESSAGE=$(cat ./HISTORY.md | sed -n "/## v$npm_package_version/,/##/p" | sed \'s/## //\' | awk \'NR>1{print buf}{buf = $0}\') && test "$MESSAGE" || (echo \'proper changelog entry not found\' && exit -1) && git tag v$npm_package_version -am "$MESSAGE"', + 'our:release:tag': `export MESSAGE=$(cat ./HISTORY.md | sed -n "/## v$npm_package_version/,/##/p" | sed 's/## //' | awk 'NR>1{print buf}{buf = $0}') && test "$MESSAGE" || (printf '%s\n' 'proper changelog entry not found' && exit -1) && git tag "v$npm_package_version" -am "$MESSAGE"`, 'our:release:push': 'git push origin && git push origin --tags', 'our:release': [ [...run, 'our:release:prepare'], @@ -448,7 +446,7 @@ export async function updateRuntime(state) { if (answers.languages.includes('css')) { if (answers.vercelWebsite) { state.scripts['our:verify:stylelint'] = - "echo 'disabled due to https://spectrum.chat/zeit/general/resolved-deployments-fail-with-enospc-no-space-left-on-device-write~d1b9f61a-65e8-42a3-9042-f9c6a6fae6fd'" + "printf '%s\n' 'disabled due to https://spectrum.chat/zeit/general/resolved-deployments-fail-with-enospc-no-space-left-on-device-write~d1b9f61a-65e8-42a3-9042-f9c6a6fae6fd'" } else { packages.stylelint = 'dev' packages['stylelint-config-prettier'] = packages[ diff --git a/source/util.js b/source/util.js index fdde5f7..9fc5dea 100644 --- a/source/util.js +++ b/source/util.js @@ -242,7 +242,7 @@ export function repoToProject(input = '') { return (input && repoToSlug(input).split('/')[1]) || '' } -export const defaultScript = 'echo no need for this project' +export const defaultScript = "printf '%s\n' 'no need for this project'" export const defaultDeploy = 'npm run our:compile && npm run our:test && npm run our:deploy'