@form8ion/github-workflows-core 1.0.0-alpha.2 → 1.0.0-alpha.3
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 +15 -2
- package/example.js +13 -2
- package/lib/index.js +27 -3
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +24 -3
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,6 +14,8 @@ core functionality for form8ion plugins that manage github workflows
|
|
|
14
14
|
* [Usage](#usage)
|
|
15
15
|
* [Installation](#installation)
|
|
16
16
|
* [Example](#example)
|
|
17
|
+
* [Import](#import)
|
|
18
|
+
* [Execute](#execute)
|
|
17
19
|
* [Contributing](#contributing)
|
|
18
20
|
* [Dependencies](#dependencies)
|
|
19
21
|
* [Verification](#verification)
|
|
@@ -40,14 +42,25 @@ $ npm install @form8ion/github-workflows-core --save-prod
|
|
|
40
42
|
#### Import
|
|
41
43
|
|
|
42
44
|
```javascript
|
|
43
|
-
import {
|
|
45
|
+
import {
|
|
46
|
+
scaffoldCheckoutStep,
|
|
47
|
+
scaffoldNodeSetupStep,
|
|
48
|
+
scaffoldDependencyInstallationStep,
|
|
49
|
+
scaffoldVerificationStep
|
|
50
|
+
} from '@form8ion/github-workflows-core';
|
|
44
51
|
```
|
|
45
52
|
|
|
46
53
|
#### Execute
|
|
47
54
|
|
|
48
55
|
```javascript
|
|
49
56
|
(async () => {
|
|
50
|
-
|
|
57
|
+
scaffoldCheckoutStep();
|
|
58
|
+
|
|
59
|
+
scaffoldNodeSetupStep({versionDeterminedBy: 'nvmrc'});
|
|
60
|
+
|
|
61
|
+
scaffoldDependencyInstallationStep();
|
|
62
|
+
|
|
63
|
+
scaffoldVerificationStep();
|
|
51
64
|
})();
|
|
52
65
|
```
|
|
53
66
|
|
package/example.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
// #### Import
|
|
2
2
|
// remark-usage-ignore-next
|
|
3
3
|
import stubbedFs from 'mock-fs';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
scaffoldCheckoutStep,
|
|
6
|
+
scaffoldNodeSetupStep,
|
|
7
|
+
scaffoldDependencyInstallationStep,
|
|
8
|
+
scaffoldVerificationStep
|
|
9
|
+
} from './lib/index.js';
|
|
5
10
|
|
|
6
11
|
// remark-usage-ignore-next
|
|
7
12
|
stubbedFs();
|
|
@@ -9,5 +14,11 @@ stubbedFs();
|
|
|
9
14
|
// #### Execute
|
|
10
15
|
|
|
11
16
|
(async () => {
|
|
12
|
-
|
|
17
|
+
scaffoldCheckoutStep();
|
|
18
|
+
|
|
19
|
+
scaffoldNodeSetupStep({versionDeterminedBy: 'nvmrc'});
|
|
20
|
+
|
|
21
|
+
scaffoldDependencyInstallationStep();
|
|
22
|
+
|
|
23
|
+
scaffoldVerificationStep();
|
|
13
24
|
})();
|
package/lib/index.js
CHANGED
|
@@ -2,9 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
function
|
|
6
|
-
return
|
|
5
|
+
function setupNode({versionDeterminedBy}) {
|
|
6
|
+
return {
|
|
7
|
+
name: 'Setup node',
|
|
8
|
+
uses: 'actions/setup-node@v3',
|
|
9
|
+
with: {
|
|
10
|
+
...'nvmrc' === versionDeterminedBy && {'node-version-file': '.nvmrc'},
|
|
11
|
+
// eslint-disable-next-line no-template-curly-in-string
|
|
12
|
+
...'matrix' === versionDeterminedBy && {'node-version': '${{ matrix.node }}'},
|
|
13
|
+
cache: 'npm'
|
|
14
|
+
}
|
|
15
|
+
};
|
|
7
16
|
}
|
|
8
17
|
|
|
9
|
-
|
|
18
|
+
function executeVerification() {
|
|
19
|
+
return {run: 'npm test'};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function installDependencies() {
|
|
23
|
+
return {run: 'npm clean-install'};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function checkout() {
|
|
27
|
+
return {uses: 'actions/checkout@v3'};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
exports.scaffoldCheckoutStep = checkout;
|
|
31
|
+
exports.scaffoldDependencyInstallationStep = installDependencies;
|
|
32
|
+
exports.scaffoldNodeSetupStep = setupNode;
|
|
33
|
+
exports.scaffoldVerificationStep = executeVerification;
|
|
10
34
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/
|
|
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 {run: 'npm clean-install'};\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,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;AACpC,CAAC;AACD;AACO,SAAS,QAAQ,GAAG;AAC3B,EAAE,OAAO,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;AACvC;;;;;;;"}
|
package/lib/index.mjs
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
|
-
function
|
|
2
|
-
return
|
|
1
|
+
function setupNode({versionDeterminedBy}) {
|
|
2
|
+
return {
|
|
3
|
+
name: 'Setup node',
|
|
4
|
+
uses: 'actions/setup-node@v3',
|
|
5
|
+
with: {
|
|
6
|
+
...'nvmrc' === versionDeterminedBy && {'node-version-file': '.nvmrc'},
|
|
7
|
+
// eslint-disable-next-line no-template-curly-in-string
|
|
8
|
+
...'matrix' === versionDeterminedBy && {'node-version': '${{ matrix.node }}'},
|
|
9
|
+
cache: 'npm'
|
|
10
|
+
}
|
|
11
|
+
};
|
|
3
12
|
}
|
|
4
13
|
|
|
5
|
-
|
|
14
|
+
function executeVerification() {
|
|
15
|
+
return {run: 'npm test'};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function installDependencies() {
|
|
19
|
+
return {run: 'npm clean-install'};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function checkout() {
|
|
23
|
+
return {uses: 'actions/checkout@v3'};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { checkout as scaffoldCheckoutStep, installDependencies as scaffoldDependencyInstallationStep, setupNode as scaffoldNodeSetupStep, executeVerification as scaffoldVerificationStep };
|
|
6
27
|
//# sourceMappingURL=index.mjs.map
|
package/lib/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../src/
|
|
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 {run: 'npm clean-install'};\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,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;AACpC,CAAC;AACD;AACO,SAAS,QAAQ,GAAG;AAC3B,EAAE,OAAO,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;AACvC;;;;"}
|