@nshiab/setup-data-project 2.0.3 → 3.0.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.
Files changed (138) hide show
  1. package/README.md +76 -28
  2. package/dist/main.mjs +849 -0
  3. package/dist/main.mjs.map +1 -0
  4. package/package.json +29 -18
  5. package/esm/_dnt.shims.d.ts +0 -2
  6. package/esm/_dnt.shims.d.ts.map +0 -1
  7. package/esm/_dnt.shims.js +0 -57
  8. package/esm/helpers/combinePlotDocs.d.ts +0 -2
  9. package/esm/helpers/combinePlotDocs.d.ts.map +0 -1
  10. package/esm/helpers/combinePlotDocs.js +0 -111
  11. package/esm/helpers/createFolderStructure.d.ts +0 -2
  12. package/esm/helpers/createFolderStructure.d.ts.map +0 -1
  13. package/esm/helpers/createFolderStructure.js +0 -40
  14. package/esm/helpers/ensureAgents.d.ts +0 -3
  15. package/esm/helpers/ensureAgents.d.ts.map +0 -1
  16. package/esm/helpers/ensureAgents.js +0 -186
  17. package/esm/helpers/ensureEnvFile.d.ts +0 -2
  18. package/esm/helpers/ensureEnvFile.d.ts.map +0 -1
  19. package/esm/helpers/ensureEnvFile.js +0 -8
  20. package/esm/helpers/ensureGitignore.d.ts +0 -3
  21. package/esm/helpers/ensureGitignore.d.ts.map +0 -1
  22. package/esm/helpers/ensureGitignore.js +0 -24
  23. package/esm/helpers/ensureManagedSection.d.ts +0 -9
  24. package/esm/helpers/ensureManagedSection.d.ts.map +0 -1
  25. package/esm/helpers/ensureManagedSection.js +0 -33
  26. package/esm/helpers/ensureReadme.d.ts +0 -2
  27. package/esm/helpers/ensureReadme.d.ts.map +0 -1
  28. package/esm/helpers/ensureReadme.js +0 -61
  29. package/esm/helpers/fetchPackageDocs.d.ts +0 -12
  30. package/esm/helpers/fetchPackageDocs.d.ts.map +0 -1
  31. package/esm/helpers/fetchPackageDocs.js +0 -75
  32. package/esm/helpers/fetchPlotDocs.d.ts +0 -5
  33. package/esm/helpers/fetchPlotDocs.d.ts.map +0 -1
  34. package/esm/helpers/fetchPlotDocs.js +0 -103
  35. package/esm/helpers/getInstalledPackageVersions.d.ts +0 -2
  36. package/esm/helpers/getInstalledPackageVersions.d.ts.map +0 -1
  37. package/esm/helpers/getInstalledPackageVersions.js +0 -94
  38. package/esm/helpers/getProjectTasks.d.ts +0 -6
  39. package/esm/helpers/getProjectTasks.d.ts.map +0 -1
  40. package/esm/helpers/getProjectTasks.js +0 -17
  41. package/esm/helpers/getRuntime.d.ts +0 -5
  42. package/esm/helpers/getRuntime.d.ts.map +0 -1
  43. package/esm/helpers/getRuntime.js +0 -19
  44. package/esm/helpers/gitignoreEntries.d.ts +0 -2
  45. package/esm/helpers/gitignoreEntries.d.ts.map +0 -1
  46. package/esm/helpers/gitignoreEntries.js +0 -10
  47. package/esm/helpers/installPackages.d.ts +0 -7
  48. package/esm/helpers/installPackages.d.ts.map +0 -1
  49. package/esm/helpers/installPackages.js +0 -49
  50. package/esm/helpers/packageOptions.d.ts +0 -6
  51. package/esm/helpers/packageOptions.d.ts.map +0 -1
  52. package/esm/helpers/packageOptions.js +0 -6
  53. package/esm/helpers/packageRegistry.d.ts +0 -10
  54. package/esm/helpers/packageRegistry.d.ts.map +0 -1
  55. package/esm/helpers/packageRegistry.js +0 -89
  56. package/esm/helpers/parseArguments.d.ts +0 -7
  57. package/esm/helpers/parseArguments.d.ts.map +0 -1
  58. package/esm/helpers/parseArguments.js +0 -30
  59. package/esm/helpers/plotDocPages.d.ts +0 -2
  60. package/esm/helpers/plotDocPages.d.ts.map +0 -1
  61. package/esm/helpers/plotDocPages.js +0 -46
  62. package/esm/helpers/projectManifest.d.ts +0 -12
  63. package/esm/helpers/projectManifest.d.ts.map +0 -1
  64. package/esm/helpers/projectManifest.js +0 -80
  65. package/esm/helpers/syncPackageDocs.d.ts +0 -3
  66. package/esm/helpers/syncPackageDocs.d.ts.map +0 -1
  67. package/esm/helpers/syncPackageDocs.js +0 -50
  68. package/esm/main.d.ts +0 -3
  69. package/esm/main.d.ts.map +0 -1
  70. package/esm/main.js +0 -104
  71. package/esm/package.json +0 -3
  72. package/script/_dnt.shims.d.ts +0 -2
  73. package/script/_dnt.shims.d.ts.map +0 -1
  74. package/script/_dnt.shims.js +0 -60
  75. package/script/helpers/combinePlotDocs.d.ts +0 -2
  76. package/script/helpers/combinePlotDocs.d.ts.map +0 -1
  77. package/script/helpers/combinePlotDocs.js +0 -114
  78. package/script/helpers/createFolderStructure.d.ts +0 -2
  79. package/script/helpers/createFolderStructure.d.ts.map +0 -1
  80. package/script/helpers/createFolderStructure.js +0 -43
  81. package/script/helpers/ensureAgents.d.ts +0 -3
  82. package/script/helpers/ensureAgents.d.ts.map +0 -1
  83. package/script/helpers/ensureAgents.js +0 -189
  84. package/script/helpers/ensureEnvFile.d.ts +0 -2
  85. package/script/helpers/ensureEnvFile.d.ts.map +0 -1
  86. package/script/helpers/ensureEnvFile.js +0 -11
  87. package/script/helpers/ensureGitignore.d.ts +0 -3
  88. package/script/helpers/ensureGitignore.d.ts.map +0 -1
  89. package/script/helpers/ensureGitignore.js +0 -28
  90. package/script/helpers/ensureManagedSection.d.ts +0 -9
  91. package/script/helpers/ensureManagedSection.d.ts.map +0 -1
  92. package/script/helpers/ensureManagedSection.js +0 -36
  93. package/script/helpers/ensureReadme.d.ts +0 -2
  94. package/script/helpers/ensureReadme.d.ts.map +0 -1
  95. package/script/helpers/ensureReadme.js +0 -64
  96. package/script/helpers/fetchPackageDocs.d.ts +0 -12
  97. package/script/helpers/fetchPackageDocs.d.ts.map +0 -1
  98. package/script/helpers/fetchPackageDocs.js +0 -78
  99. package/script/helpers/fetchPlotDocs.d.ts +0 -5
  100. package/script/helpers/fetchPlotDocs.d.ts.map +0 -1
  101. package/script/helpers/fetchPlotDocs.js +0 -106
  102. package/script/helpers/getInstalledPackageVersions.d.ts +0 -2
  103. package/script/helpers/getInstalledPackageVersions.d.ts.map +0 -1
  104. package/script/helpers/getInstalledPackageVersions.js +0 -97
  105. package/script/helpers/getProjectTasks.d.ts +0 -6
  106. package/script/helpers/getProjectTasks.d.ts.map +0 -1
  107. package/script/helpers/getProjectTasks.js +0 -20
  108. package/script/helpers/getRuntime.d.ts +0 -5
  109. package/script/helpers/getRuntime.d.ts.map +0 -1
  110. package/script/helpers/getRuntime.js +0 -59
  111. package/script/helpers/gitignoreEntries.d.ts +0 -2
  112. package/script/helpers/gitignoreEntries.d.ts.map +0 -1
  113. package/script/helpers/gitignoreEntries.js +0 -13
  114. package/script/helpers/installPackages.d.ts +0 -7
  115. package/script/helpers/installPackages.d.ts.map +0 -1
  116. package/script/helpers/installPackages.js +0 -86
  117. package/script/helpers/packageOptions.d.ts +0 -6
  118. package/script/helpers/packageOptions.d.ts.map +0 -1
  119. package/script/helpers/packageOptions.js +0 -9
  120. package/script/helpers/packageRegistry.d.ts +0 -10
  121. package/script/helpers/packageRegistry.d.ts.map +0 -1
  122. package/script/helpers/packageRegistry.js +0 -93
  123. package/script/helpers/parseArguments.d.ts +0 -7
  124. package/script/helpers/parseArguments.d.ts.map +0 -1
  125. package/script/helpers/parseArguments.js +0 -34
  126. package/script/helpers/plotDocPages.d.ts +0 -2
  127. package/script/helpers/plotDocPages.d.ts.map +0 -1
  128. package/script/helpers/plotDocPages.js +0 -49
  129. package/script/helpers/projectManifest.d.ts +0 -12
  130. package/script/helpers/projectManifest.d.ts.map +0 -1
  131. package/script/helpers/projectManifest.js +0 -84
  132. package/script/helpers/syncPackageDocs.d.ts +0 -3
  133. package/script/helpers/syncPackageDocs.d.ts.map +0 -1
  134. package/script/helpers/syncPackageDocs.js +0 -53
  135. package/script/main.d.ts +0 -3
  136. package/script/main.d.ts.map +0 -1
  137. package/script/main.js +0 -109
  138. package/script/package.json +0 -3
package/README.md CHANGED
@@ -1,42 +1,90 @@
1
1
  # setup-data-project
2
2
 
3
- A CLI tool to quickly set up a data project with essential folders,
4
- configurations, and documentation.
3
+ Set up a TypeScript data analysis project with Node.js or Bun.
4
+ Generated development commands use the selected runtime.
5
5
 
6
- ```sh
7
- # Deno
8
- deno run -A jsr:@nshiab/setup-data-project
6
+ The library is maintained by [Nael Shiab](https://naelshiab.com/), computational
7
+ journalist and senior data producer for [CBC News](https://www.cbc.ca/news).
8
+
9
+ > [!TIP]
10
+ > To learn how to use these libraries and more, check out
11
+ > [Code Like a Journalist](https://www.code-like-a-journalist.com/), a free and
12
+ > open-source data analysis and data visualization course in TypeScript.
9
13
 
14
+ ```sh
10
15
  # Node
11
16
  npx @nshiab/setup-data-project
12
17
 
13
18
  # Bun
14
- bunx @nshiab/setup-data-project
19
+ bunx --bun @nshiab/setup-data-project
15
20
  ```
16
21
 
17
- To select a library without prompts, add `--sda` or `--sda-core`:
22
+ The CLI uses the runtime that launches it. Its executable has a Node shebang,
23
+ so use `bunx --bun` to explicitly run it with Bun.
24
+
25
+ Select libraries interactively, or combine library flags to install without prompts:
18
26
 
19
27
  ```sh
20
- deno run -A jsr:@nshiab/setup-data-project --sda
21
- npx @nshiab/setup-data-project --sda-core
22
- bunx @nshiab/setup-data-project --sda
28
+ npx @nshiab/setup-data-project --sda
29
+ npx @nshiab/setup-data-project --format --geo --dataviz
30
+ bunx --bun @nshiab/setup-data-project --sda-core --ai
23
31
  ```
24
32
 
25
- These flags still create the usual project files and documentation, preserve
26
- existing package versions, and cannot be combined. Without a flag, library
27
- selection is interactive. Use `--help` for usage.
28
-
29
- - Creates a standardized folder structure.
30
- - Ensures necessary files like `.env`, `.gitignore`, and `README.md` exist.
31
- - Lets you choose between
32
- [simple-data-analysis-core](https://github.com/nshiab/simple-data-analysis-core),
33
- the full
34
- [simple-data-analysis](https://github.com/nshiab/simple-data-analysis/)
35
- package, and [journalism](https://github.com/nshiab/journalism) libraries.
36
- - Downloads version-matched library documentation for LLM use and links it from
37
- `AGENTS.md`.
38
- - Updates project configuration (e.g., `deno.json` or `package.json`) with
39
- relevant tasks.
40
-
41
- The library is maintained by [Nael Shiab](http://naelshiab.com/), computational
42
- journalist and senior data producer for [CBC News](https://www.cbc.ca/news).
33
+ Available library flags:
34
+
35
+ - `--sda`: [simple-data-analysis](https://github.com/nshiab/simple-data-analysis)
36
+ - `--sda-core`: [simple-data-analysis-core](https://github.com/nshiab/simple-data-analysis-core)
37
+ - `--ai`: [journalism-ai](https://github.com/nshiab/journalism-ai)
38
+ - `--google`: [journalism-google](https://github.com/nshiab/journalism-google)
39
+ - `--web-scraping`: [journalism-web-scraping](https://github.com/nshiab/journalism-web-scraping)
40
+ - `--finance`: [journalism-finance](https://github.com/nshiab/journalism-finance)
41
+ - `--format`: [journalism-format](https://github.com/nshiab/journalism-format)
42
+ - `--climate`: [journalism-climate](https://github.com/nshiab/journalism-climate)
43
+ - `--dataviz`: [journalism-dataviz](https://github.com/nshiab/journalism-dataviz)
44
+ - `--geo`: [journalism-geo](https://github.com/nshiab/journalism-geo)
45
+ - `--statistics`: [journalism-statistics](https://github.com/nshiab/journalism-statistics)
46
+ - `--web`: [journalism-web](https://github.com/nshiab/journalism-web)
47
+ - `--extras`: [journalism-extras](https://github.com/nshiab/journalism-extras)
48
+
49
+ Run `--help` for usage.
50
+ Library flags keep existing dependency versions and cannot be combined with `--docs`.
51
+
52
+ The project includes `sda/main.ts`, helpers, tests, data and output folders,
53
+ `.env`, `.gitignore`, and managed sections in README.md and AGENTS.md.
54
+ Existing source files, environment values, scripts, tooling configuration,
55
+ and unmanaged documentation are preserved.
56
+
57
+ Generated projects run TypeScript directly with Node or Bun. Vite+ provides
58
+ formatting, linting, type checking, and Vitest tests. Use `npm run sda`,
59
+ `npm run all-tests`, and `npm run fix` (or `bun run` for Bun projects).
60
+ Existing test commands remain in place.
61
+ New development tools are installed at their latest versions; existing dependencies
62
+ are preserved.
63
+
64
+ VS Code configuration recommends the Vite+ extension pack and enables formatting,
65
+ lint fixes on save, and visual line wrapping. Existing `.vscode/extensions.json`
66
+ and `.vscode/settings.json` files are left unchanged.
67
+
68
+ Documentation is downloaded automatically for the exact installed library
69
+ versions. Each library's release archive preserves its README, license,
70
+ `llms.txt` index, granular API pages, and media under `docs/<library>/`.
71
+ Observable Plot uses its version-matched source documentation or cached reference.
72
+ The generated `docs/` folder is ignored by Git.
73
+
74
+ After cloning or changing dependencies, run `npm run docs` or `bun run docs`.
75
+ You can also refresh documentation directly:
76
+
77
+ ```sh
78
+ npx @nshiab/setup-data-project --docs
79
+ bunx --bun @nshiab/setup-data-project --docs
80
+ ```
81
+
82
+ `--docs` requires installed dependencies and only refreshes documentation. It
83
+ runs no prompts or installs and leaves project configuration unchanged.
84
+ Failed downloads preserve previous files, warn that they may be stale, and
85
+ exit unsuccessfully. Generated docs scripts pin the setup CLI version that
86
+ created them. Use `--help` for usage.
87
+
88
+ For development, use `npm ci` and `npm run all-tests`.
89
+ `npx vp pack` produces the npm executable. Releases use `npm run patch`,
90
+ `npm run minor`, or `npm run major` from main; GitHub Actions publishes to npm.