@form8ion/github-workflows-core 4.1.0 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,6 +6,7 @@ core functionality for form8ion plugins that manage github workflows
6
6
 
7
7
  [![Node CI Workflow Status][github-actions-ci-badge]][github-actions-ci-link]
8
8
  [![Codecov][coverage-badge]][coverage-link]
9
+ ![SLSA Level 2][slsa-badge]
9
10
 
10
11
  <!--status-badges end -->
11
12
 
@@ -16,6 +17,12 @@ core functionality for form8ion plugins that manage github workflows
16
17
  * [Example](#example)
17
18
  * [Import](#import)
18
19
  * [Execute](#execute)
20
+ * [API](#api)
21
+ * [`scaffoldCheckoutStep`](#scaffoldcheckoutstep)
22
+ * [`scaffoldNodeSetupStep`](#scaffoldnodesetupstep)
23
+ * [`versionDeterminedBy` __string__ (_required_)](#versiondeterminedby-string-required)
24
+ * [`scaffoldDependencyInstallationStep`](#scaffolddependencyinstallationstep)
25
+ * [`scaffoldVerificationStep`](#scaffoldverificationstep)
19
26
  * [Contributing](#contributing)
20
27
  * [Dependencies](#dependencies)
21
28
  * [Verification](#verification)
@@ -46,7 +53,8 @@ import {
46
53
  scaffoldCheckoutStep,
47
54
  scaffoldNodeSetupStep,
48
55
  scaffoldDependencyInstallationStep,
49
- scaffoldVerificationStep
56
+ scaffoldVerificationStep,
57
+ writeWorkflowFile
50
58
  } from '@form8ion/github-workflows-core';
51
59
  ```
52
60
 
@@ -61,6 +69,8 @@ import {
61
69
  scaffoldDependencyInstallationStep();
62
70
 
63
71
  scaffoldVerificationStep();
72
+
73
+ await writeWorkflowFile({projectRoot: process.cwd(), name: 'workflow-name', config: {}});
64
74
  })();
65
75
  ```
66
76
 
@@ -139,7 +149,7 @@ $ npm test
139
149
 
140
150
  [github-actions-ci-link]: https://github.com/form8ion/github-workflows-core/actions?query=workflow%3A%22Node.js+CI%22+branch%3Amaster
141
151
 
142
- [github-actions-ci-badge]: https://github.com/form8ion/github-workflows-core/workflows/Node.js%20CI/badge.svg
152
+ [github-actions-ci-badge]: https://img.shields.io/github/actions/workflow/status/form8ion/github-workflows-core/node-ci.yml.svg?branch=master&logo=github
143
153
 
144
154
  [coverage-link]: https://codecov.io/github/form8ion/github-workflows-core
145
155
 
@@ -147,7 +157,7 @@ $ npm test
147
157
 
148
158
  [license-link]: LICENSE
149
159
 
150
- [license-badge]: https://img.shields.io/github/license/form8ion/github-workflows-core.svg
160
+ [license-badge]: https://img.shields.io/github/license/form8ion/github-workflows-core.svg?logo=opensourceinitiative
151
161
 
152
162
  [npm-link]: https://www.npmjs.com/package/@form8ion/github-workflows-core
153
163
 
@@ -158,3 +168,5 @@ $ npm test
158
168
  [runkit-badge]: https://badge.runkitcdn.com/@form8ion/github-workflows-core.svg
159
169
 
160
170
  [node-badge]: https://img.shields.io/node/v/@form8ion/github-workflows-core?logo=node.js
171
+
172
+ [slsa-badge]: https://slsa.dev/images/gh-badge-level2.svg
package/example.js CHANGED
@@ -5,11 +5,12 @@ import {
5
5
  scaffoldCheckoutStep,
6
6
  scaffoldNodeSetupStep,
7
7
  scaffoldDependencyInstallationStep,
8
- scaffoldVerificationStep
8
+ scaffoldVerificationStep,
9
+ writeWorkflowFile
9
10
  } from './lib/index.js';
10
11
 
11
12
  // remark-usage-ignore-next
12
- stubbedFs();
13
+ stubbedFs({node_modules: stubbedFs.load('node_modules'), '.github': {workflows: {}}});
13
14
 
14
15
  // #### Execute
15
16
 
@@ -21,4 +22,6 @@ stubbedFs();
21
22
  scaffoldDependencyInstallationStep();
22
23
 
23
24
  scaffoldVerificationStep();
25
+
26
+ await writeWorkflowFile({projectRoot: process.cwd(), name: 'workflow-name', config: {}});
24
27
  })();
package/lib/index.js CHANGED
@@ -1,9 +1,11 @@
1
1
  'use strict';
2
2
 
3
+ var core = require('@form8ion/core');
4
+
3
5
  function setupNode({versionDeterminedBy}) {
4
6
  return {
5
7
  name: 'Setup node',
6
- uses: 'actions/setup-node@v3',
8
+ uses: 'actions/setup-node@v4.0.3',
7
9
  with: {
8
10
  ...'nvmrc' === versionDeterminedBy && {'node-version-file': '.nvmrc'},
9
11
  // eslint-disable-next-line no-template-curly-in-string
@@ -25,11 +27,16 @@ function installDependencies() {
25
27
  }
26
28
 
27
29
  function checkout() {
28
- return {uses: 'actions/checkout@v3'};
30
+ return {uses: 'actions/checkout@v4.1.7'};
31
+ }
32
+
33
+ function write ({projectRoot, name, config}) {
34
+ return core.writeConfigFile({path: `${projectRoot}/.github/workflows`, name, config, format: core.fileTypes.YAML});
29
35
  }
30
36
 
31
37
  exports.scaffoldCheckoutStep = checkout;
32
38
  exports.scaffoldDependencyInstallationStep = installDependencies;
33
39
  exports.scaffoldNodeSetupStep = setupNode;
34
40
  exports.scaffoldVerificationStep = executeVerification;
41
+ exports.writeWorkflowFile = write;
35
42
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/steps/scaffolders.js"],"sourcesContent":["export function setupNode({versionDeterminedBy}) {\n return {\n name: 'Setup node',\n uses: 'actions/setup-node@v3',\n with: {\n ...'nvmrc' === versionDeterminedBy && {'node-version-file': '.nvmrc'},\n // eslint-disable-next-line no-template-curly-in-string\n ...'matrix' === versionDeterminedBy && {'node-version': '${{ matrix.node }}'},\n cache: 'npm'\n }\n };\n}\n\nexport function executeVerification() {\n return {run: 'npm test'};\n}\n\nexport function installDependencies() {\n return [\n {run: 'npm clean-install'},\n {run: 'corepack npm audit signatures'}\n ];\n}\n\nexport function checkout() {\n return {uses: 'actions/checkout@v3'};\n}\n"],"names":[],"mappings":";;AAAO,SAAS,SAAS,CAAC,CAAC,mBAAmB,CAAC,EAAE;AACjD,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,YAAY;AACtB,IAAI,IAAI,EAAE,uBAAuB;AACjC,IAAI,IAAI,EAAE;AACV,MAAM,GAAG,OAAO,KAAK,mBAAmB,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC;AAC3E;AACA,MAAM,GAAG,QAAQ,KAAK,mBAAmB,IAAI,CAAC,cAAc,EAAE,oBAAoB,CAAC;AACnF,MAAM,KAAK,EAAE,KAAK;AAClB,KAAK;AACL,GAAG,CAAC;AACJ,CAAC;AACD;AACO,SAAS,mBAAmB,GAAG;AACtC,EAAE,OAAO,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;AAC3B,CAAC;AACD;AACO,SAAS,mBAAmB,GAAG;AACtC,EAAE,OAAO;AACT,IAAI,CAAC,GAAG,EAAE,mBAAmB,CAAC;AAC9B,IAAI,CAAC,GAAG,EAAE,+BAA+B,CAAC;AAC1C,GAAG,CAAC;AACJ,CAAC;AACD;AACO,SAAS,QAAQ,GAAG;AAC3B,EAAE,OAAO,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;AACvC;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/steps/scaffolders.js","../src/workflow-file/write.js"],"sourcesContent":["export function setupNode({versionDeterminedBy}) {\n return {\n name: 'Setup node',\n uses: 'actions/setup-node@v4.0.3',\n with: {\n ...'nvmrc' === versionDeterminedBy && {'node-version-file': '.nvmrc'},\n // eslint-disable-next-line no-template-curly-in-string\n ...'matrix' === versionDeterminedBy && {'node-version': '${{ matrix.node }}'},\n cache: 'npm'\n }\n };\n}\n\nexport function executeVerification() {\n return {run: 'npm test'};\n}\n\nexport function installDependencies() {\n return [\n {run: 'npm clean-install'},\n {run: 'corepack npm audit signatures'}\n ];\n}\n\nexport function checkout() {\n return {uses: 'actions/checkout@v4.1.7'};\n}\n","import {fileTypes, writeConfigFile} from '@form8ion/core';\n\nexport default function ({projectRoot, name, config}) {\n return writeConfigFile({path: `${projectRoot}/.github/workflows`, name, config, format: fileTypes.YAML});\n}\n"],"names":["writeConfigFile","fileTypes"],"mappings":";;;;AAAO,SAAS,SAAS,CAAC,CAAC,mBAAmB,CAAC,EAAE;AACjD,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,YAAY;AACtB,IAAI,IAAI,EAAE,2BAA2B;AACrC,IAAI,IAAI,EAAE;AACV,MAAM,GAAG,OAAO,KAAK,mBAAmB,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC;AAC3E;AACA,MAAM,GAAG,QAAQ,KAAK,mBAAmB,IAAI,CAAC,cAAc,EAAE,oBAAoB,CAAC;AACnF,MAAM,KAAK,EAAE,KAAK;AAClB,KAAK;AACL,GAAG,CAAC;AACJ,CAAC;AACD;AACO,SAAS,mBAAmB,GAAG;AACtC,EAAE,OAAO,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;AAC3B,CAAC;AACD;AACO,SAAS,mBAAmB,GAAG;AACtC,EAAE,OAAO;AACT,IAAI,CAAC,GAAG,EAAE,mBAAmB,CAAC;AAC9B,IAAI,CAAC,GAAG,EAAE,+BAA+B,CAAC;AAC1C,GAAG,CAAC;AACJ,CAAC;AACD;AACO,SAAS,QAAQ,GAAG;AAC3B,EAAE,OAAO,CAAC,IAAI,EAAE,yBAAyB,CAAC,CAAC;AAC3C;;ACxBe,cAAQ,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE;AACtD,EAAE,OAAOA,oBAAe,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,WAAW,CAAC,kBAAkB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAEC,cAAS,CAAC,IAAI,CAAC,CAAC,CAAC;AAC3G;;;;;;;;"}
package/lib/index.mjs CHANGED
@@ -1,7 +1,9 @@
1
+ import { writeConfigFile, fileTypes } from '@form8ion/core';
2
+
1
3
  function setupNode({versionDeterminedBy}) {
2
4
  return {
3
5
  name: 'Setup node',
4
- uses: 'actions/setup-node@v3',
6
+ uses: 'actions/setup-node@v4.0.3',
5
7
  with: {
6
8
  ...'nvmrc' === versionDeterminedBy && {'node-version-file': '.nvmrc'},
7
9
  // eslint-disable-next-line no-template-curly-in-string
@@ -23,8 +25,12 @@ function installDependencies() {
23
25
  }
24
26
 
25
27
  function checkout() {
26
- return {uses: 'actions/checkout@v3'};
28
+ return {uses: 'actions/checkout@v4.1.7'};
29
+ }
30
+
31
+ function write ({projectRoot, name, config}) {
32
+ return writeConfigFile({path: `${projectRoot}/.github/workflows`, name, config, format: fileTypes.YAML});
27
33
  }
28
34
 
29
- export { checkout as scaffoldCheckoutStep, installDependencies as scaffoldDependencyInstallationStep, setupNode as scaffoldNodeSetupStep, executeVerification as scaffoldVerificationStep };
35
+ export { checkout as scaffoldCheckoutStep, installDependencies as scaffoldDependencyInstallationStep, setupNode as scaffoldNodeSetupStep, executeVerification as scaffoldVerificationStep, write as writeWorkflowFile };
30
36
  //# sourceMappingURL=index.mjs.map
package/lib/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../src/steps/scaffolders.js"],"sourcesContent":["export function setupNode({versionDeterminedBy}) {\n return {\n name: 'Setup node',\n uses: 'actions/setup-node@v3',\n with: {\n ...'nvmrc' === versionDeterminedBy && {'node-version-file': '.nvmrc'},\n // eslint-disable-next-line no-template-curly-in-string\n ...'matrix' === versionDeterminedBy && {'node-version': '${{ matrix.node }}'},\n cache: 'npm'\n }\n };\n}\n\nexport function executeVerification() {\n return {run: 'npm test'};\n}\n\nexport function installDependencies() {\n return [\n {run: 'npm clean-install'},\n {run: 'corepack npm audit signatures'}\n ];\n}\n\nexport function checkout() {\n return {uses: 'actions/checkout@v3'};\n}\n"],"names":[],"mappings":"AAAO,SAAS,SAAS,CAAC,CAAC,mBAAmB,CAAC,EAAE;AACjD,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,YAAY;AACtB,IAAI,IAAI,EAAE,uBAAuB;AACjC,IAAI,IAAI,EAAE;AACV,MAAM,GAAG,OAAO,KAAK,mBAAmB,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC;AAC3E;AACA,MAAM,GAAG,QAAQ,KAAK,mBAAmB,IAAI,CAAC,cAAc,EAAE,oBAAoB,CAAC;AACnF,MAAM,KAAK,EAAE,KAAK;AAClB,KAAK;AACL,GAAG,CAAC;AACJ,CAAC;AACD;AACO,SAAS,mBAAmB,GAAG;AACtC,EAAE,OAAO,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;AAC3B,CAAC;AACD;AACO,SAAS,mBAAmB,GAAG;AACtC,EAAE,OAAO;AACT,IAAI,CAAC,GAAG,EAAE,mBAAmB,CAAC;AAC9B,IAAI,CAAC,GAAG,EAAE,+BAA+B,CAAC;AAC1C,GAAG,CAAC;AACJ,CAAC;AACD;AACO,SAAS,QAAQ,GAAG;AAC3B,EAAE,OAAO,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;AACvC;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../src/steps/scaffolders.js","../src/workflow-file/write.js"],"sourcesContent":["export function setupNode({versionDeterminedBy}) {\n return {\n name: 'Setup node',\n uses: 'actions/setup-node@v4.0.3',\n with: {\n ...'nvmrc' === versionDeterminedBy && {'node-version-file': '.nvmrc'},\n // eslint-disable-next-line no-template-curly-in-string\n ...'matrix' === versionDeterminedBy && {'node-version': '${{ matrix.node }}'},\n cache: 'npm'\n }\n };\n}\n\nexport function executeVerification() {\n return {run: 'npm test'};\n}\n\nexport function installDependencies() {\n return [\n {run: 'npm clean-install'},\n {run: 'corepack npm audit signatures'}\n ];\n}\n\nexport function checkout() {\n return {uses: 'actions/checkout@v4.1.7'};\n}\n","import {fileTypes, writeConfigFile} from '@form8ion/core';\n\nexport default function ({projectRoot, name, config}) {\n return writeConfigFile({path: `${projectRoot}/.github/workflows`, name, config, format: fileTypes.YAML});\n}\n"],"names":[],"mappings":";;AAAO,SAAS,SAAS,CAAC,CAAC,mBAAmB,CAAC,EAAE;AACjD,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,YAAY;AACtB,IAAI,IAAI,EAAE,2BAA2B;AACrC,IAAI,IAAI,EAAE;AACV,MAAM,GAAG,OAAO,KAAK,mBAAmB,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC;AAC3E;AACA,MAAM,GAAG,QAAQ,KAAK,mBAAmB,IAAI,CAAC,cAAc,EAAE,oBAAoB,CAAC;AACnF,MAAM,KAAK,EAAE,KAAK;AAClB,KAAK;AACL,GAAG,CAAC;AACJ,CAAC;AACD;AACO,SAAS,mBAAmB,GAAG;AACtC,EAAE,OAAO,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;AAC3B,CAAC;AACD;AACO,SAAS,mBAAmB,GAAG;AACtC,EAAE,OAAO;AACT,IAAI,CAAC,GAAG,EAAE,mBAAmB,CAAC;AAC9B,IAAI,CAAC,GAAG,EAAE,+BAA+B,CAAC;AAC1C,GAAG,CAAC;AACJ,CAAC;AACD;AACO,SAAS,QAAQ,GAAG;AAC3B,EAAE,OAAO,CAAC,IAAI,EAAE,yBAAyB,CAAC,CAAC;AAC3C;;ACxBe,cAAQ,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE;AACtD,EAAE,OAAO,eAAe,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,WAAW,CAAC,kBAAkB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;AAC3G;;;;"}
package/package.json CHANGED
@@ -2,10 +2,10 @@
2
2
  "name": "@form8ion/github-workflows-core",
3
3
  "description": "core functionality for form8ion plugins that manage github workflows",
4
4
  "license": "MIT",
5
- "version": "4.1.0",
5
+ "version": "5.1.0",
6
6
  "type": "commonjs",
7
7
  "engines": {
8
- "node": "^16.14.0 || >=18"
8
+ "node": "^18.17 || >=20.6.1"
9
9
  },
10
10
  "author": "Matt Travi <npm@travi.org> (https://matt.travi.org)",
11
11
  "repository": "form8ion/github-workflows-core",
@@ -36,10 +36,10 @@
36
36
  "build": "npm-run-all --print-label --parallel build:*",
37
37
  "prepack": "run-s build",
38
38
  "test:unit": "cross-env NODE_ENV=test c8 run-s test:unit:base",
39
- "test:unit:base": "DEBUG=any mocha 'src/**/*-test.js'",
39
+ "test:unit:base": "DEBUG=any vitest run",
40
40
  "lint:lockfile": "lockfile-lint",
41
41
  "lint:js": "eslint . --cache",
42
- "lint:js:fix": "run-s lint:js -- --fix",
42
+ "lint:js:fix": "run-s 'lint:js -- --fix'",
43
43
  "lint:md": "remark . --frail",
44
44
  "generate:md": "remark . --output",
45
45
  "pregenerate:md": "run-s build",
@@ -57,37 +57,39 @@
57
57
  "access": "public",
58
58
  "provenance": true
59
59
  },
60
+ "packageManager": "npm@10.8.2+sha512.c7f0088c520a46596b85c6f8f1da943400199748a0f7ea8cb8df75469668dc26f6fb3ba26df87e2884a5ebe91557292d0f3db7d0929cdb4f14910c3032ac81fb",
60
61
  "devDependencies": {
61
- "@babel/register": "7.23.7",
62
- "@cucumber/cucumber": "9.6.0",
63
- "@form8ion/babel-preset": "1.6.123",
62
+ "@babel/register": "7.24.6",
63
+ "@cucumber/cucumber": "10.9.0",
64
+ "@form8ion/babel-preset": "1.6.135",
64
65
  "@form8ion/commitlint-config": "1.0.76",
65
66
  "@form8ion/eslint-config": "7.0.9",
66
67
  "@form8ion/eslint-config-cucumber": "1.4.1",
67
- "@form8ion/eslint-config-mocha": "3.0.3",
68
- "@form8ion/remark-lint-preset": "6.0.2",
68
+ "@form8ion/eslint-config-mocha": "3.0.6",
69
+ "@form8ion/remark-lint-preset": "6.0.4",
69
70
  "@rollup/plugin-babel": "6.0.4",
70
- "@travi/any": "3.1.0",
71
- "babel-plugin-istanbul": "6.1.1",
72
- "ban-sensitive-files": "1.10.1",
73
- "c8": "9.1.0",
74
- "chai": "4.4.1",
71
+ "@travi/any": "3.1.2",
72
+ "ban-sensitive-files": "1.10.5",
73
+ "c8": "10.1.2",
75
74
  "cross-env": "7.0.3",
76
75
  "cz-conventional-changelog": "3.3.0",
77
76
  "gherkin-lint": "4.2.4",
78
- "husky": "9.0.11",
79
- "lockfile-lint": "4.13.2",
80
- "ls-engines": "0.9.1",
81
- "mocha": "10.3.0",
77
+ "husky": "9.1.5",
78
+ "jest-when": "3.6.0",
79
+ "lockfile-lint": "4.14.0",
80
+ "ls-engines": "0.9.3",
82
81
  "mock-fs": "5.2.0",
83
- "npm-run-all2": "6.1.2",
84
- "publint": "0.2.7",
85
- "remark-cli": "12.0.0",
82
+ "npm-run-all2": "6.2.2",
83
+ "publint": "0.2.10",
84
+ "remark-cli": "12.0.1",
86
85
  "remark-toc": "9.0.0",
87
86
  "remark-usage": "11.0.1",
88
- "rimraf": "5.0.5",
89
- "rollup": "4.13.0",
87
+ "rimraf": "6.0.1",
88
+ "rollup": "4.21.0",
90
89
  "rollup-plugin-auto-external": "2.0.0",
91
- "sinon": "17.0.1"
90
+ "vitest": "2.0.5"
91
+ },
92
+ "dependencies": {
93
+ "@form8ion/core": "^4.6.1"
92
94
  }
93
95
  }