@nshiab/setup-data-project 1.0.20 → 1.0.22
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/esm/helpers/createFolderStructure.d.ts.map +1 -1
- package/esm/helpers/createFolderStructure.js +6 -2
- package/esm/helpers/updateProjectConfig.d.ts.map +1 -1
- package/esm/helpers/updateProjectConfig.js +9 -3
- package/package.json +1 -1
- package/script/helpers/createFolderStructure.d.ts.map +1 -1
- package/script/helpers/createFolderStructure.js +6 -2
- package/script/helpers/updateProjectConfig.d.ts.map +1 -1
- package/script/helpers/updateProjectConfig.js +9 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createFolderStructure.d.ts","sourceRoot":"","sources":["../../src/helpers/createFolderStructure.ts"],"names":[],"mappings":"AAKA,wBAAsB,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"createFolderStructure.d.ts","sourceRoot":"","sources":["../../src/helpers/createFolderStructure.ts"],"names":[],"mappings":"AAKA,wBAAsB,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,EAAE,mBA4CrE"}
|
|
@@ -16,8 +16,12 @@ export async function createFolderStructure(selectedPackages) {
|
|
|
16
16
|
}
|
|
17
17
|
const mainTsPath = join(sdaFolder, "main.ts");
|
|
18
18
|
let mainTsContent = 'console.log("Hello simple-data-analysis!");\n';
|
|
19
|
-
if (selectedPackages.includes("@nshiab/simple-data-analysis")
|
|
20
|
-
|
|
19
|
+
if (selectedPackages.includes("@nshiab/simple-data-analysis") ||
|
|
20
|
+
selectedPackages.includes("@nshiab/simple-data-analysis-core")) {
|
|
21
|
+
const pkg = selectedPackages.includes("@nshiab/simple-data-analysis")
|
|
22
|
+
? "@nshiab/simple-data-analysis"
|
|
23
|
+
: "@nshiab/simple-data-analysis-core";
|
|
24
|
+
mainTsContent = `import { SimpleDB } from "${pkg}";
|
|
21
25
|
|
|
22
26
|
const sdb = new SimpleDB();
|
|
23
27
|
const table = sdb.newTable();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateProjectConfig.d.ts","sourceRoot":"","sources":["../../src/helpers/updateProjectConfig.ts"],"names":[],"mappings":"AAGA,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"updateProjectConfig.d.ts","sourceRoot":"","sources":["../../src/helpers/updateProjectConfig.ts"],"names":[],"mappings":"AAGA,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,QA8ChE"}
|
|
@@ -8,13 +8,19 @@ export function updateProjectConfig(tasks) {
|
|
|
8
8
|
configFile = "deno.json";
|
|
9
9
|
key = "tasks";
|
|
10
10
|
}
|
|
11
|
-
else if (
|
|
11
|
+
else if (existsSync("package.json")) {
|
|
12
|
+
configFile = "package.json";
|
|
13
|
+
key = "scripts";
|
|
14
|
+
}
|
|
15
|
+
else if (runtime === "deno") {
|
|
12
16
|
configFile = "deno.json";
|
|
13
17
|
key = "tasks";
|
|
14
18
|
writeFileSync(configFile, JSON.stringify({ [key]: {} }, null, 2));
|
|
15
19
|
}
|
|
16
|
-
else
|
|
17
|
-
|
|
20
|
+
else {
|
|
21
|
+
configFile = "package.json";
|
|
22
|
+
key = "scripts";
|
|
23
|
+
writeFileSync(configFile, JSON.stringify({ name: "data-project", type: "module", [key]: {} }, null, 2));
|
|
18
24
|
}
|
|
19
25
|
try {
|
|
20
26
|
const content = readFileSync(configFile, "utf-8");
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createFolderStructure.d.ts","sourceRoot":"","sources":["../../src/helpers/createFolderStructure.ts"],"names":[],"mappings":"AAKA,wBAAsB,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"createFolderStructure.d.ts","sourceRoot":"","sources":["../../src/helpers/createFolderStructure.ts"],"names":[],"mappings":"AAKA,wBAAsB,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,EAAE,mBA4CrE"}
|
|
@@ -19,8 +19,12 @@ async function createFolderStructure(selectedPackages) {
|
|
|
19
19
|
}
|
|
20
20
|
const mainTsPath = (0, node_path_1.join)(sdaFolder, "main.ts");
|
|
21
21
|
let mainTsContent = 'console.log("Hello simple-data-analysis!");\n';
|
|
22
|
-
if (selectedPackages.includes("@nshiab/simple-data-analysis")
|
|
23
|
-
|
|
22
|
+
if (selectedPackages.includes("@nshiab/simple-data-analysis") ||
|
|
23
|
+
selectedPackages.includes("@nshiab/simple-data-analysis-core")) {
|
|
24
|
+
const pkg = selectedPackages.includes("@nshiab/simple-data-analysis")
|
|
25
|
+
? "@nshiab/simple-data-analysis"
|
|
26
|
+
: "@nshiab/simple-data-analysis-core";
|
|
27
|
+
mainTsContent = `import { SimpleDB } from "${pkg}";
|
|
24
28
|
|
|
25
29
|
const sdb = new SimpleDB();
|
|
26
30
|
const table = sdb.newTable();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateProjectConfig.d.ts","sourceRoot":"","sources":["../../src/helpers/updateProjectConfig.ts"],"names":[],"mappings":"AAGA,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"updateProjectConfig.d.ts","sourceRoot":"","sources":["../../src/helpers/updateProjectConfig.ts"],"names":[],"mappings":"AAGA,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,QA8ChE"}
|
|
@@ -11,13 +11,19 @@ function updateProjectConfig(tasks) {
|
|
|
11
11
|
configFile = "deno.json";
|
|
12
12
|
key = "tasks";
|
|
13
13
|
}
|
|
14
|
-
else if (
|
|
14
|
+
else if ((0, node_fs_1.existsSync)("package.json")) {
|
|
15
|
+
configFile = "package.json";
|
|
16
|
+
key = "scripts";
|
|
17
|
+
}
|
|
18
|
+
else if (runtime === "deno") {
|
|
15
19
|
configFile = "deno.json";
|
|
16
20
|
key = "tasks";
|
|
17
21
|
(0, node_fs_1.writeFileSync)(configFile, JSON.stringify({ [key]: {} }, null, 2));
|
|
18
22
|
}
|
|
19
|
-
else
|
|
20
|
-
|
|
23
|
+
else {
|
|
24
|
+
configFile = "package.json";
|
|
25
|
+
key = "scripts";
|
|
26
|
+
(0, node_fs_1.writeFileSync)(configFile, JSON.stringify({ name: "data-project", type: "module", [key]: {} }, null, 2));
|
|
21
27
|
}
|
|
22
28
|
try {
|
|
23
29
|
const content = (0, node_fs_1.readFileSync)(configFile, "utf-8");
|