fscr 6.2.6 → 7.3.1

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 (72) hide show
  1. package/README.md +48 -30
  2. package/dist/index.js +502 -186
  3. package/dist/lib/auth/auth-conf.js +49 -45
  4. package/dist/lib/cache/README.md +341 -0
  5. package/dist/lib/cache/cli.js +152 -0
  6. package/dist/lib/cache/file-watcher.js +193 -0
  7. package/dist/lib/cache/index.js +422 -0
  8. package/dist/lib/cache/monitor.js +224 -0
  9. package/dist/lib/commands/doctor.js +225 -0
  10. package/dist/lib/completions/completion.js +342 -0
  11. package/dist/lib/completions/generator.js +152 -0
  12. package/dist/lib/completions/scripts/bash.sh +108 -0
  13. package/dist/lib/completions/scripts/fish.sh +105 -0
  14. package/dist/lib/completions/scripts/powershell.ps1 +168 -0
  15. package/dist/lib/completions/scripts/zsh.sh +124 -0
  16. package/dist/lib/diagnostics/cache.js +121 -0
  17. package/dist/lib/diagnostics/fileSystem.js +236 -0
  18. package/dist/lib/diagnostics/gitCheck.js +41 -0
  19. package/dist/lib/diagnostics/nodeVersion.js +68 -0
  20. package/dist/lib/diagnostics/packageManager.js +64 -0
  21. package/dist/lib/diagnostics/performance.js +141 -0
  22. package/dist/lib/encryption/decryptConfig.js +3 -2
  23. package/dist/lib/encryption/encryption.js +153 -113
  24. package/dist/lib/generators/generateFScripts.js +16 -13
  25. package/dist/lib/generators/generateToc.js +23 -14
  26. package/dist/lib/generators/index.js +1 -1
  27. package/dist/lib/git/pub.js +27 -17
  28. package/dist/lib/git/taskRunner.js +79 -69
  29. package/dist/lib/git/validateNotDev.js +65 -54
  30. package/dist/lib/optionList.js +69 -57
  31. package/dist/lib/parsers/parseScriptsMd.cached.js +208 -0
  32. package/dist/lib/parsers/parseScriptsMd.js +88 -79
  33. package/dist/lib/parsers/parseScriptsPackage.js +4 -3
  34. package/dist/lib/performance/cache.js +199 -0
  35. package/dist/lib/performance/lazy-loader.js +189 -0
  36. package/dist/lib/performance/monitor.js +303 -0
  37. package/dist/lib/plugins/deployment/index.js +112 -0
  38. package/dist/lib/plugins/hooks.js +17 -0
  39. package/dist/lib/plugins/loader.js +91 -0
  40. package/dist/lib/plugins/task-notifier/index.js +72 -0
  41. package/dist/lib/release/bump.js +50 -45
  42. package/dist/lib/release/commitWithMessage.js +80 -52
  43. package/dist/lib/release/publish.js +19 -14
  44. package/dist/lib/release/pushToGit.js +40 -31
  45. package/dist/lib/release/releasenotes.js +116 -97
  46. package/dist/lib/release/seeChangedFiles.js +68 -60
  47. package/dist/lib/release/sort.js +200 -116
  48. package/dist/lib/release/tree.js +161 -147
  49. package/dist/lib/release/validateNotDev.js +52 -44
  50. package/dist/lib/running/index.js +1 -1
  51. package/dist/lib/running/runCLICommand.js +41 -31
  52. package/dist/lib/running/runParallel.js +61 -59
  53. package/dist/lib/running/runSequence.js +55 -53
  54. package/dist/lib/startScripts.js +129 -114
  55. package/dist/lib/taskList.js +97 -90
  56. package/dist/lib/test-files/.fscripts.md +113 -0
  57. package/dist/lib/test-files/.fscripts.test.md +103 -0
  58. package/dist/lib/test-files/.fscriptsb.md +107 -0
  59. package/dist/lib/test-files/.mdtest.md +40 -0
  60. package/dist/lib/test-files/consoleSample.js +13 -9
  61. package/dist/lib/test-files/inputSample.js +17 -14
  62. package/dist/lib/test-files/testConsole.js +1 -1
  63. package/dist/lib/test-files/testInput.js +1 -1
  64. package/dist/lib/upgradePackages.js +56 -46
  65. package/dist/lib/utils/clear.js +16 -13
  66. package/dist/lib/utils/console.js +27 -21
  67. package/dist/lib/utils/encryption.js +55 -13
  68. package/dist/lib/utils/hash.js +128 -0
  69. package/dist/lib/utils/helpers.js +153 -142
  70. package/dist/lib/utils/index.js +1 -1
  71. package/dist/lib/utils/prompt.js +24 -29
  72. package/package.json +15 -62
package/README.md CHANGED
@@ -1,53 +1,71 @@
1
- ## The simplest way to run your npm type tasks
1
+ # fsr the Freedcamp Script Runner (`fsr`)
2
2
 
3
- You write a beautiful & documented Markdown file, we run it for you. And you have a lot of flexibility!
3
+ > The simplest way to run your npm‑type tasks. Write a beautiful, documented Markdown file
4
+ > `fsr` runs it for you, with a lot of flexibility.
4
5
 
5
- Example **fscripts.md** file :
6
-
7
- ````markdown
8
- # Group 1
9
-
10
- ## run
6
+ Instead of cramming logic into `package.json` `"scripts"`, you keep an **`fscripts.md`** file
7
+ where every task is a Markdown section: a title, an optional description, and a fenced code
8
+ block. `fsr` parses it and runs the task you pick — interactively or by name.
11
9
 
12
10
  ```bash
13
- echo 'start'; sleep 4; echo 'done'
11
+ npm install -g fsr # gives you the `fsr` and `fsr` commands
12
+ fsr # interactive menu
13
+ fsr run start:web # run a specific task
14
+ fsr list # fuzzy-find any task
14
15
  ```
15
16
 
17
+ ## Example `fscripts.md`
18
+
19
+ ````markdown
20
+ # Start Scripts
16
21
 
17
- ## run:s
22
+ Start running in development mode
18
23
 
19
- ```bash
20
- yarn fsr run-s run:one run:two
21
- ```
24
+ ## start:web
22
25
 
23
- ## run:one
26
+ Boots the web server with hot reload.
24
27
 
25
- ```js
26
- console.log("ONEEE");
28
+ ```bash
29
+ NODE_ENV=development vite
27
30
  ```
28
31
 
29
- ## run:two
32
+ ## say:hello
30
33
 
31
- ```js
32
- console.log("TWOOOO");
34
+ ```javascript
35
+ console.log(`HELLO! ${Date.now()}`);
33
36
  ```
34
37
  ````
35
38
 
36
- Each section is an `h1` and task is defined using `h2` header and its child contents, the value of `h2` header will be used as task name, its following paragraphs (optional) will be used as task description, and following code block (optional) will be used as task script.
39
+ Each `#` heading is a **category**; each `##` heading is a **task** (its title is the task
40
+ name, the paragraph after it is the description, and the following code block is the script).
41
+ ` ```bash ` blocks run as shell commands; ` ```javascript ` blocks run in‑process.
37
42
 
38
- ````markdown
39
- # Start Scripts
43
+ ## Common commands
40
44
 
41
- Start running in development mode
45
+ | Command | What it does |
46
+ |---|---|
47
+ | `fsr` | Interactive top‑level menu |
48
+ | `fsr start` | Pick a category, then a task (recent tasks pinned on top) |
49
+ | `fsr list` | Fuzzy‑autocomplete across all tasks |
50
+ | `fsr run <task>` | Run one task by name |
51
+ | `fsr run-s <a> <b>` | Run tasks **sequentially** |
52
+ | `fsr run-p <a> <b>` | Run tasks **in parallel** |
53
+ | `fsr generate` | Scaffold `sample.fscripts.md` from `package.json` |
54
+ | `fsr toc` | Generate/refresh the table of contents |
55
+ | `fsr doctor` | Environment diagnostics (`--fix` to auto‑fix) |
56
+ | `fsr encryption` | Encrypt/decrypt secret files (AES‑192‑CBC) |
57
+ | `fsr upgrade` / `fsr bump` | Upgrade deps / bump version |
42
58
 
43
- ## start:w:u
59
+ ## 📖 Full documentation
44
60
 
45
- Run tasks `start:web` and `start:utils` in parallel.
61
+ **See [`docs/FSR.md`](./docs/FSR.md) for the complete guide** to the `fscripts.md` format,
62
+ every command and option, configuration, encryption, caching, and shell completions.
46
63
 
47
- ```bash
48
- fsr run-s start:web start:utils
49
- ```
64
+ Other references live in [`docs/`](./docs); historical v7 implementation notes are archived in
65
+ [`docs/archive/`](./docs/archive).
50
66
 
51
- ````
67
+ ---
68
+
69
+ > The sample `config.json` in this repo decrypts with the password **`secret`**.
52
70
 
53
- ## Password for encrypted file is 'secret'
71
+ MIT © Angel Grablev