@form8ion/eslint-config-extender 12.0.0-beta.1 → 12.0.0-beta.2

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.
Files changed (3) hide show
  1. package/README.md +41 -12
  2. package/example.js +6 -0
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -45,9 +45,12 @@ $ npm install @form8ion/eslint-config-extender --save-prod
45
45
 
46
46
  #### Import
47
47
 
48
+ ```javascript
49
+ import {promptConstants} from '@form8ion/project';
50
+ ```
51
+
48
52
  ```javascript
49
53
  const {packageManagers} = await import('@form8ion/javascript-core');
50
- const githubPlugin = await import('@form8ion/github');
51
54
  const {questionNames: projectQuestionNames} = await import('@form8ion/project');
52
55
  const javascriptPlugin = await import('@form8ion/javascript');
53
56
  const {scaffold, extendEslintConfig} = await import('./lib/index.mjs');
@@ -74,15 +77,6 @@ const {scaffold, extendEslintConfig} = await import('./lib/index.mjs');
74
77
  await extendEslintConfig(
75
78
  {
76
79
  decisions: {
77
- [projectQuestionNames.PROJECT_NAME]: 'eslint-config-foo',
78
- [projectQuestionNames.DESCRIPTION]: 'a description of the project',
79
- [projectQuestionNames.VISIBILITY]: 'Public',
80
- [projectQuestionNames.LICENSE]: 'MIT',
81
- [projectQuestionNames.COPYRIGHT_HOLDER]: 'John Smith',
82
- [projectQuestionNames.COPYRIGHT_YEAR]: '2022',
83
- [projectQuestionNames.GIT_REPO]: true,
84
- [projectQuestionNames.REPO_HOST]: 'GitHub',
85
- [projectQuestionNames.REPO_OWNER]: 'org-name',
86
80
  [javascriptPlugin.questionNames.AUTHOR_NAME]: 'John Smith',
87
81
  [javascriptPlugin.questionNames.AUTHOR_EMAIL]: 'john@smith.org',
88
82
  [javascriptPlugin.questionNames.AUTHOR_URL]: 'https://smith.org',
@@ -92,7 +86,15 @@ const {scaffold, extendEslintConfig} = await import('./lib/index.mjs');
92
86
  [javascriptPlugin.questionNames.CI_SERVICE]: 'Other',
93
87
  [javascriptPlugin.questionNames.PROVIDE_EXAMPLE]: false
94
88
  },
95
- plugins: {vcsHosts: {GitHub: githubPlugin}}
89
+ plugins: {
90
+ vcsHosts: {
91
+ foo: {
92
+ scaffold: ({projectName}) => ({
93
+ vcs: {name: projectName, host: any.url(), owner: any.word(), ssh_url: any.url()}
94
+ })
95
+ }
96
+ }
97
+ }
96
98
  },
97
99
  decisions => ({
98
100
  ...javascriptPlugin,
@@ -102,7 +104,34 @@ const {scaffold, extendEslintConfig} = await import('./lib/index.mjs');
102
104
  configs: {},
103
105
  plugins: {unitTestFrameworks: {}}
104
106
  })
105
- })
107
+ }),
108
+ {
109
+ prompt: ({id}) => {
110
+ switch (id) {
111
+ case promptConstants.ids.BASE_DETAILS:
112
+ return {
113
+ [projectQuestionNames.PROJECT_NAME]: 'eslint-config-foo',
114
+ [projectQuestionNames.DESCRIPTION]: 'a description of the project',
115
+ [projectQuestionNames.VISIBILITY]: 'Public',
116
+ [projectQuestionNames.LICENSE]: 'MIT',
117
+ [projectQuestionNames.COPYRIGHT_HOLDER]: 'John Smith',
118
+ [projectQuestionNames.COPYRIGHT_YEAR]: '2022'
119
+ };
120
+ case promptConstants.ids.GIT_REPOSITORY:
121
+ return {[projectQuestionNames.GIT_REPO]: true};
122
+ case promptConstants.ids.REPOSITORY_HOST:
123
+ return {[projectQuestionNames.REPO_HOST]: 'foo'};
124
+ default:
125
+ throw new Error(`Unknown prompt: ${id}`);
126
+ }
127
+ },
128
+ logger: {
129
+ info: () => undefined,
130
+ success: () => undefined,
131
+ warn: () => undefined,
132
+ error: () => undefined
133
+ }
134
+ }
106
135
  );
107
136
  })();
108
137
  ```
package/example.js CHANGED
@@ -94,6 +94,12 @@ stubbedFs({node_modules: stubbedNodeModules});
94
94
  default:
95
95
  throw new Error(`Unknown prompt: ${id}`);
96
96
  }
97
+ },
98
+ logger: {
99
+ info: () => undefined,
100
+ success: () => undefined,
101
+ warn: () => undefined,
102
+ error: () => undefined
97
103
  }
98
104
  }
99
105
  );
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@form8ion/eslint-config-extender",
3
3
  "description": "shareable ESLint config scaffolder for extending another config",
4
4
  "license": "MIT",
5
- "version": "12.0.0-beta.1",
5
+ "version": "12.0.0-beta.2",
6
6
  "type": "module",
7
7
  "engines": {
8
8
  "node": "^20.19.0 || >=22.14.0"
@@ -28,7 +28,7 @@
28
28
  "lint:gherkin": "gherkin-lint",
29
29
  "test:integration": "run-s 'test:integration:base -- --profile noWip'",
30
30
  "test:integration:base": "NODE_OPTIONS=--enable-source-maps DEBUG=any cucumber-js test/integration",
31
- "test:integration:debug": "DEBUG=test run-s test:integration",
31
+ "test:integration:debug": "DEBUG=test:* run-s test:integration",
32
32
  "test:integration:wip": "run-s 'test:integration:base -- --profile wip'",
33
33
  "test:integration:wip:debug": "DEBUG=test run-s 'test:integration:wip'",
34
34
  "test:integration:focus": "run-s 'test:integration:base -- --profile focus'",
@@ -61,7 +61,7 @@
61
61
  "@form8ion/core": "^4.7.1",
62
62
  "@form8ion/javascript": "^15.0.0",
63
63
  "@form8ion/javascript-core": "^12.0.0",
64
- "@form8ion/project": "22.0.0-beta.10",
64
+ "@form8ion/project": "22.0.0-beta.11",
65
65
  "deepmerge": "^4.2.2"
66
66
  },
67
67
  "devDependencies": {