@nshiab/setup-data-project 1.0.32 → 1.0.34

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.
@@ -1 +1 @@
1
- {"version":3,"file":"createFolderStructure.d.ts","sourceRoot":"","sources":["../../src/helpers/createFolderStructure.ts"],"names":[],"mappings":"AAGA,wBAAgB,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,EAAE,UA6C/D"}
1
+ {"version":3,"file":"createFolderStructure.d.ts","sourceRoot":"","sources":["../../src/helpers/createFolderStructure.ts"],"names":[],"mappings":"AAIA,wBAAgB,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,EAAE,UA8C/D"}
@@ -1,5 +1,6 @@
1
1
  import { existsSync, lstatSync, mkdirSync, writeFileSync } from "node:fs";
2
2
  import { join } from "node:path";
3
+ import { log } from "@clack/prompts";
3
4
  export function createFolderStructure(selectedPackages) {
4
5
  const sdaFolder = "sda";
5
6
  const folders = ["data", "helpers", "output"];
@@ -34,6 +35,7 @@ await sdb.done();
34
35
  }
35
36
  if (lstatSync(mainTsPath, { throwIfNoEntry: false }) === undefined) {
36
37
  writeFileSync(mainTsPath, mainTsContent);
38
+ log.info(`Created ${mainTsPath}`);
37
39
  }
38
40
  return sdaFolder;
39
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ensureAgents.d.ts","sourceRoot":"","sources":["../../src/helpers/ensureAgents.ts"],"names":[],"mappings":"AAOA,wBAAgB,YAAY,CAC1B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACnC,OAAO,EAAE,MAAM,EACf,iBAAiB,GAAE,MAAM,EAA6B,QAuHvD"}
1
+ {"version":3,"file":"ensureAgents.d.ts","sourceRoot":"","sources":["../../src/helpers/ensureAgents.ts"],"names":[],"mappings":"AAOA,wBAAgB,YAAY,CAC1B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACnC,OAAO,EAAE,MAAM,EACf,iBAAiB,GAAE,MAAM,EAA6B,QAyHvD"}
@@ -101,7 +101,10 @@ ${sdaClassesAndMethods}`;
101
101
  content,
102
102
  createContent: (managedSection) => managedSection,
103
103
  });
104
- if (status === "created" || status === "updated") {
104
+ if (status === "created") {
105
+ log.info("Created AGENTS.md");
106
+ }
107
+ else if (status === "updated") {
105
108
  log.info("Updated AGENTS.md");
106
109
  }
107
110
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ensureEnvFile.d.ts","sourceRoot":"","sources":["../../src/helpers/ensureEnvFile.ts"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,SAI5B"}
1
+ {"version":3,"file":"ensureEnvFile.d.ts","sourceRoot":"","sources":["../../src/helpers/ensureEnvFile.ts"],"names":[],"mappings":"AAGA,wBAAgB,aAAa,SAK5B"}
@@ -1,6 +1,8 @@
1
1
  import { lstatSync, writeFileSync } from "node:fs";
2
+ import { log } from "@clack/prompts";
2
3
  export function ensureEnvFile() {
3
4
  if (lstatSync(".env", { throwIfNoEntry: false }) === undefined) {
4
5
  writeFileSync(".env", "");
6
+ log.info("Created .env");
5
7
  }
6
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ensureGitignore.d.ts","sourceRoot":"","sources":["../../src/helpers/ensureGitignore.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB,4DAC4B,CAAC;AAE5D,wBAAgB,eAAe,SA4B9B"}
1
+ {"version":3,"file":"ensureGitignore.d.ts","sourceRoot":"","sources":["../../src/helpers/ensureGitignore.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB,4DAC4B,CAAC;AAE5D,wBAAgB,eAAe,SA0B9B"}
@@ -20,7 +20,5 @@ export function ensureGitignore() {
20
20
  : "\n\n";
21
21
  const block = `${GITIGNORE_SENTINEL}\n${GITIGNORE_ENTRIES.join("\n")}\n`;
22
22
  writeFileSync(path, content + separator + block);
23
- if (stats !== undefined) {
24
- log.info(`Updated ${path}`);
25
- }
23
+ log.info(`${stats === undefined ? "Created" : "Updated"} ${path}`);
26
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ensureReadme.d.ts","sourceRoot":"","sources":["../../src/helpers/ensureReadme.ts"],"names":[],"mappings":"AAIA,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,iBAAiB,GAAE,MAAM,EAAO,QAwDjC"}
1
+ {"version":3,"file":"ensureReadme.d.ts","sourceRoot":"","sources":["../../src/helpers/ensureReadme.ts"],"names":[],"mappings":"AAIA,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,iBAAiB,GAAE,MAAM,EAAO,QA0DjC"}
@@ -20,13 +20,13 @@ export function ensureReadme(runtime, installedPackages = []) {
20
20
  ].filter(Boolean);
21
21
  const librarySection = libraryLinks.length === 0
22
22
  ? ""
23
- : `It's installing ${libraryLinks.join(" and ")} libraries, with up-to-date
24
- documentation and AI agent instructions.`;
23
+ : `It has installed ${libraryLinks.join(" and ")} libraries, along with
24
+ up-to-date documentation and AI agent instructions.`;
25
25
  const status = ensureManagedSection({
26
26
  path: "README.md",
27
27
  name: "libraries",
28
28
  content: librarySection,
29
- createContent: (managedSection) => `This repository has been created with
29
+ createContent: (managedSection) => `This repository was created with
30
30
  [setup-data-project](https://github.com/nshiab/setup-data-project/).
31
31
 
32
32
  ${managedSection}
@@ -34,19 +34,22 @@ ${managedSection}
34
34
  Here's the recommended workflow:
35
35
 
36
36
  - Put your raw data in the \`sda/data\` folder. Note that this folder is
37
- gitignored.
37
+ ignored by Git.
38
38
  - Use the \`sda/main.ts\` file to clean and process your raw data. Write the
39
39
  results to the \`sda/output\` folder.
40
40
 
41
41
  When working on your project, use the following command:
42
42
 
43
- - \`${runCommand} sda\` will watch your \`sda/main.ts\` and its dependencies. Everytime
44
- you'll save some changes, the data will be reprocessed.
43
+ - \`${runCommand} sda\` will watch your \`sda/main.ts\` and its dependencies.
44
+ Whenever you save changes, the data will be reprocessed.
45
45
  - \`${runCommand} clean\` will remove cache and temporary files, if present.
46
46
 
47
47
  Have fun!`,
48
48
  });
49
- if (status === "created" || status === "updated") {
49
+ if (status === "created") {
50
+ log.info("Created README.md");
51
+ }
52
+ else if (status === "updated") {
50
53
  log.info("Updated README.md");
51
54
  }
52
55
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nshiab/setup-data-project",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
4
4
  "description": "Quickly kick off your data project using the simple-data-analysis and journalism libraries.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1 +1 @@
1
- {"version":3,"file":"createFolderStructure.d.ts","sourceRoot":"","sources":["../../src/helpers/createFolderStructure.ts"],"names":[],"mappings":"AAGA,wBAAgB,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,EAAE,UA6C/D"}
1
+ {"version":3,"file":"createFolderStructure.d.ts","sourceRoot":"","sources":["../../src/helpers/createFolderStructure.ts"],"names":[],"mappings":"AAIA,wBAAgB,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,EAAE,UA8C/D"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createFolderStructure = createFolderStructure;
4
4
  const node_fs_1 = require("node:fs");
5
5
  const node_path_1 = require("node:path");
6
+ const prompts_1 = require("@clack/prompts");
6
7
  function createFolderStructure(selectedPackages) {
7
8
  const sdaFolder = "sda";
8
9
  const folders = ["data", "helpers", "output"];
@@ -37,6 +38,7 @@ await sdb.done();
37
38
  }
38
39
  if ((0, node_fs_1.lstatSync)(mainTsPath, { throwIfNoEntry: false }) === undefined) {
39
40
  (0, node_fs_1.writeFileSync)(mainTsPath, mainTsContent);
41
+ prompts_1.log.info(`Created ${mainTsPath}`);
40
42
  }
41
43
  return sdaFolder;
42
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ensureAgents.d.ts","sourceRoot":"","sources":["../../src/helpers/ensureAgents.ts"],"names":[],"mappings":"AAOA,wBAAgB,YAAY,CAC1B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACnC,OAAO,EAAE,MAAM,EACf,iBAAiB,GAAE,MAAM,EAA6B,QAuHvD"}
1
+ {"version":3,"file":"ensureAgents.d.ts","sourceRoot":"","sources":["../../src/helpers/ensureAgents.ts"],"names":[],"mappings":"AAOA,wBAAgB,YAAY,CAC1B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACnC,OAAO,EAAE,MAAM,EACf,iBAAiB,GAAE,MAAM,EAA6B,QAyHvD"}
@@ -104,7 +104,10 @@ ${sdaClassesAndMethods}`;
104
104
  content,
105
105
  createContent: (managedSection) => managedSection,
106
106
  });
107
- if (status === "created" || status === "updated") {
107
+ if (status === "created") {
108
+ prompts_1.log.info("Created AGENTS.md");
109
+ }
110
+ else if (status === "updated") {
108
111
  prompts_1.log.info("Updated AGENTS.md");
109
112
  }
110
113
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ensureEnvFile.d.ts","sourceRoot":"","sources":["../../src/helpers/ensureEnvFile.ts"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,SAI5B"}
1
+ {"version":3,"file":"ensureEnvFile.d.ts","sourceRoot":"","sources":["../../src/helpers/ensureEnvFile.ts"],"names":[],"mappings":"AAGA,wBAAgB,aAAa,SAK5B"}
@@ -2,8 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ensureEnvFile = ensureEnvFile;
4
4
  const node_fs_1 = require("node:fs");
5
+ const prompts_1 = require("@clack/prompts");
5
6
  function ensureEnvFile() {
6
7
  if ((0, node_fs_1.lstatSync)(".env", { throwIfNoEntry: false }) === undefined) {
7
8
  (0, node_fs_1.writeFileSync)(".env", "");
9
+ prompts_1.log.info("Created .env");
8
10
  }
9
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ensureGitignore.d.ts","sourceRoot":"","sources":["../../src/helpers/ensureGitignore.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB,4DAC4B,CAAC;AAE5D,wBAAgB,eAAe,SA4B9B"}
1
+ {"version":3,"file":"ensureGitignore.d.ts","sourceRoot":"","sources":["../../src/helpers/ensureGitignore.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB,4DAC4B,CAAC;AAE5D,wBAAgB,eAAe,SA0B9B"}
@@ -24,7 +24,5 @@ function ensureGitignore() {
24
24
  : "\n\n";
25
25
  const block = `${exports.GITIGNORE_SENTINEL}\n${gitignoreEntries_js_1.GITIGNORE_ENTRIES.join("\n")}\n`;
26
26
  (0, node_fs_1.writeFileSync)(path, content + separator + block);
27
- if (stats !== undefined) {
28
- prompts_1.log.info(`Updated ${path}`);
29
- }
27
+ prompts_1.log.info(`${stats === undefined ? "Created" : "Updated"} ${path}`);
30
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ensureReadme.d.ts","sourceRoot":"","sources":["../../src/helpers/ensureReadme.ts"],"names":[],"mappings":"AAIA,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,iBAAiB,GAAE,MAAM,EAAO,QAwDjC"}
1
+ {"version":3,"file":"ensureReadme.d.ts","sourceRoot":"","sources":["../../src/helpers/ensureReadme.ts"],"names":[],"mappings":"AAIA,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,iBAAiB,GAAE,MAAM,EAAO,QA0DjC"}
@@ -23,13 +23,13 @@ function ensureReadme(runtime, installedPackages = []) {
23
23
  ].filter(Boolean);
24
24
  const librarySection = libraryLinks.length === 0
25
25
  ? ""
26
- : `It's installing ${libraryLinks.join(" and ")} libraries, with up-to-date
27
- documentation and AI agent instructions.`;
26
+ : `It has installed ${libraryLinks.join(" and ")} libraries, along with
27
+ up-to-date documentation and AI agent instructions.`;
28
28
  const status = (0, ensureManagedSection_js_1.ensureManagedSection)({
29
29
  path: "README.md",
30
30
  name: "libraries",
31
31
  content: librarySection,
32
- createContent: (managedSection) => `This repository has been created with
32
+ createContent: (managedSection) => `This repository was created with
33
33
  [setup-data-project](https://github.com/nshiab/setup-data-project/).
34
34
 
35
35
  ${managedSection}
@@ -37,19 +37,22 @@ ${managedSection}
37
37
  Here's the recommended workflow:
38
38
 
39
39
  - Put your raw data in the \`sda/data\` folder. Note that this folder is
40
- gitignored.
40
+ ignored by Git.
41
41
  - Use the \`sda/main.ts\` file to clean and process your raw data. Write the
42
42
  results to the \`sda/output\` folder.
43
43
 
44
44
  When working on your project, use the following command:
45
45
 
46
- - \`${runCommand} sda\` will watch your \`sda/main.ts\` and its dependencies. Everytime
47
- you'll save some changes, the data will be reprocessed.
46
+ - \`${runCommand} sda\` will watch your \`sda/main.ts\` and its dependencies.
47
+ Whenever you save changes, the data will be reprocessed.
48
48
  - \`${runCommand} clean\` will remove cache and temporary files, if present.
49
49
 
50
50
  Have fun!`,
51
51
  });
52
- if (status === "created" || status === "updated") {
52
+ if (status === "created") {
53
+ prompts_1.log.info("Created README.md");
54
+ }
55
+ else if (status === "updated") {
53
56
  prompts_1.log.info("Updated README.md");
54
57
  }
55
58
  }