@form8ion/github-workflows-core 5.0.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 +11 -2
- package/example.js +5 -2
- package/lib/index.js +9 -2
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +9 -3
- package/lib/index.mjs.map +1 -1
- package/package.json +24 -23
package/README.md
CHANGED
|
@@ -17,6 +17,12 @@ core functionality for form8ion plugins that manage github workflows
|
|
|
17
17
|
* [Example](#example)
|
|
18
18
|
* [Import](#import)
|
|
19
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)
|
|
20
26
|
* [Contributing](#contributing)
|
|
21
27
|
* [Dependencies](#dependencies)
|
|
22
28
|
* [Verification](#verification)
|
|
@@ -47,7 +53,8 @@ import {
|
|
|
47
53
|
scaffoldCheckoutStep,
|
|
48
54
|
scaffoldNodeSetupStep,
|
|
49
55
|
scaffoldDependencyInstallationStep,
|
|
50
|
-
scaffoldVerificationStep
|
|
56
|
+
scaffoldVerificationStep,
|
|
57
|
+
writeWorkflowFile
|
|
51
58
|
} from '@form8ion/github-workflows-core';
|
|
52
59
|
```
|
|
53
60
|
|
|
@@ -62,6 +69,8 @@ import {
|
|
|
62
69
|
scaffoldDependencyInstallationStep();
|
|
63
70
|
|
|
64
71
|
scaffoldVerificationStep();
|
|
72
|
+
|
|
73
|
+
await writeWorkflowFile({projectRoot: process.cwd(), name: 'workflow-name', config: {}});
|
|
65
74
|
})();
|
|
66
75
|
```
|
|
67
76
|
|
|
@@ -148,7 +157,7 @@ $ npm test
|
|
|
148
157
|
|
|
149
158
|
[license-link]: LICENSE
|
|
150
159
|
|
|
151
|
-
[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
|
|
152
161
|
|
|
153
162
|
[npm-link]: https://www.npmjs.com/package/@form8ion/github-workflows-core
|
|
154
163
|
|
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@
|
|
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@
|
|
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@
|
|
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@
|
|
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@
|
|
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@
|
|
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,7 +2,7 @@
|
|
|
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": "5.
|
|
5
|
+
"version": "5.1.0",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": "^18.17 || >=20.6.1"
|
|
@@ -36,7 +36,7 @@
|
|
|
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
|
|
39
|
+
"test:unit:base": "DEBUG=any vitest run",
|
|
40
40
|
"lint:lockfile": "lockfile-lint",
|
|
41
41
|
"lint:js": "eslint . --cache",
|
|
42
42
|
"lint:js:fix": "run-s 'lint:js -- --fix'",
|
|
@@ -57,38 +57,39 @@
|
|
|
57
57
|
"access": "public",
|
|
58
58
|
"provenance": true
|
|
59
59
|
},
|
|
60
|
-
"packageManager": "npm@10.
|
|
60
|
+
"packageManager": "npm@10.8.2+sha512.c7f0088c520a46596b85c6f8f1da943400199748a0f7ea8cb8df75469668dc26f6fb3ba26df87e2884a5ebe91557292d0f3db7d0929cdb4f14910c3032ac81fb",
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@babel/register": "7.
|
|
63
|
-
"@cucumber/cucumber": "9.
|
|
64
|
-
"@form8ion/babel-preset": "1.6.
|
|
62
|
+
"@babel/register": "7.24.6",
|
|
63
|
+
"@cucumber/cucumber": "10.9.0",
|
|
64
|
+
"@form8ion/babel-preset": "1.6.135",
|
|
65
65
|
"@form8ion/commitlint-config": "1.0.76",
|
|
66
66
|
"@form8ion/eslint-config": "7.0.9",
|
|
67
67
|
"@form8ion/eslint-config-cucumber": "1.4.1",
|
|
68
|
-
"@form8ion/eslint-config-mocha": "3.0.
|
|
69
|
-
"@form8ion/remark-lint-preset": "6.0.
|
|
68
|
+
"@form8ion/eslint-config-mocha": "3.0.6",
|
|
69
|
+
"@form8ion/remark-lint-preset": "6.0.4",
|
|
70
70
|
"@rollup/plugin-babel": "6.0.4",
|
|
71
|
-
"@travi/any": "3.1.
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"c8": "9.1.0",
|
|
75
|
-
"chai": "4.4.1",
|
|
71
|
+
"@travi/any": "3.1.2",
|
|
72
|
+
"ban-sensitive-files": "1.10.5",
|
|
73
|
+
"c8": "10.1.2",
|
|
76
74
|
"cross-env": "7.0.3",
|
|
77
75
|
"cz-conventional-changelog": "3.3.0",
|
|
78
76
|
"gherkin-lint": "4.2.4",
|
|
79
|
-
"husky": "9.
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
77
|
+
"husky": "9.1.5",
|
|
78
|
+
"jest-when": "3.6.0",
|
|
79
|
+
"lockfile-lint": "4.14.0",
|
|
80
|
+
"ls-engines": "0.9.3",
|
|
83
81
|
"mock-fs": "5.2.0",
|
|
84
|
-
"npm-run-all2": "6.
|
|
85
|
-
"publint": "0.2.
|
|
86
|
-
"remark-cli": "12.0.
|
|
82
|
+
"npm-run-all2": "6.2.2",
|
|
83
|
+
"publint": "0.2.10",
|
|
84
|
+
"remark-cli": "12.0.1",
|
|
87
85
|
"remark-toc": "9.0.0",
|
|
88
86
|
"remark-usage": "11.0.1",
|
|
89
|
-
"rimraf": "
|
|
90
|
-
"rollup": "4.
|
|
87
|
+
"rimraf": "6.0.1",
|
|
88
|
+
"rollup": "4.21.0",
|
|
91
89
|
"rollup-plugin-auto-external": "2.0.0",
|
|
92
|
-
"
|
|
90
|
+
"vitest": "2.0.5"
|
|
91
|
+
},
|
|
92
|
+
"dependencies": {
|
|
93
|
+
"@form8ion/core": "^4.6.1"
|
|
93
94
|
}
|
|
94
95
|
}
|