@form8ion/javascript 13.0.0-beta.1 → 13.0.0-beta.10

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
@@ -74,9 +74,13 @@ const {
74
74
  babelPreset: {name: `@${accountName}`, packageName: `@${accountName}/babel-preset`},
75
75
  commitlint: {name: `@${accountName}`, packageName: `@${accountName}/commitlint-config`}
76
76
  },
77
- overrides: {npmAccount: accountName},
78
- ciServices: {},
79
- unitTestFrameworks: {},
77
+ plugins: {
78
+ unitTestFrameworks: {},
79
+ applicationTypes: {},
80
+ packageTypes: {},
81
+ packageBundlers: {},
82
+ ciServices: {}
83
+ },
80
84
  decisions: {
81
85
  [questionNames.DIALECT]: dialects.BABEL,
82
86
  [questionNames.NODE_VERSION_CATEGORY]: 'LTS',
@@ -103,6 +107,12 @@ const {
103
107
  scripts: {},
104
108
  eslint: {configs: [], ignore: {directories: []}},
105
109
  packageManager: 'npm'
110
+ },
111
+ enhancers: {
112
+ PluginName: {
113
+ test: () => true,
114
+ lift: () => ({})
115
+ }
106
116
  }
107
117
  });
108
118
  }
@@ -110,8 +120,8 @@ const {
110
120
  await scaffoldUnitTesting({
111
121
  projectRoot: process.cwd(),
112
122
  frameworks: {
113
- Mocha: {scaffolder: options => options},
114
- Jest: {scaffolder: options => options}
123
+ Mocha: {scaffold: options => options},
124
+ Jest: {scaffold: options => options}
115
125
  },
116
126
  visibility: 'Public',
117
127
  vcs: {host: 'GitHub', owner: 'foo', name: 'bar'},
package/example.js CHANGED
@@ -2,87 +2,95 @@
2
2
  // remark-usage-ignore-next 4
3
3
  import {resolve} from 'path';
4
4
  import stubbedFs from 'mock-fs';
5
- import td from 'testdouble';
5
+ import * as td from 'testdouble';
6
6
  import 'validate-npm-package-name';
7
7
 
8
8
  // remark-usage-ignore-next 10
9
9
  stubbedFs({
10
- node_modules: stubbedFs.load(resolve(...[__dirname, 'node_modules'])),
10
+ node_modules: stubbedFs.load(resolve('node_modules')),
11
11
  '.nvmrc': 'v1.2.3',
12
- lib: stubbedFs.load(resolve(...[__dirname, 'lib'])),
13
- templates: stubbedFs.load(resolve(...[__dirname, 'templates']))
12
+ lib: stubbedFs.load(resolve('lib')),
13
+ templates: stubbedFs.load(resolve('templates'))
14
14
  });
15
15
  const execa = td.replace('execa');
16
16
  td.when(execa('. ~/.nvm/nvm.sh && nvm ls-remote --lts', {shell: true}))
17
17
  .thenResolve({stdout: ['v16.5.4', ''].join('\n')});
18
18
  td.when(execa('. ~/.nvm/nvm.sh && nvm install', {shell: true})).thenReturn({stdout: {pipe: () => undefined}});
19
19
 
20
- const {dialects, projectTypes} = require('@form8ion/javascript-core');
20
+ const {dialects, projectTypes} = await import('@form8ion/javascript-core');
21
21
  const {
22
22
  scaffold: scaffoldJavaScript,
23
23
  lift: liftJavascript,
24
24
  test: thisIsAJavaScriptProject,
25
25
  scaffoldUnitTesting,
26
26
  questionNames
27
- } = require('./lib/index.js');
27
+ } = await import('./lib/index.js');
28
28
 
29
29
  // #### Execute
30
- (async () => {
31
- const accountName = 'form8ion';
32
- const projectRoot = process.cwd();
30
+ const accountName = 'form8ion';
31
+ const projectRoot = process.cwd();
33
32
 
34
- await scaffoldJavaScript({
35
- projectRoot,
36
- projectName: 'project-name',
37
- visibility: 'Public',
38
- license: 'MIT',
39
- configs: {
40
- eslint: {scope: `@${accountName}`},
41
- remark: `@${accountName}/remark-lint-preset`,
42
- babelPreset: {name: `@${accountName}`, packageName: `@${accountName}/babel-preset`},
43
- commitlint: {name: `@${accountName}`, packageName: `@${accountName}/commitlint-config`}
44
- },
45
- overrides: {npmAccount: accountName},
46
- ciServices: {},
33
+ await scaffoldJavaScript({
34
+ projectRoot,
35
+ projectName: 'project-name',
36
+ visibility: 'Public',
37
+ license: 'MIT',
38
+ configs: {
39
+ eslint: {scope: `@${accountName}`},
40
+ remark: `@${accountName}/remark-lint-preset`,
41
+ babelPreset: {name: `@${accountName}`, packageName: `@${accountName}/babel-preset`},
42
+ commitlint: {name: `@${accountName}`, packageName: `@${accountName}/commitlint-config`}
43
+ },
44
+ plugins: {
47
45
  unitTestFrameworks: {},
48
- decisions: {
49
- [questionNames.DIALECT]: dialects.BABEL,
50
- [questionNames.NODE_VERSION_CATEGORY]: 'LTS',
51
- [questionNames.PACKAGE_MANAGER]: 'npm',
52
- [questionNames.PROJECT_TYPE]: projectTypes.PACKAGE,
53
- [questionNames.SHOULD_BE_SCOPED]: true,
54
- [questionNames.SCOPE]: accountName,
55
- [questionNames.AUTHOR_NAME]: 'Your Name',
56
- [questionNames.AUTHOR_EMAIL]: 'you@domain.tld',
57
- [questionNames.AUTHOR_URL]: 'https://your.website.tld',
58
- [questionNames.UNIT_TESTS]: true,
59
- [questionNames.INTEGRATION_TESTS]: true,
60
- [questionNames.PROVIDE_EXAMPLE]: true
61
- }
62
- });
63
-
64
- if (await thisIsAJavaScriptProject({projectRoot})) {
65
- await liftJavascript({
66
- projectRoot,
67
- configs: {eslint: {scope: '@foo'}},
68
- results: {
69
- dependencies: [],
70
- devDependencies: [],
71
- scripts: {},
72
- eslint: {configs: [], ignore: {directories: []}},
73
- packageManager: 'npm'
74
- }
75
- });
46
+ applicationTypes: {},
47
+ packageTypes: {},
48
+ packageBundlers: {},
49
+ ciServices: {}
50
+ },
51
+ decisions: {
52
+ [questionNames.DIALECT]: dialects.BABEL,
53
+ [questionNames.NODE_VERSION_CATEGORY]: 'LTS',
54
+ [questionNames.PACKAGE_MANAGER]: 'npm',
55
+ [questionNames.PROJECT_TYPE]: projectTypes.PACKAGE,
56
+ [questionNames.SHOULD_BE_SCOPED]: true,
57
+ [questionNames.SCOPE]: accountName,
58
+ [questionNames.AUTHOR_NAME]: 'Your Name',
59
+ [questionNames.AUTHOR_EMAIL]: 'you@domain.tld',
60
+ [questionNames.AUTHOR_URL]: 'https://your.website.tld',
61
+ [questionNames.UNIT_TESTS]: true,
62
+ [questionNames.INTEGRATION_TESTS]: true,
63
+ [questionNames.PROVIDE_EXAMPLE]: true
76
64
  }
65
+ });
77
66
 
78
- await scaffoldUnitTesting({
79
- projectRoot: process.cwd(),
80
- frameworks: {
81
- Mocha: {scaffolder: options => options},
82
- Jest: {scaffolder: options => options}
67
+ if (await thisIsAJavaScriptProject({projectRoot})) {
68
+ await liftJavascript({
69
+ projectRoot,
70
+ configs: {eslint: {scope: '@foo'}},
71
+ results: {
72
+ dependencies: [],
73
+ devDependencies: [],
74
+ scripts: {},
75
+ eslint: {configs: [], ignore: {directories: []}},
76
+ packageManager: 'npm'
83
77
  },
84
- visibility: 'Public',
85
- vcs: {host: 'GitHub', owner: 'foo', name: 'bar'},
86
- decisions: {[questionNames.UNIT_TEST_FRAMEWORK]: 'Mocha'}
78
+ enhancers: {
79
+ PluginName: {
80
+ test: () => true,
81
+ lift: () => ({})
82
+ }
83
+ }
87
84
  });
88
- })();
85
+ }
86
+
87
+ await scaffoldUnitTesting({
88
+ projectRoot: process.cwd(),
89
+ frameworks: {
90
+ Mocha: {scaffold: options => options},
91
+ Jest: {scaffold: options => options}
92
+ },
93
+ visibility: 'Public',
94
+ vcs: {host: 'GitHub', owner: 'foo', name: 'bar'},
95
+ decisions: {[questionNames.UNIT_TEST_FRAMEWORK]: 'Mocha'}
96
+ });