@idomatic/create 1.0.4 → 1.0.6
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/helpers/index.js +2 -9
- package/index.js +3 -10
- package/lib/initConfig.js +9 -7
- package/package.json +1 -1
package/helpers/index.js
CHANGED
|
@@ -1,25 +1,18 @@
|
|
|
1
1
|
const defaultConfigs = {
|
|
2
|
-
|
|
2
|
+
js: {
|
|
3
3
|
attributeName: "id",
|
|
4
4
|
prefix: "auto-id-",
|
|
5
5
|
excludeTags: ["html", "head", "script"],
|
|
6
6
|
includeExtensions: ["js", "jsx", "ts", "tsx"],
|
|
7
7
|
excludeFiles: [],
|
|
8
8
|
},
|
|
9
|
-
|
|
9
|
+
html: {
|
|
10
10
|
attributeName: "id",
|
|
11
11
|
prefix: "auto-id-",
|
|
12
12
|
excludeTags: ["html", "head", "script"],
|
|
13
13
|
includeExtensions: ["html", "vue"],
|
|
14
14
|
excludeFiles: [],
|
|
15
15
|
},
|
|
16
|
-
angular: {
|
|
17
|
-
attributeName: "id",
|
|
18
|
-
prefix: "auto-id-",
|
|
19
|
-
excludeTags: ["html", "head", "script"],
|
|
20
|
-
includeExtensions: ["html", "ng.html"],
|
|
21
|
-
excludeFiles: [],
|
|
22
|
-
},
|
|
23
16
|
};
|
|
24
17
|
|
|
25
18
|
export default defaultConfigs;
|
package/index.js
CHANGED
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
|
|
3
2
|
import prompts from "prompts";
|
|
4
3
|
import { execSync } from "child_process";
|
|
5
4
|
import { writeFileSync } from "fs";
|
|
5
|
+
import initConfig from "./lib/initConfig.js";
|
|
6
6
|
|
|
7
7
|
console.log("✨ Welcome to idomatic setup!");
|
|
8
8
|
|
|
9
|
+
await initConfig();
|
|
10
|
+
|
|
9
11
|
const res = await prompts([
|
|
10
|
-
{
|
|
11
|
-
type: "select",
|
|
12
|
-
name: "framework",
|
|
13
|
-
message: "Which framework are you using?",
|
|
14
|
-
choices: [
|
|
15
|
-
{ title: "React (JS/TSX)", value: "js" },
|
|
16
|
-
{ title: "HTML / Vue / Angular", value: "html" },
|
|
17
|
-
],
|
|
18
|
-
},
|
|
19
12
|
{
|
|
20
13
|
type: "toggle",
|
|
21
14
|
name: "installParsers",
|
package/lib/initConfig.js
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
|
-
import
|
|
3
|
+
import prompts from "prompts";
|
|
4
4
|
import defaultConfigs from "./defaultConfigs.js";
|
|
5
5
|
|
|
6
6
|
async function initConfig() {
|
|
7
|
-
const { framework } = await
|
|
7
|
+
const { framework } = await prompts([
|
|
8
8
|
{
|
|
9
|
-
type: "
|
|
9
|
+
type: "select",
|
|
10
10
|
name: "framework",
|
|
11
|
-
message: "
|
|
12
|
-
choices: [
|
|
13
|
-
|
|
11
|
+
message: "Which framework are you using?",
|
|
12
|
+
choices: [
|
|
13
|
+
{ title: "React (JS/TSX)", value: "js" },
|
|
14
|
+
{ title: "HTML / Vue / Angular", value: "html" },
|
|
15
|
+
],
|
|
14
16
|
},
|
|
15
17
|
]);
|
|
16
18
|
|
|
@@ -23,4 +25,4 @@ async function initConfig() {
|
|
|
23
25
|
console.log(`Configuration file created at ${configFilePath}`);
|
|
24
26
|
}
|
|
25
27
|
|
|
26
|
-
initConfig
|
|
28
|
+
export default initConfig;
|