Skip to content

Commit

Permalink
feat(node version): automate management of node version #262
Browse files Browse the repository at this point in the history
This commit is an extension #262 where all resource files are
not tempalted off of the init of a repo.
  • Loading branch information
blackfalcon committed Nov 15, 2021
1 parent bf240c5 commit e3c1522
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion bin/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ const getReplacements = async ({ name, namespace, npm }) => {
const newYear = new Date().getFullYear();
// Retrieve Node version defined in package.json
const minNodeVersion = pjson.engines.node.replace(/[^0-9,.]+/g,'');
const abstractNodeVersion = minNodeVersion.split('.')[0] + '.x';

if (labs) {
npm = `@aurolabs`
Expand All @@ -325,7 +326,8 @@ const getReplacements = async ({ name, namespace, npm }) => {
{ regex: /\[year\]/g, value: newYear },
{ regex: /\[designTokens\]/g, value: versionData['@aurodesignsystem/design-tokens'] },
{ regex: /\[wcss\]/g, value: versionData['@aurodesignsystem/webcorestylesheets'] },
{ regex: /\[nodeVersion\]/g, value: minNodeVersion }
{ regex: /\[nodeVersion\]/g, value: minNodeVersion },
{ regex: /\[abstractNodeVersion\]/g, value: abstractNodeVersion }
];

return nameReplacements.concat(pkgReplacements);
Expand Down
2 changes: 1 addition & 1 deletion template/.github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ branches:
# Required. Require branches to be up to date before merging.
strict: true
# Required. The list of status checks to require in order to merge into this branch
contexts: ["test (16.x)", "license/cla"]
contexts: ["test ([abstractNodeVersion])", "license/cla"]
# Required. Enforce all configured restrictions for administrators. Set to true to enforce required status checks for repository administrators. Set to null to disable.
enforce_admins: false
# Required. Restrict who can push to this branch. Team and user restrictions are only available for organization-owned repositories. Set to null to disable.
Expand Down
2 changes: 1 addition & 1 deletion template/.github/settings__labs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ branches:
# Required. Require branches to be up to date before merging.
strict: true
# Required. The list of status checks to require in order to merge into this branch
contexts: ["test (16.x)"]
contexts: ["test ([abstractNodeVersion])"]
# Required. Enforce all configured restrictions for administrators. Set to true to enforce required status checks for repository administrators. Set to null to disable.
enforce_admins: false
# Required. Restrict who can push to this branch. Team and user restrictions are only available for organization-owned repositories. Set to null to disable.
Expand Down
2 changes: 1 addition & 1 deletion template/.github/workflows/testPublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

strategy:
matrix:
node-version: [16.x]
node-version: [ [abstractNodeVersion] ]

steps:
- uses: actions/checkout@v2
Expand Down

0 comments on commit e3c1522

Please sign in to comment.