@dvukovic/style-guide 0.7.0 → 0.8.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 +4 -4
- package/dist/cli/prompts.d.ts +0 -1
- package/dist/cspell/index.d.ts +1 -1
- package/package.json +2 -2
- package/src/cli/generators/cspell.js +3 -3
- package/src/cli/init.js +2 -8
- package/src/cli/prompts.js +1 -14
- package/src/cspell/configs/core.js +1 -0
- package/src/cspell/index.js +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Personal style guide with ESLint, Prettier, Stylelint, and CSpell configurations
|
|
|
5
5
|
## Quick Start
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npx @dvukovic/style-guide init
|
|
8
|
+
npx @dvukovic/style-guide@latest init
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
This interactive CLI will:
|
|
@@ -103,12 +103,12 @@ export default config
|
|
|
103
103
|
Create `cspell.config.js`:
|
|
104
104
|
|
|
105
105
|
```js
|
|
106
|
-
import
|
|
106
|
+
import { core } from "@dvukovic/style-guide/cspell"
|
|
107
107
|
|
|
108
108
|
/** @type {import("cspell").FileSettings} */
|
|
109
109
|
const config = {
|
|
110
|
-
...
|
|
111
|
-
ignorePaths: [],
|
|
110
|
+
...core,
|
|
111
|
+
ignorePaths: [...core.ignorePaths],
|
|
112
112
|
ignoreWords: [],
|
|
113
113
|
}
|
|
114
114
|
|
package/dist/cli/prompts.d.ts
CHANGED
package/dist/cspell/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as core
|
|
1
|
+
export { default as core } from "./configs/core.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dvukovic/style-guide",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "My own style guide",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"default": "./src/eslint/index.js"
|
|
23
23
|
},
|
|
24
24
|
"./knip": {
|
|
25
|
-
"types": "./
|
|
25
|
+
"types": "./src/knip/index.d.ts",
|
|
26
26
|
"default": "./src/knip/index.js"
|
|
27
27
|
},
|
|
28
28
|
"./prettier": {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export function generateCspellConfig() {
|
|
2
|
-
return `import
|
|
2
|
+
return `import { core } from "@dvukovic/style-guide/cspell"
|
|
3
3
|
|
|
4
4
|
/** @type {import("cspell").FileSettings} */
|
|
5
5
|
const config = {
|
|
6
|
-
...
|
|
7
|
-
ignorePaths: [],
|
|
6
|
+
...core,
|
|
7
|
+
ignorePaths: [...core.ignorePaths],
|
|
8
8
|
ignoreWords: [],
|
|
9
9
|
}
|
|
10
10
|
|
package/src/cli/init.js
CHANGED
|
@@ -11,7 +11,6 @@ import { generatePrettierConfig } from "./generators/prettier.js"
|
|
|
11
11
|
import { generateScripts } from "./generators/scripts.js"
|
|
12
12
|
import { generateStylelintConfig } from "./generators/stylelint.js"
|
|
13
13
|
import {
|
|
14
|
-
promptAddScripts,
|
|
15
14
|
promptESLintOptions,
|
|
16
15
|
promptInstall,
|
|
17
16
|
promptOverwrite,
|
|
@@ -114,14 +113,12 @@ async function writeConfigFile(filename, content) {
|
|
|
114
113
|
if (!overwrite) {
|
|
115
114
|
clack.log.info(`Skipped ${filename}`)
|
|
116
115
|
|
|
117
|
-
return
|
|
116
|
+
return
|
|
118
117
|
}
|
|
119
118
|
}
|
|
120
119
|
|
|
121
120
|
await writeFile(filename, content)
|
|
122
121
|
clack.log.success(`Created ${filename}`)
|
|
123
|
-
|
|
124
|
-
return true
|
|
125
122
|
}
|
|
126
123
|
|
|
127
124
|
async function updatePackageJsonScripts(tools, packageManager) {
|
|
@@ -167,7 +164,6 @@ export async function runInit() {
|
|
|
167
164
|
eslintOptions = await promptESLintOptions()
|
|
168
165
|
}
|
|
169
166
|
|
|
170
|
-
const shouldAddScripts = await promptAddScripts()
|
|
171
167
|
const packageManager = detectPackageManager()
|
|
172
168
|
|
|
173
169
|
await installPackages(tools, packageManager)
|
|
@@ -215,7 +211,5 @@ export async function runInit() {
|
|
|
215
211
|
await writeConfigFile(filename, content)
|
|
216
212
|
}
|
|
217
213
|
|
|
218
|
-
|
|
219
|
-
await updatePackageJsonScripts(tools, packageManager)
|
|
220
|
-
}
|
|
214
|
+
await updatePackageJsonScripts(tools, packageManager)
|
|
221
215
|
}
|
package/src/cli/prompts.js
CHANGED
|
@@ -154,7 +154,7 @@ export async function promptESLintOptions() {
|
|
|
154
154
|
|
|
155
155
|
export async function promptOverwrite(filename) {
|
|
156
156
|
const overwrite = await clack.confirm({
|
|
157
|
-
initialValue:
|
|
157
|
+
initialValue: true,
|
|
158
158
|
message: `${filename} already exists. Overwrite?`,
|
|
159
159
|
})
|
|
160
160
|
|
|
@@ -181,16 +181,3 @@ export async function promptInstall(packageManager, packages) {
|
|
|
181
181
|
|
|
182
182
|
return install
|
|
183
183
|
}
|
|
184
|
-
|
|
185
|
-
export async function promptAddScripts() {
|
|
186
|
-
const addScripts = await clack.confirm({
|
|
187
|
-
initialValue: true,
|
|
188
|
-
message: "Add lint scripts to package.json?",
|
|
189
|
-
})
|
|
190
|
-
|
|
191
|
-
if (clack.isCancel(addScripts)) {
|
|
192
|
-
return false
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
return addScripts
|
|
196
|
-
}
|
package/src/cspell/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as core
|
|
1
|
+
export { default as core } from "./configs/core.js"
|