@form8ion/javascript 15.6.0 → 15.6.1
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/package.json +4 -3
- package/src/code-style/index.js +3 -0
- package/src/code-style/lifter.js +6 -0
- package/src/code-style/lifter.test.js +25 -0
- package/src/code-style/remark/index.js +3 -0
- package/src/code-style/remark/lifter.js +10 -0
- package/src/code-style/remark/lifter.test.js +28 -0
- package/src/code-style/remark/scaffolder.js +38 -0
- package/src/code-style/remark/scaffolder.test.js +102 -0
- package/src/code-style/remark/tester.js +11 -0
- package/src/code-style/remark/tester.test.js +46 -0
- package/src/code-style/scaffolder.js +26 -0
- package/src/code-style/scaffolder.test.js +87 -0
- package/src/code-style/tester.js +5 -0
- package/src/code-style/tester.test.js +23 -0
- package/src/corepack/index.js +1 -0
- package/src/corepack/lifter.js +5 -0
- package/src/corepack/lifter.test.js +22 -0
- package/src/coverage/index.js +3 -0
- package/src/coverage/lifter.js +31 -0
- package/src/coverage/lifter.test.js +58 -0
- package/src/coverage/nyc/index.js +2 -0
- package/src/coverage/nyc/remover.js +16 -0
- package/src/coverage/nyc/remover.test.js +24 -0
- package/src/coverage/nyc/tester.js +5 -0
- package/src/coverage/nyc/tester.test.js +29 -0
- package/src/coverage/scaffolder.js +7 -0
- package/src/coverage/scaffolder.test.js +32 -0
- package/src/coverage/tester.js +10 -0
- package/src/coverage/tester.test.js +50 -0
- package/src/dependencies/index.js +3 -0
- package/src/dependencies/installer.js +25 -0
- package/src/dependencies/installer.test.js +77 -0
- package/src/dependencies/package-managers.js +32 -0
- package/src/dependencies/package-managers.test.js +46 -0
- package/src/dependencies/processor.js +30 -0
- package/src/dependencies/processor.test.js +75 -0
- package/src/dependencies/remover.js +10 -0
- package/src/dependencies/remover.test.js +28 -0
- package/src/dialects/babel/config/ignore-adder.js +10 -0
- package/src/dialects/babel/config/ignore-adder.test.js +33 -0
- package/src/dialects/babel/config/index.js +3 -0
- package/src/dialects/babel/config/loader.js +5 -0
- package/src/dialects/babel/config/loader.test.js +21 -0
- package/src/dialects/babel/config/writer.js +6 -0
- package/src/dialects/babel/config/writer.test.js +20 -0
- package/src/dialects/babel/index.js +3 -0
- package/src/dialects/babel/lifter.js +7 -0
- package/src/dialects/babel/lifter.test.js +17 -0
- package/src/dialects/babel/predicate.js +5 -0
- package/src/dialects/babel/predicate.test.js +25 -0
- package/src/dialects/babel/scaffolder.js +14 -0
- package/src/dialects/babel/scaffolder.test.js +28 -0
- package/src/dialects/index.js +2 -0
- package/src/dialects/prompt-choices.js +10 -0
- package/src/dialects/prompt-choices.test.js +28 -0
- package/src/dialects/scaffolder.js +15 -0
- package/src/dialects/scaffolder.test.js +49 -0
- package/src/dialects/typescript/index.js +1 -0
- package/src/dialects/typescript/scaffolder.js +31 -0
- package/src/dialects/typescript/scaffolder.test.js +95 -0
- package/src/documentation/generation-command.js +11 -0
- package/src/documentation/generation-command.test.js +25 -0
- package/src/documentation/index.js +1 -0
- package/src/documentation/scaffolder.js +20 -0
- package/src/documentation/scaffolder.test.js +49 -0
- package/src/engines/index.js +2 -0
- package/src/engines/lifter.js +7 -0
- package/src/engines/lifter.test.js +18 -0
- package/src/engines/tester.js +7 -0
- package/src/engines/tester.test.js +37 -0
- package/src/index.js +9 -0
- package/src/lifter.js +55 -0
- package/src/lifter.test.js +96 -0
- package/src/linting/index.js +1 -0
- package/src/linting/scaffolder.js +5 -0
- package/src/linting/scaffolder.test.js +31 -0
- package/src/lockfile-lint/allowed-hosts-builder.js +6 -0
- package/src/lockfile-lint/allowed-hosts-builder.test.js +35 -0
- package/src/lockfile-lint/config.js +12 -0
- package/src/lockfile-lint/config.test.js +37 -0
- package/src/lockfile-lint/index.js +3 -0
- package/src/lockfile-lint/scaffolder.js +38 -0
- package/src/lockfile-lint/scaffolder.test.js +85 -0
- package/src/lockfile-lint/tester.js +5 -0
- package/src/lockfile-lint/tester.test.js +25 -0
- package/src/node-version/index.js +2 -0
- package/src/node-version/scaffolder.js +19 -0
- package/src/node-version/scaffolder.test.js +33 -0
- package/src/node-version/tasks.js +25 -0
- package/src/node-version/tasks.test.js +43 -0
- package/src/node-version/tester.js +5 -0
- package/src/node-version/tester.test.js +29 -0
- package/src/npm-config/index.js +5 -0
- package/src/npm-config/lifter.js +14 -0
- package/src/npm-config/lifter.test.js +23 -0
- package/src/npm-config/reader.js +11 -0
- package/src/npm-config/reader.test.js +33 -0
- package/src/npm-config/scaffolder.js +16 -0
- package/src/npm-config/scaffolder.test.js +54 -0
- package/src/npm-config/tester.js +5 -0
- package/src/npm-config/tester.test.js +29 -0
- package/src/npm-config/writer.js +6 -0
- package/src/npm-config/writer.test.js +24 -0
- package/src/options/schemas.js +14 -0
- package/src/options/schemas.test.js +147 -0
- package/src/options/validator.js +45 -0
- package/src/options/validator.test.js +79 -0
- package/src/package/details.js +18 -0
- package/src/package/details.test.js +51 -0
- package/src/package/index.js +2 -0
- package/src/package/lifter.js +47 -0
- package/src/package/lifter.test.js +100 -0
- package/src/package/package-name.js +13 -0
- package/src/package/package-name.test.js +52 -0
- package/src/package/property-sorter.js +38 -0
- package/src/package/property-sorter.test.js +56 -0
- package/src/package/scaffolder.js +32 -0
- package/src/package/scaffolder.test.js +46 -0
- package/src/package/scripts/index.js +1 -0
- package/src/package/scripts/lifter.js +14 -0
- package/src/package/scripts/lifter.test.js +31 -0
- package/src/package/scripts/script-comparator.js +46 -0
- package/src/package/scripts/script-comparator.test.js +119 -0
- package/src/package/scripts/scripts-sorter.js +7 -0
- package/src/package/scripts/scripts-sorter.test.js +20 -0
- package/src/package/scripts/test-script-updater.js +15 -0
- package/src/package/scripts/test-script-updater.test.js +32 -0
- package/src/package/vcs-host-details.js +12 -0
- package/src/package/vcs-host-details.test.js +16 -0
- package/src/package-managers/current-manager-resolver.js +21 -0
- package/src/package-managers/current-manager-resolver.test.js +51 -0
- package/src/package-managers/index.js +5 -0
- package/src/package-managers/lifter.js +7 -0
- package/src/package-managers/lifter.test.js +18 -0
- package/src/package-managers/lockfile-path-resolver.js +10 -0
- package/src/package-managers/lockfile-path-resolver.test.js +15 -0
- package/src/package-managers/npm/index.js +2 -0
- package/src/package-managers/npm/scaffolder.js +19 -0
- package/src/package-managers/npm/scaffolder.test.js +33 -0
- package/src/package-managers/npm/tester.js +11 -0
- package/src/package-managers/npm/tester.test.js +33 -0
- package/src/package-managers/scaffolder.js +11 -0
- package/src/package-managers/scaffolder.test.js +27 -0
- package/src/package-managers/tester.js +11 -0
- package/src/package-managers/tester.test.js +33 -0
- package/src/package-managers/yarn/index.js +2 -0
- package/src/package-managers/yarn/scaffolder.js +19 -0
- package/src/package-managers/yarn/scaffolder.test.js +33 -0
- package/src/package-managers/yarn/tester.js +11 -0
- package/src/package-managers/yarn/tester.test.js +33 -0
- package/src/plugins-schemas.js +4 -0
- package/src/plugins-schemas.test.js +28 -0
- package/src/project-type/application/index.js +2 -0
- package/src/project-type/application/predicate.js +3 -0
- package/src/project-type/application/predicate.test.js +14 -0
- package/src/project-type/application/scaffolder.js +24 -0
- package/src/project-type/application/scaffolder.test.js +35 -0
- package/src/project-type/cli/index.js +3 -0
- package/src/project-type/cli/lifter.js +5 -0
- package/src/project-type/cli/lifter.test.js +20 -0
- package/src/project-type/cli/scaffolder.js +52 -0
- package/src/project-type/cli/scaffolder.test.js +103 -0
- package/src/project-type/cli/tester.js +3 -0
- package/src/project-type/cli/tester.test.js +14 -0
- package/src/project-type/index.js +3 -0
- package/src/project-type/lifter.js +23 -0
- package/src/project-type/lifter.test.js +69 -0
- package/src/project-type/monorepo/index.js +1 -0
- package/src/project-type/monorepo/scaffolder.js +16 -0
- package/src/project-type/monorepo/scaffolder.test.js +27 -0
- package/src/project-type/package/build-details.js +56 -0
- package/src/project-type/package/build-details.test.js +111 -0
- package/src/project-type/package/documentation.js +34 -0
- package/src/project-type/package/documentation.test.js +106 -0
- package/src/project-type/package/index.js +3 -0
- package/src/project-type/package/lifter.js +5 -0
- package/src/project-type/package/lifter.test.js +20 -0
- package/src/project-type/package/scaffolder.js +84 -0
- package/src/project-type/package/scaffolder.test.js +267 -0
- package/src/project-type/package/tester.js +5 -0
- package/src/project-type/package/tester.test.js +28 -0
- package/src/project-type/publishable/access-level.js +3 -0
- package/src/project-type/publishable/access-level.test.js +13 -0
- package/src/project-type/publishable/badges.js +20 -0
- package/src/project-type/publishable/badges.test.js +29 -0
- package/src/project-type/publishable/bundler/index.js +1 -0
- package/src/project-type/publishable/bundler/prompt.js +16 -0
- package/src/project-type/publishable/bundler/prompt.test.js +35 -0
- package/src/project-type/publishable/bundler/scaffolder.js +8 -0
- package/src/project-type/publishable/bundler/scaffolder.test.js +33 -0
- package/src/project-type/publishable/index.js +2 -0
- package/src/project-type/publishable/lifter.js +24 -0
- package/src/project-type/publishable/lifter.test.js +49 -0
- package/src/project-type/publishable/provenance/index.js +1 -0
- package/src/project-type/publishable/provenance/lifter.js +15 -0
- package/src/project-type/publishable/provenance/lifter.test.js +56 -0
- package/src/project-type/publishable/provenance/slsa.js +17 -0
- package/src/project-type/publishable/provenance/slsa.test.js +21 -0
- package/src/project-type/publishable/registry-resolver.js +15 -0
- package/src/project-type/publishable/registry-resolver.test.js +60 -0
- package/src/project-type/publishable/scaffolder.js +7 -0
- package/src/project-type/publishable/scaffolder.test.js +23 -0
- package/src/project-type/scaffolder.js +56 -0
- package/src/project-type/scaffolder.test.js +115 -0
- package/src/project-type/tester.js +9 -0
- package/src/project-type/tester.test.js +51 -0
- package/src/project-type-plugin/index.js +1 -0
- package/src/project-type-plugin/prompt.js +16 -0
- package/src/project-type-plugin/prompt.test.js +39 -0
- package/src/project-type-plugin/scaffolder.js +28 -0
- package/src/project-type-plugin/scaffolder.test.js +70 -0
- package/src/prompts/conditionals.js +39 -0
- package/src/prompts/conditionals.test.js +95 -0
- package/src/prompts/question-names.js +17 -0
- package/src/prompts/questions.js +158 -0
- package/src/prompts/questions.test.js +247 -0
- package/src/prompts/validators.js +9 -0
- package/src/prompts/validators.test.js +19 -0
- package/src/registries/index.js +2 -0
- package/src/registries/lifter.js +43 -0
- package/src/registries/lifter.test.js +63 -0
- package/src/registries/npm-config/list-builder.js +9 -0
- package/src/registries/npm-config/list-builder.test.js +43 -0
- package/src/registries/tester.js +3 -0
- package/src/registries/tester.test.js +9 -0
- package/src/runkit/badge/index.js +1 -0
- package/src/runkit/badge/scaffolder.js +13 -0
- package/src/runkit/badge/scaffolder.test.js +22 -0
- package/src/runkit/index.js +4 -0
- package/src/runkit/lifter.js +5 -0
- package/src/runkit/lifter.test.js +17 -0
- package/src/runkit/remover.js +3 -0
- package/src/runkit/remover.test.js +9 -0
- package/src/runkit/scaffolder.js +11 -0
- package/src/runkit/scaffolder.test.js +35 -0
- package/src/runkit/tester.js +3 -0
- package/src/runkit/tester.test.js +16 -0
- package/src/scaffolder.js +155 -0
- package/src/scaffolder.test.js +239 -0
- package/src/tester.js +17 -0
- package/src/tester.test.js +37 -0
- package/src/testing/index.js +1 -0
- package/src/testing/scaffolder.js +31 -0
- package/src/testing/scaffolder.test.js +63 -0
- package/src/testing/unit/index.js +1 -0
- package/src/testing/unit/prompt.js +15 -0
- package/src/testing/unit/prompt.test.js +33 -0
- package/src/testing/unit/scaffolder.js +30 -0
- package/src/testing/unit/scaffolder.test.js +54 -0
- package/src/vcs/ignore-lists-builder.js +6 -0
- package/src/vcs/ignore-lists-builder.test.js +25 -0
- package/src/vcs/schema.js +7 -0
- package/src/vcs/schema.test.js +40 -0
- package/src/verification/index.js +1 -0
- package/src/verification/scaffolder.js +35 -0
- package/src/verification/scaffolder.test.js +56 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import {projectTypes} from '@form8ion/javascript-core';
|
|
2
|
+
|
|
3
|
+
import {afterEach, describe, expect, it, vi} from 'vitest';
|
|
4
|
+
import any from '@travi/any';
|
|
5
|
+
import {when} from 'vitest-when';
|
|
6
|
+
|
|
7
|
+
import {scaffold as scaffoldPackageType} from './package/index.js';
|
|
8
|
+
import {scaffold as scaffoldApplicationType} from './application/index.js';
|
|
9
|
+
import {scaffold as scaffoldMonorepoType} from './monorepo/index.js';
|
|
10
|
+
import {scaffold as scaffoldCliType} from './cli/index.js';
|
|
11
|
+
import projectTypeScaffolder from './scaffolder.js';
|
|
12
|
+
|
|
13
|
+
vi.mock('./package/scaffolder.js');
|
|
14
|
+
vi.mock('./application/index.js');
|
|
15
|
+
vi.mock('./cli/index.js');
|
|
16
|
+
vi.mock('./monorepo/index.js');
|
|
17
|
+
|
|
18
|
+
describe('project-type scaffolder', () => {
|
|
19
|
+
const results = any.simpleObject();
|
|
20
|
+
const projectRoot = any.string();
|
|
21
|
+
const projectName = any.word();
|
|
22
|
+
const packageName = any.word();
|
|
23
|
+
const packageManager = any.word();
|
|
24
|
+
const visibility = any.word();
|
|
25
|
+
const decisions = any.simpleObject();
|
|
26
|
+
const publishRegistry = any.url();
|
|
27
|
+
const dialect = any.word();
|
|
28
|
+
const provideExample = any.boolean();
|
|
29
|
+
const packageBundlers = any.simpleObject();
|
|
30
|
+
|
|
31
|
+
afterEach(() => {
|
|
32
|
+
vi.clearAllMocks();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('should apply the package-type scaffolder when the project-type is `Package`', async () => {
|
|
36
|
+
const scope = any.word();
|
|
37
|
+
when(scaffoldPackageType).calledWith({
|
|
38
|
+
projectRoot,
|
|
39
|
+
packageName,
|
|
40
|
+
projectName,
|
|
41
|
+
packageManager,
|
|
42
|
+
visibility,
|
|
43
|
+
scope,
|
|
44
|
+
packageBundlers,
|
|
45
|
+
decisions,
|
|
46
|
+
dialect,
|
|
47
|
+
provideExample,
|
|
48
|
+
publishRegistry
|
|
49
|
+
}).thenResolve(results);
|
|
50
|
+
|
|
51
|
+
expect(await projectTypeScaffolder({
|
|
52
|
+
projectType: projectTypes.PACKAGE,
|
|
53
|
+
projectRoot,
|
|
54
|
+
projectName,
|
|
55
|
+
packageName,
|
|
56
|
+
packageManager,
|
|
57
|
+
visibility,
|
|
58
|
+
scope,
|
|
59
|
+
packageBundlers,
|
|
60
|
+
decisions,
|
|
61
|
+
dialect,
|
|
62
|
+
provideExample,
|
|
63
|
+
publishRegistry
|
|
64
|
+
})).toEqual(results);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('should apply the application-type scaffolder when the project-type is `Application`', async () => {
|
|
68
|
+
when(scaffoldApplicationType).calledWith({projectRoot}).thenResolve(results);
|
|
69
|
+
|
|
70
|
+
expect(await projectTypeScaffolder({
|
|
71
|
+
projectType: projectTypes.APPLICATION,
|
|
72
|
+
projectRoot,
|
|
73
|
+
projectName,
|
|
74
|
+
packageName,
|
|
75
|
+
packageManager,
|
|
76
|
+
decisions,
|
|
77
|
+
visibility
|
|
78
|
+
})).toEqual(results);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it('should apply the cli-type scaffolder when the project-type is `CLI`', async () => {
|
|
82
|
+
when(scaffoldCliType)
|
|
83
|
+
.calledWith({packageName, visibility, projectRoot, dialect, publishRegistry, decisions, packageBundlers})
|
|
84
|
+
.thenResolve(results);
|
|
85
|
+
|
|
86
|
+
expect(await projectTypeScaffolder({
|
|
87
|
+
projectType: projectTypes.CLI,
|
|
88
|
+
packageName,
|
|
89
|
+
visibility,
|
|
90
|
+
projectRoot,
|
|
91
|
+
dialect,
|
|
92
|
+
publishRegistry,
|
|
93
|
+
decisions,
|
|
94
|
+
packageBundlers
|
|
95
|
+
})).toEqual(results);
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it('should apply the monorepo-type scaffolder when the project-type is `Monorepo`', async () => {
|
|
99
|
+
when(scaffoldMonorepoType).calledWith({projectRoot}).thenResolve(results);
|
|
100
|
+
|
|
101
|
+
expect(await projectTypeScaffolder({projectRoot, projectType: projectTypes.MONOREPO, packageManager, decisions}))
|
|
102
|
+
.toEqual(results);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it('should not throw an error when the project-type is `Other`', async () => {
|
|
106
|
+
expect(await projectTypeScaffolder({projectType: 'Other'})).toEqual({});
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it('should throw an error for an unknown project-type', async () => {
|
|
110
|
+
const projectType = any.word();
|
|
111
|
+
|
|
112
|
+
await expect(() => projectTypeScaffolder({projectType}))
|
|
113
|
+
.rejects.toThrowError(`The project-type of ${projectType} is invalid`);
|
|
114
|
+
});
|
|
115
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import {test as isPackage} from './package/index.js';
|
|
2
|
+
import {test as isCli} from './cli/index.js';
|
|
3
|
+
import {test as isApplication} from './application/index.js';
|
|
4
|
+
|
|
5
|
+
export default async function isProjectType({projectRoot, packageDetails}) {
|
|
6
|
+
return await isPackage({projectRoot, packageDetails})
|
|
7
|
+
|| await isCli({projectRoot, packageDetails})
|
|
8
|
+
|| isApplication({projectRoot, packageDetails});
|
|
9
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {afterEach, describe, expect, it, vi} from 'vitest';
|
|
2
|
+
import any from '@travi/any';
|
|
3
|
+
import {when} from 'vitest-when';
|
|
4
|
+
|
|
5
|
+
import {test as packagePredicate} from './package/index.js';
|
|
6
|
+
import {test as cliPredicate} from './cli/index.js';
|
|
7
|
+
import {test as applicationPredicate} from './application/index.js';
|
|
8
|
+
import test from './tester.js';
|
|
9
|
+
|
|
10
|
+
vi.mock('./package');
|
|
11
|
+
vi.mock('./cli');
|
|
12
|
+
vi.mock('./application');
|
|
13
|
+
|
|
14
|
+
describe('project-type tester', () => {
|
|
15
|
+
const projectRoot = any.string();
|
|
16
|
+
const packageDetails = any.simpleObject();
|
|
17
|
+
|
|
18
|
+
afterEach(() => {
|
|
19
|
+
vi.clearAllMocks();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('should return `true` if the result of the package tester is `true`', async () => {
|
|
23
|
+
when(packagePredicate).calledWith({projectRoot, packageDetails}).thenResolve(true);
|
|
24
|
+
when(cliPredicate).calledWith({projectRoot, packageDetails}).thenResolve(false);
|
|
25
|
+
|
|
26
|
+
expect(await test({projectRoot, packageDetails})).toBe(true);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('should return `true` if the result of the cli tester is `true`', async () => {
|
|
30
|
+
when(cliPredicate).calledWith({projectRoot}).thenResolve(true);
|
|
31
|
+
when(packagePredicate).calledWith({projectRoot}).thenResolve(false);
|
|
32
|
+
|
|
33
|
+
expect(await test({projectRoot})).toBe(true);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('should return `true` if the result of the application tester is `true`', async () => {
|
|
37
|
+
when(applicationPredicate).calledWith({projectRoot, packageDetails}).thenResolve(true);
|
|
38
|
+
when(cliPredicate).calledWith({projectRoot, packageDetails}).thenResolve(false);
|
|
39
|
+
when(packagePredicate).calledWith({projectRoot, packageDetails}).thenResolve(false);
|
|
40
|
+
|
|
41
|
+
expect(await test({projectRoot, packageDetails})).toBe(true);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('should return `false` if none of the available testers result in `true`', async () => {
|
|
45
|
+
when(applicationPredicate).calledWith({projectRoot, packageDetails}).thenResolve(false);
|
|
46
|
+
when(cliPredicate).calledWith({projectRoot, packageDetails}).thenResolve(false);
|
|
47
|
+
when(packagePredicate).calledWith({projectRoot, packageDetails}).thenResolve(false);
|
|
48
|
+
|
|
49
|
+
expect(await test({projectRoot, packageDetails})).toBe(false);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {default as scaffold} from './scaffolder.js';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {prompt} from '@form8ion/overridable-prompts';
|
|
2
|
+
|
|
3
|
+
import {questionNames} from '../prompts/question-names.js';
|
|
4
|
+
|
|
5
|
+
export default async function gatherProjectTypePluginInput({types, projectType, decisions}) {
|
|
6
|
+
if (!Object.keys(types).length) return 'Other';
|
|
7
|
+
|
|
8
|
+
const answers = await prompt([{
|
|
9
|
+
name: questionNames.PROJECT_TYPE_CHOICE,
|
|
10
|
+
type: 'list',
|
|
11
|
+
message: `What type of ${projectType} is this?`,
|
|
12
|
+
choices: [...Object.keys(types), 'Other']
|
|
13
|
+
}], decisions);
|
|
14
|
+
|
|
15
|
+
return answers[questionNames.PROJECT_TYPE_CHOICE];
|
|
16
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as prompts from '@form8ion/overridable-prompts';
|
|
2
|
+
|
|
3
|
+
import any from '@travi/any';
|
|
4
|
+
import {when} from 'vitest-when';
|
|
5
|
+
import {describe, expect, it, vi} from 'vitest';
|
|
6
|
+
|
|
7
|
+
import {questionNames} from '../prompts/question-names.js';
|
|
8
|
+
import prompt from './prompt.js';
|
|
9
|
+
|
|
10
|
+
vi.mock('@form8ion/overridable-prompts');
|
|
11
|
+
|
|
12
|
+
describe('project-type prompts', () => {
|
|
13
|
+
it('should present the choice of project-type', async () => {
|
|
14
|
+
const chosenType = any.word();
|
|
15
|
+
const projectType = any.word();
|
|
16
|
+
const decisions = any.simpleObject();
|
|
17
|
+
const answers = {...any.simpleObject(), [questionNames.PROJECT_TYPE_CHOICE]: chosenType};
|
|
18
|
+
const types = any.simpleObject();
|
|
19
|
+
when(prompts.prompt)
|
|
20
|
+
.calledWith(
|
|
21
|
+
[{
|
|
22
|
+
name: questionNames.PROJECT_TYPE_CHOICE,
|
|
23
|
+
type: 'list',
|
|
24
|
+
message: `What type of ${projectType} is this?`,
|
|
25
|
+
choices: [...Object.keys(types), 'Other']
|
|
26
|
+
}],
|
|
27
|
+
decisions
|
|
28
|
+
)
|
|
29
|
+
.thenResolve(answers);
|
|
30
|
+
|
|
31
|
+
expect(await prompt({types, projectType, decisions})).toEqual(chosenType);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('should skip the prompt and return `Other` when no options are provided', async () => {
|
|
35
|
+
expect(await prompt({types: {}, projectType: any.word()})).toEqual('Other');
|
|
36
|
+
|
|
37
|
+
expect(prompts.prompt).not.toHaveBeenCalled();
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {scaffoldChoice} from '@form8ion/javascript-core';
|
|
2
|
+
|
|
3
|
+
import chooseProjectTypePlugin from './prompt.js';
|
|
4
|
+
|
|
5
|
+
export default async function scaffoldProjectTypePlugin({
|
|
6
|
+
projectRoot,
|
|
7
|
+
projectType,
|
|
8
|
+
projectName,
|
|
9
|
+
packageName,
|
|
10
|
+
packageManager,
|
|
11
|
+
scope,
|
|
12
|
+
dialect,
|
|
13
|
+
tests,
|
|
14
|
+
decisions,
|
|
15
|
+
plugins
|
|
16
|
+
}) {
|
|
17
|
+
const pluginsForProjectType = plugins[projectType];
|
|
18
|
+
|
|
19
|
+
if (!pluginsForProjectType) return {};
|
|
20
|
+
|
|
21
|
+
const chosenType = await chooseProjectTypePlugin({types: pluginsForProjectType, decisions, projectType});
|
|
22
|
+
|
|
23
|
+
return scaffoldChoice(
|
|
24
|
+
pluginsForProjectType,
|
|
25
|
+
chosenType,
|
|
26
|
+
{projectRoot, projectName, packageName, packageManager, scope, tests, dialect}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import {scaffoldChoice} from '@form8ion/javascript-core';
|
|
2
|
+
|
|
3
|
+
import any from '@travi/any';
|
|
4
|
+
import {when} from 'vitest-when';
|
|
5
|
+
import {describe, expect, it, vi} from 'vitest';
|
|
6
|
+
|
|
7
|
+
import chooseProjectTypePlugin from './prompt.js';
|
|
8
|
+
import scaffold from './scaffolder.js';
|
|
9
|
+
|
|
10
|
+
vi.mock('@form8ion/javascript-core');
|
|
11
|
+
vi.mock('./prompt.js');
|
|
12
|
+
|
|
13
|
+
describe('chosen project-type plugin scaffolder', () => {
|
|
14
|
+
const chosenType = any.word();
|
|
15
|
+
const projectRoot = any.string();
|
|
16
|
+
const packageManager = any.word();
|
|
17
|
+
const projectName = any.word();
|
|
18
|
+
const packageName = any.word();
|
|
19
|
+
const projectType = any.word();
|
|
20
|
+
const scope = any.word();
|
|
21
|
+
const tests = any.simpleObject();
|
|
22
|
+
const decisions = any.simpleObject();
|
|
23
|
+
|
|
24
|
+
it('should enable choosing a plugin and scaffolding the choice', async () => {
|
|
25
|
+
const typeScaffoldingResults = any.simpleObject();
|
|
26
|
+
const pluginsForProjectType = any.simpleObject();
|
|
27
|
+
const dialect = any.word();
|
|
28
|
+
const plugins = {...any.simpleObject(), [projectType]: pluginsForProjectType};
|
|
29
|
+
when(chooseProjectTypePlugin)
|
|
30
|
+
.calledWith({types: pluginsForProjectType, decisions, projectType})
|
|
31
|
+
.thenReturn(chosenType);
|
|
32
|
+
when(scaffoldChoice)
|
|
33
|
+
.calledWith(
|
|
34
|
+
pluginsForProjectType,
|
|
35
|
+
chosenType,
|
|
36
|
+
{projectRoot, packageManager, projectName, packageName, tests, scope, dialect}
|
|
37
|
+
)
|
|
38
|
+
.thenResolve(typeScaffoldingResults);
|
|
39
|
+
|
|
40
|
+
expect(await scaffold({
|
|
41
|
+
projectRoot,
|
|
42
|
+
projectType,
|
|
43
|
+
projectName,
|
|
44
|
+
packageName,
|
|
45
|
+
packageManager,
|
|
46
|
+
tests,
|
|
47
|
+
scope,
|
|
48
|
+
dialect,
|
|
49
|
+
decisions,
|
|
50
|
+
plugins
|
|
51
|
+
})).toEqual(typeScaffoldingResults);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('should not scaffold a plugin if none are defined for the project type', async () => {
|
|
55
|
+
const results = await scaffold({
|
|
56
|
+
projectRoot,
|
|
57
|
+
projectType,
|
|
58
|
+
projectName,
|
|
59
|
+
packageName,
|
|
60
|
+
packageManager,
|
|
61
|
+
tests,
|
|
62
|
+
scope,
|
|
63
|
+
decisions,
|
|
64
|
+
plugins: any.simpleObject()
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
expect(chooseProjectTypePlugin).not.toHaveBeenCalled();
|
|
68
|
+
expect(results).toEqual({});
|
|
69
|
+
});
|
|
70
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {projectTypes} from '@form8ion/javascript-core';
|
|
2
|
+
import {questionNames as commonQuestionNames} from '@travi/language-scaffolder-prompts';
|
|
3
|
+
|
|
4
|
+
import {questionNames} from './question-names.js';
|
|
5
|
+
|
|
6
|
+
function projectIsCLI(answers) {
|
|
7
|
+
return projectTypes.CLI === answers[questionNames.PROJECT_TYPE];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function projectIsPackage(answers) {
|
|
11
|
+
return projectTypes.PACKAGE === answers[questionNames.PROJECT_TYPE];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function projectIsApplication(answers) {
|
|
15
|
+
return projectTypes.APPLICATION === answers[questionNames.PROJECT_TYPE];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function packageShouldBeScoped(visibility, answers) {
|
|
19
|
+
return 'Private' === visibility || answers[questionNames.SHOULD_BE_SCOPED];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function willBePublishedToNpm(answers) {
|
|
23
|
+
return projectIsPackage(answers) || projectIsCLI(answers);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function shouldBeScopedPromptShouldBePresented(answers) {
|
|
27
|
+
return willBePublishedToNpm(answers);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function scopePromptShouldBePresentedFactory(visibility) {
|
|
31
|
+
return answers => willBePublishedToNpm(answers) && packageShouldBeScoped(visibility, answers);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function lintingPromptShouldBePresented({
|
|
35
|
+
[commonQuestionNames.UNIT_TESTS]: unitTested,
|
|
36
|
+
[commonQuestionNames.INTEGRATION_TESTS]: integrationTested
|
|
37
|
+
}) {
|
|
38
|
+
return !unitTested && !integrationTested;
|
|
39
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import {questionNames as commonQuestionNames} from '@travi/language-scaffolder-prompts';
|
|
2
|
+
import {projectTypes} from '@form8ion/javascript-core';
|
|
3
|
+
|
|
4
|
+
import {describe, expect, it} from 'vitest';
|
|
5
|
+
import any from '@travi/any';
|
|
6
|
+
|
|
7
|
+
import {questionNames} from './question-names.js';
|
|
8
|
+
import {
|
|
9
|
+
lintingPromptShouldBePresented,
|
|
10
|
+
projectIsApplication,
|
|
11
|
+
scopePromptShouldBePresentedFactory,
|
|
12
|
+
shouldBeScopedPromptShouldBePresented
|
|
13
|
+
} from './conditionals.js';
|
|
14
|
+
|
|
15
|
+
describe('javascript prompt conditionals', () => {
|
|
16
|
+
describe('scope', () => {
|
|
17
|
+
it('should present the prompt for whether the package should be scoped for `package` project-types', () => {
|
|
18
|
+
expect(shouldBeScopedPromptShouldBePresented({[questionNames.PROJECT_TYPE]: projectTypes.PACKAGE})).toBe(true);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should present the prompt for whether the package should be scoped for `cli` project-types', () => {
|
|
22
|
+
expect(shouldBeScopedPromptShouldBePresented({[questionNames.PROJECT_TYPE]: projectTypes.CLI})).toBe(true);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('shouldnt present the prompt for whether the package should be scoped for non-publishable project-types', () => {
|
|
26
|
+
expect(shouldBeScopedPromptShouldBePresented({[questionNames.PROJECT_TYPE]: any.string()})).toBe(false);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('should present a scope prompt when a package should be scoped', () => {
|
|
30
|
+
expect(scopePromptShouldBePresentedFactory()({
|
|
31
|
+
[questionNames.SHOULD_BE_SCOPED]: true,
|
|
32
|
+
[questionNames.PROJECT_TYPE]: projectTypes.PACKAGE
|
|
33
|
+
})).toBe(true);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('should present a scope prompt when a package is private, because they must be scoped', () => {
|
|
37
|
+
expect(scopePromptShouldBePresentedFactory('Private')({
|
|
38
|
+
[questionNames.SHOULD_BE_SCOPED]: false,
|
|
39
|
+
[questionNames.PROJECT_TYPE]: projectTypes.PACKAGE
|
|
40
|
+
})).toBe(true);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('should present a scope prompt when a CLI should be scoped', () => {
|
|
44
|
+
expect(scopePromptShouldBePresentedFactory()({
|
|
45
|
+
[questionNames.SHOULD_BE_SCOPED]: true,
|
|
46
|
+
[questionNames.PROJECT_TYPE]: projectTypes.CLI
|
|
47
|
+
})).toBe(true);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('should present a scope prompt when a CLI is private, because they must be scoped', () => {
|
|
51
|
+
expect(scopePromptShouldBePresentedFactory('Private')({
|
|
52
|
+
[questionNames.SHOULD_BE_SCOPED]: false,
|
|
53
|
+
[questionNames.PROJECT_TYPE]: projectTypes.CLI
|
|
54
|
+
})).toBe(true);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it('should not present a scope prompt when an application is private', () => {
|
|
58
|
+
expect(scopePromptShouldBePresentedFactory('Private')({
|
|
59
|
+
[questionNames.SHOULD_BE_SCOPED]: false,
|
|
60
|
+
[questionNames.PROJECT_TYPE]: projectTypes.APPLICATION
|
|
61
|
+
})).toBe(false);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('should not preset a scope prompt for non-publishable projects', () => {
|
|
65
|
+
expect(scopePromptShouldBePresentedFactory()({[questionNames.SHOULD_BE_SCOPED]: false})).toBe(false);
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
describe('application', () => {
|
|
70
|
+
it('should return `true` when the package-type is `Application`', () => {
|
|
71
|
+
expect(projectIsApplication({[questionNames.PROJECT_TYPE]: projectTypes.APPLICATION})).toBe(true);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('should return `false` when the project-type is not an application', () => {
|
|
75
|
+
expect(projectIsApplication({[questionNames.PROJECT_TYPE]: any.word()})).toBe(false);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
describe('transpilation/linting', () => {
|
|
80
|
+
it('should not show the prompt if the project is unit tested ', () => {
|
|
81
|
+
expect(lintingPromptShouldBePresented({[commonQuestionNames.UNIT_TESTS]: true})).toBe(false);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it('should not show the prompt if the project is integration tested', () => {
|
|
85
|
+
expect(lintingPromptShouldBePresented({[commonQuestionNames.INTEGRATION_TESTS]: true})).toBe(false);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it('should show the prompt if the project is not tested', () => {
|
|
89
|
+
expect(lintingPromptShouldBePresented({
|
|
90
|
+
[commonQuestionNames.INTEGRATION_TESTS]: false,
|
|
91
|
+
[commonQuestionNames.UNIT_TESTS]: false
|
|
92
|
+
})).toBe(true);
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const questionNames = {
|
|
2
|
+
UNIT_TEST_FRAMEWORK: 'unitTestFramework',
|
|
3
|
+
NODE_VERSION_CATEGORY: 'nodeVersionCategory',
|
|
4
|
+
PACKAGE_MANAGER: 'packageManager',
|
|
5
|
+
PACKAGE_BUNDLER: 'packageBundler',
|
|
6
|
+
PROJECT_TYPE: 'projectType',
|
|
7
|
+
PROJECT_TYPE_CHOICE: 'projectTypeChoice',
|
|
8
|
+
SHOULD_BE_SCOPED: 'shouldBeScoped',
|
|
9
|
+
SCOPE: 'scope',
|
|
10
|
+
AUTHOR_NAME: 'authorName',
|
|
11
|
+
AUTHOR_EMAIL: 'authorEmail',
|
|
12
|
+
AUTHOR_URL: 'authorUrl',
|
|
13
|
+
HOST: 'host',
|
|
14
|
+
CONFIGURE_LINTING: 'configureLint',
|
|
15
|
+
PROVIDE_EXAMPLE: 'provideExample',
|
|
16
|
+
DIALECT: 'dialect'
|
|
17
|
+
};
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import {packageManagers, projectTypes} from '@form8ion/javascript-core';
|
|
2
|
+
import {prompt as promptWithInquirer} from '@form8ion/overridable-prompts';
|
|
3
|
+
import {questionNames as commonQuestionNames, questions as commonQuestions} from '@travi/language-scaffolder-prompts';
|
|
4
|
+
import {warn} from '@travi/cli-messages';
|
|
5
|
+
|
|
6
|
+
import {execa} from 'execa';
|
|
7
|
+
import npmConfFactory from '../../thirdparty-wrappers/npm-conf.js';
|
|
8
|
+
import buildDialectChoices from '../dialects/prompt-choices.js';
|
|
9
|
+
import {
|
|
10
|
+
lintingPromptShouldBePresented,
|
|
11
|
+
projectIsApplication,
|
|
12
|
+
projectIsPackage,
|
|
13
|
+
scopePromptShouldBePresentedFactory,
|
|
14
|
+
shouldBeScopedPromptShouldBePresented
|
|
15
|
+
} from './conditionals.js';
|
|
16
|
+
import {questionNames} from './question-names.js';
|
|
17
|
+
import {scope as validateScope} from './validators.js';
|
|
18
|
+
|
|
19
|
+
function authorQuestions({name, email, url}) {
|
|
20
|
+
return [
|
|
21
|
+
{
|
|
22
|
+
name: questionNames.AUTHOR_NAME,
|
|
23
|
+
message: 'What is the author\'s name?',
|
|
24
|
+
default: name
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: questionNames.AUTHOR_EMAIL,
|
|
28
|
+
message: 'What is the author\'s email?',
|
|
29
|
+
default: email
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: questionNames.AUTHOR_URL,
|
|
33
|
+
message: 'What is the author\'s website url?',
|
|
34
|
+
default: url
|
|
35
|
+
}
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export async function prompt(
|
|
40
|
+
ciServices,
|
|
41
|
+
hosts,
|
|
42
|
+
visibility,
|
|
43
|
+
vcs,
|
|
44
|
+
decisions,
|
|
45
|
+
configs,
|
|
46
|
+
pathWithinParent
|
|
47
|
+
) {
|
|
48
|
+
const npmConf = npmConfFactory();
|
|
49
|
+
|
|
50
|
+
let maybeLoggedInNpmUsername;
|
|
51
|
+
try {
|
|
52
|
+
maybeLoggedInNpmUsername = (await execa('npm', ['whoami'])).stdout;
|
|
53
|
+
} catch (failedExecutionResult) {
|
|
54
|
+
if (!decisions[questionNames.SCOPE]) {
|
|
55
|
+
warn('No logged in user found with `npm whoami`. Login with `npm login` '
|
|
56
|
+
+ 'to use your npm account name as the package scope default.');
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const {
|
|
61
|
+
[commonQuestionNames.UNIT_TESTS]: unitTested,
|
|
62
|
+
[commonQuestionNames.INTEGRATION_TESTS]: integrationTested,
|
|
63
|
+
[questionNames.PROJECT_TYPE]: projectType,
|
|
64
|
+
[commonQuestionNames.CI_SERVICE]: ci,
|
|
65
|
+
[questionNames.HOST]: chosenHost,
|
|
66
|
+
[questionNames.SCOPE]: scope,
|
|
67
|
+
[questionNames.NODE_VERSION_CATEGORY]: nodeVersionCategory,
|
|
68
|
+
[questionNames.AUTHOR_NAME]: authorName,
|
|
69
|
+
[questionNames.AUTHOR_EMAIL]: authorEmail,
|
|
70
|
+
[questionNames.AUTHOR_URL]: authorUrl,
|
|
71
|
+
[questionNames.CONFIGURE_LINTING]: configureLinting,
|
|
72
|
+
[questionNames.PROVIDE_EXAMPLE]: provideExample,
|
|
73
|
+
[questionNames.PACKAGE_MANAGER]: packageManager,
|
|
74
|
+
[questionNames.DIALECT]: dialect
|
|
75
|
+
} = await promptWithInquirer([
|
|
76
|
+
{
|
|
77
|
+
name: questionNames.DIALECT,
|
|
78
|
+
message: 'Which JavaScript dialect should this project follow?',
|
|
79
|
+
type: 'list',
|
|
80
|
+
choices: buildDialectChoices(configs),
|
|
81
|
+
default: 'babel'
|
|
82
|
+
},
|
|
83
|
+
...pathWithinParent ? [] : [{
|
|
84
|
+
name: questionNames.NODE_VERSION_CATEGORY,
|
|
85
|
+
message: 'What node.js version should be used?',
|
|
86
|
+
type: 'list',
|
|
87
|
+
choices: ['LTS', 'Latest'],
|
|
88
|
+
default: 'LTS'
|
|
89
|
+
}],
|
|
90
|
+
{
|
|
91
|
+
name: questionNames.PACKAGE_MANAGER,
|
|
92
|
+
message: 'Which package manager will be used with this project?',
|
|
93
|
+
type: 'list',
|
|
94
|
+
choices: Object.values(packageManagers),
|
|
95
|
+
default: packageManagers.NPM
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: questionNames.PROJECT_TYPE,
|
|
99
|
+
message: 'What type of JavaScript project is this?',
|
|
100
|
+
type: 'list',
|
|
101
|
+
choices: [...Object.values(projectTypes), 'Other'],
|
|
102
|
+
default: projectTypes.PACKAGE
|
|
103
|
+
},
|
|
104
|
+
...'Private' === visibility ? [] : [{
|
|
105
|
+
name: questionNames.SHOULD_BE_SCOPED,
|
|
106
|
+
message: 'Should this package be scoped?',
|
|
107
|
+
type: 'confirm',
|
|
108
|
+
when: shouldBeScopedPromptShouldBePresented,
|
|
109
|
+
default: true
|
|
110
|
+
}],
|
|
111
|
+
{
|
|
112
|
+
name: questionNames.SCOPE,
|
|
113
|
+
message: 'What is the scope?',
|
|
114
|
+
when: scopePromptShouldBePresentedFactory(visibility),
|
|
115
|
+
validate: validateScope(visibility),
|
|
116
|
+
default: maybeLoggedInNpmUsername
|
|
117
|
+
},
|
|
118
|
+
...authorQuestions({
|
|
119
|
+
name: npmConf.get('init.author.name'),
|
|
120
|
+
email: npmConf.get('init.author.email'),
|
|
121
|
+
url: npmConf.get('init.author.url')
|
|
122
|
+
}),
|
|
123
|
+
...commonQuestions(({vcs, ciServices, pathWithinParent})),
|
|
124
|
+
{
|
|
125
|
+
name: questionNames.CONFIGURE_LINTING,
|
|
126
|
+
message: 'Will there be source code that should be linted?',
|
|
127
|
+
type: 'confirm',
|
|
128
|
+
when: lintingPromptShouldBePresented
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: questionNames.PROVIDE_EXAMPLE,
|
|
132
|
+
message: 'Should an example be provided in the README?',
|
|
133
|
+
type: 'confirm',
|
|
134
|
+
when: projectIsPackage
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
name: questionNames.HOST,
|
|
138
|
+
type: 'list',
|
|
139
|
+
message: 'Where will the application be hosted?',
|
|
140
|
+
when: projectIsApplication,
|
|
141
|
+
choices: [...Object.keys(hosts), 'Other']
|
|
142
|
+
}
|
|
143
|
+
], decisions);
|
|
144
|
+
|
|
145
|
+
return {
|
|
146
|
+
tests: {unit: unitTested, integration: integrationTested},
|
|
147
|
+
projectType,
|
|
148
|
+
ci,
|
|
149
|
+
chosenHost,
|
|
150
|
+
scope,
|
|
151
|
+
nodeVersionCategory,
|
|
152
|
+
author: {name: authorName, email: authorEmail, url: authorUrl},
|
|
153
|
+
configureLinting: false !== configureLinting,
|
|
154
|
+
provideExample,
|
|
155
|
+
packageManager,
|
|
156
|
+
dialect
|
|
157
|
+
};
|
|
158
|
+
}
|