@idomatic/create 1.0.3 → 1.0.4

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.
@@ -0,0 +1,25 @@
1
+ const defaultConfigs = {
2
+ react: {
3
+ attributeName: "id",
4
+ prefix: "auto-id-",
5
+ excludeTags: ["html", "head", "script"],
6
+ includeExtensions: ["js", "jsx", "ts", "tsx"],
7
+ excludeFiles: [],
8
+ },
9
+ vue: {
10
+ attributeName: "id",
11
+ prefix: "auto-id-",
12
+ excludeTags: ["html", "head", "script"],
13
+ includeExtensions: ["html", "vue"],
14
+ excludeFiles: [],
15
+ },
16
+ angular: {
17
+ attributeName: "id",
18
+ prefix: "auto-id-",
19
+ excludeTags: ["html", "head", "script"],
20
+ includeExtensions: ["html", "ng.html"],
21
+ excludeFiles: [],
22
+ },
23
+ };
24
+
25
+ export default defaultConfigs;
@@ -0,0 +1,26 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+ import inquirer from "inquirer";
4
+ import defaultConfigs from "./defaultConfigs.js";
5
+
6
+ async function initConfig() {
7
+ const { framework } = await inquirer.prompt([
8
+ {
9
+ type: "list",
10
+ name: "framework",
11
+ message: "Select your framework:",
12
+ choices: ["react", "vue", "angular"],
13
+ default: "react",
14
+ },
15
+ ]);
16
+
17
+ const config = defaultConfigs[framework];
18
+
19
+ // Write the config to .idomaticsrc.json in the current working directory
20
+ const configFilePath = path.join(process.cwd(), ".idomaticsrc.json");
21
+ fs.writeFileSync(configFilePath, JSON.stringify(config, null, 2));
22
+
23
+ console.log(`Configuration file created at ${configFilePath}`);
24
+ }
25
+
26
+ initConfig();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idomatic/create",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "@idomatic/create": "./index.js"