juisy 3.0.0-beta.3 → 3.0.0-beta.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.
Files changed (36) hide show
  1. package/LICENSE +661 -661
  2. package/README.md +25 -12
  3. package/bin/cli/cli.js +28 -28
  4. package/bin/cli/cmds/index.js +11 -11
  5. package/bin/cli/cmds/public/print-globals.js +27 -27
  6. package/bin/cli/index.js +9 -9
  7. package/bin/scripts/prepare.js +22 -22
  8. package/dist/DataExporter.d.ts +133 -34
  9. package/dist/ReadmeTemplater-DobSI9Um.js +373 -0
  10. package/dist/bootstrap.d.ts +11 -3
  11. package/dist/bootstrap.js +15 -11
  12. package/dist/cli/Command.d.ts +4 -4
  13. package/dist/cli/OutputUtils.d.ts +1 -1
  14. package/dist/cli/cache-dir.d.ts +15 -0
  15. package/dist/cli/index.js +341 -148
  16. package/dist/cli/plugins/register-changelog-command/augment.d.ts +52 -34
  17. package/dist/cli/plugins/register-changelog-command/resolve-changelog-options.d.ts +19 -0
  18. package/dist/cli/plugins/register-release-command/build-temp-config.d.ts +13 -0
  19. package/dist/cli/plugins/register-release-command/release-args.d.ts +7 -0
  20. package/dist/cli/plugins/register-release-command/resolve-release-config.d.ts +40 -0
  21. package/dist/cli/serialize-cjs-module.d.ts +15 -0
  22. package/dist/cli/types.d.ts +1 -1
  23. package/dist/extensions.d.ts +33 -9
  24. package/dist/extensions.js +87 -20
  25. package/dist/get-package-info-CGDJsCsN.js +15 -0
  26. package/dist/index.d.ts +5 -1
  27. package/dist/index.js +109 -23
  28. package/dist/project-globals.d.ts +8 -2
  29. package/dist/templater/Templater.d.ts +1 -1
  30. package/dist/templater/index.d.ts +2 -2
  31. package/dist/templater/index.js +2 -335
  32. package/dist/templater/markdown-templater/ReadmeTemplater.d.ts +31 -2
  33. package/dist/templater/markdown-templater/index.d.ts +12 -1
  34. package/package.json +24 -29
  35. package/skills/juisy/SKILL.md +97 -0
  36. package/skills/juisy/references/recipes.md +85 -0
package/package.json CHANGED
@@ -1,35 +1,18 @@
1
1
  {
2
2
  "name": "juisy",
3
- "version": "3.0.0-beta.3",
3
+ "version": "3.0.0-beta.4",
4
4
  "description": "Make your JavaScript (and/or TypeScript) project juicy!",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "bin",
8
8
  "dist",
9
9
  "LICENSE",
10
- "README.md"
10
+ "README.md",
11
+ "skills"
11
12
  ],
12
13
  "engines": {
13
14
  "node": ">=20.0.0"
14
15
  },
15
- "imports": {
16
- "#juisy": {
17
- "types": "./dist/index.d.ts",
18
- "import": "./dist/index.js"
19
- },
20
- "#juisy/cli": {
21
- "types": "./dist/cli/index.d.ts",
22
- "import": "./dist/cli/index.js"
23
- },
24
- "#juisy/parser": {
25
- "types": "./dist/templater/index.d.ts",
26
- "import": "./dist/templater/index.js"
27
- },
28
- "#juisy/templater": {
29
- "types": "./dist/templater/index.d.ts",
30
- "import": "./dist/templater/index.js"
31
- }
32
- },
33
16
  "exports": {
34
17
  ".": {
35
18
  "types": "./dist/index.d.ts",
@@ -57,7 +40,9 @@
57
40
  "docs:cli:private": "node ./bin/cli docs generate:cli -c ./docs/cli/private/config.js",
58
41
  "docs:cli:public": "node ./bin/cli docs generate:cli -c ./docs/cli/public/config.js",
59
42
  "release": "release-it --no-increment",
60
- "root:cli": "node ../../bin/cli"
43
+ "root:cli": "node ../../bin/cli",
44
+ "check:exports": "publint .",
45
+ "check:attw": "attw --pack . --profile esm-only --ignore-rules internal-resolution-error"
61
46
  },
62
47
  "repository": {
63
48
  "type": "git",
@@ -90,8 +75,10 @@
90
75
  },
91
76
  "peerDependencies": {
92
77
  "@github/markdownlint-github": "^0.6.3",
93
- "@juisy/utils": "3.0.0-beta.3",
94
- "conventional-changelog-cli": "^5.0.0",
78
+ "@juisy/utils": "3.0.0-beta.4",
79
+ "@release-it/bumper": "^7",
80
+ "@release-it/conventional-changelog": "^11",
81
+ "conventional-changelog": "^8.1.0",
95
82
  "eslint": "^9",
96
83
  "lint-staged": "^14.0.1",
97
84
  "markdownlint-cli2": "^0.12.0",
@@ -113,8 +100,6 @@
113
100
  },
114
101
  "devDependencies": {
115
102
  "@conventional-changelog/git-client": "^1.0.1",
116
- "@types/conventional-changelog": "^3.1.5",
117
- "@types/conventional-changelog-config-spec": "^2.1.5",
118
103
  "@types/ejs": "^3.1.5",
119
104
  "@types/fs-extra": "^11.0.4",
120
105
  "@types/lint-staged": "^13.3.0",
@@ -124,18 +109,21 @@
124
109
  "@types/semver": "^7.5.8",
125
110
  "@types/yargs": "^17.0.33",
126
111
  "@types/yargs-parser": "^21.0.3",
127
- "json-schema-to-ts": "^3.1.1",
128
- "lint-staged": "^14.0.1",
129
112
  "npm-check-updates": "^17.1.12",
130
113
  "quicktype": "^23.0.170"
131
114
  },
132
115
  "dependencies": {
116
+ "juisy": "workspace:*",
133
117
  "@commitlint/cli": "^19.6.1",
134
118
  "@commitlint/config-conventional": "^19.6.0",
135
119
  "@commitlint/types": "^19.8.0",
136
120
  "@dotenvx/dotenvx": "1.32.0",
137
- "@juisy/utils": "3.0.0-beta.3",
121
+ "@juisy/utils": "3.0.0-beta.4",
122
+ "@msgpack/msgpack": "^3.1.3",
138
123
  "ascii-tree": "^0.3.0",
124
+ "avsc": "^5.7.9",
125
+ "bson": "^7.3.4",
126
+ "cbor-x": "^1.6.9",
139
127
  "chalk": "^5.4.1",
140
128
  "conventional-recommended-bump": "^10.0.0",
141
129
  "ejs": "^3.1.10",
@@ -144,12 +132,14 @@
144
132
  "find-up": "^7.0.0",
145
133
  "fs-extra": "^11.2.0",
146
134
  "github-slugger": "^2.0.0",
147
- "globals": "^16",
135
+ "globals": "^17.7.0",
148
136
  "handlebars": "^4.7.8",
149
137
  "import-single-ts": "^1.2.0",
150
138
  "indent-string": "^5.0.0",
151
139
  "json-2-csv": "^5.5.7",
140
+ "json-schema-to-ts": "^3.1.1",
152
141
  "jstoxml": "^5.0.2",
142
+ "lint-staged": "^14.0.1",
153
143
  "lodash.merge": "^4.6.2",
154
144
  "loglevel": "^1.9.2",
155
145
  "markdown-table": "^3.0.4",
@@ -158,11 +148,13 @@
158
148
  "package-json-type": "^1.0.3",
159
149
  "pkg-dir": "^8.0.0",
160
150
  "prompts": "^2.4.2",
151
+ "protobufjs": "^8.8.1",
161
152
  "remark": "^15.0.1",
162
153
  "remark-frontmatter": "^5.0.0",
163
154
  "remark-stringify": "^11.0.0",
164
155
  "remark-toc": "^9.0.0",
165
156
  "semver": "^7.7.1",
157
+ "smol-toml": "^1.9.1",
166
158
  "strip-ansi": "^7.1.0",
167
159
  "strip-indent": "^4.1.1",
168
160
  "typescript": "^5.7.2",
@@ -182,6 +174,9 @@
182
174
  ]
183
175
  }
184
176
  }
177
+ },
178
+ "npm": {
179
+ "publish": false
185
180
  }
186
181
  }
187
182
  }
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: juisy
3
+ description: >-
4
+ Integrates and uses the juisy toolkit for JS/TS project DX: project globals
5
+ (defineGlobals / getProjectGlobals), CLIFactory-based project CLIs, README/CLI
6
+ templaters, lint/git-hooks/changelog/release helpers, and related Vite plugins.
7
+ Use when installing juisy, scaffolding project tooling with create-juisy,
8
+ wiring bin/cli + dev.config.ts, generating docs/README, or automating release
9
+ and lint workflows.
10
+ ---
11
+
12
+ # juisy
13
+
14
+ Portable Agent Skill for **consuming** [`juisy`](https://www.npmjs.com/package/juisy) in an application or library.
15
+
16
+ This skill follows the [Agent Skills](https://agentskills.io) standard. After installing the package, sync skills with:
17
+
18
+ ```sh
19
+ npx skills experimental_sync -y
20
+ ```
21
+
22
+ ## When to use
23
+
24
+ - Project globals shared across Node, Vite, and docs
25
+ - A project CLI built with `CLIFactory` (lint, docs, release, custom commands)
26
+ - README / CLI markdown generation via templaters
27
+ - Conventional commits, lint-staged, markdownlint, release-it via juisy commands
28
+ - **Not** for editing the juisy monorepo itself — use that repo’s `AGENTS.md`
29
+
30
+ ## Install
31
+
32
+ ```sh
33
+ npm install -D juisy
34
+ # peers you actually use, for example:
35
+ npm install -D eslint yargs release-it @juisy/utils
36
+ ```
37
+
38
+ Requires **Node `>=20`**. Optional peers include `release-it`, `@release-it/*`, `markdownlint-cli2`, `lint-staged`, `simple-git-hooks`.
39
+
40
+ Package exports:
41
+
42
+ | Import | Role |
43
+ | ------ | ---- |
44
+ | `juisy` | `defineGlobals`, `getProjectGlobals`, `getPackageInfo`, `DataExporter`, `eject` |
45
+ | `juisy/cli` | `CLIFactory`, `Command`, `Plugin`, `OutputUtils`, `InterfaceUtils`, types |
46
+ | `juisy/templater` | README / markdown templaters |
47
+ | bin `juisy` | Published CLI |
48
+
49
+ Related packages (separate installs): `@juisy/utils`, `@juisy/event-emitter`, `@juisy/ext-build-entries`, `@juisy/vite-plugin-inject-css-variables`, `@juisy/vite-plugin-inject-project-globals`, `create-juisy`.
50
+
51
+ ## Typical project layout
52
+
53
+ | Path | Role |
54
+ | ---- | ---- |
55
+ | `project.globals.js` | `defineGlobals(...)` |
56
+ | `dev.config.ts` | `satisfies GlobalSettings` (changelog, docs, gitHooks, lint, release) |
57
+ | `bin/cli/` | Project CLI entry using `CLIFactory` |
58
+ | `docs/readme/`, `docs/cli/{private,public}/` | Templater configs (generated README / CLI docs; optional `processor` for remark) |
59
+
60
+ Prefer `node ./bin/cli <command>` in npm scripts once a project CLI exists (same pattern as costumejs).
61
+
62
+ ## Quick pointers
63
+
64
+ - **Globals:** `defineGlobals` + static import for types; Vite → `@juisy/vite-plugin-inject-project-globals`.
65
+ - **CLI:** `CLIFactory` in `bin/cli/`; keep built-ins (`lint`, `docs`, `release`, …) unless you replace them.
66
+ - **DataExporter:** text (`json`/`yaml`/…) or binary (`bson`/`msgpack`/…); see Cookbook for schemas.
67
+ - **Config:** `dev.config.ts` with `satisfies GlobalSettings`.
68
+ - **Release:** target release-it v20; temp configs under `node_modules/.cache/juisy/`.
69
+ - **Generated files:** never hand-edit juisy-generated README / `cli*.md` — change templates, regenerate.
70
+
71
+ ## Agent workflow checklist
72
+
73
+ 1. Install `juisy` (+ peers you use) on Node `>=20`.
74
+ 2. Add `project.globals.js` / `dev.config.ts` / `bin/cli` as needed.
75
+ 3. Prefer Cookbook layouts over inventing file trees.
76
+ 4. For richer snippets, open `references/recipes.md` in this skill folder.
77
+
78
+ ## Sync this skill
79
+
80
+ ```sh
81
+ npm install -D juisy
82
+ npx skills experimental_sync -y
83
+ ```
84
+
85
+ In a monorepo of consumers, use `npx skills experimental_sync -r -y` when needed.
86
+
87
+ ## References
88
+
89
+ - Guide: <https://hperchec.gitlab.io/juisy/>
90
+ - What is juisy?: <https://hperchec.gitlab.io/juisy/guide/why.html>
91
+ - Get started: <https://hperchec.gitlab.io/juisy/guide/get-started.html>
92
+ - For AI tools: <https://hperchec.gitlab.io/juisy/guide/for-ai.html>
93
+ - Cookbook: <https://hperchec.gitlab.io/juisy/cookbook/>
94
+ - Extensions: <https://hperchec.gitlab.io/juisy/extensions/how-to-use.html>
95
+ - LLM index: <https://hperchec.gitlab.io/juisy/llms.txt>
96
+ - LLM full bundle: <https://hperchec.gitlab.io/juisy/llms-full.txt>
97
+ - Optional recipes: [references/recipes.md](./references/recipes.md)
@@ -0,0 +1,85 @@
1
+ # Recipes
2
+
3
+ Optional reference loaded on demand by agents using the `juisy` skill. Prefer the online [Cookbook](https://hperchec.gitlab.io/juisy/cookbook/) for end-to-end file layouts.
4
+
5
+ ## Project globals (typed static import)
6
+
7
+ ```js
8
+ // project.globals.js
9
+ import { defineGlobals } from 'juisy'
10
+
11
+ export default defineGlobals(
12
+ { env: { map: [ 'NODE_ENV' ] } },
13
+ ({ env, pkg }) => ({
14
+ BRAND: { NAME: 'My App' }
15
+ })
16
+ )
17
+ ```
18
+
19
+ ```ts
20
+ import PROJECT_GLOBALS from './project.globals.js'
21
+ ```
22
+
23
+ Dynamic load (widened types):
24
+
25
+ ```ts
26
+ import { getProjectGlobals } from 'juisy'
27
+
28
+ const PROJECT_GLOBALS = await getProjectGlobals()
29
+ ```
30
+
31
+ In Vite apps, prefer `@juisy/vite-plugin-inject-project-globals` (`virtual:project.globals.js`).
32
+
33
+ ## Project CLI skeleton
34
+
35
+ ```js
36
+ // bin/cli/cli.js
37
+ import { CLIFactory } from 'juisy/cli'
38
+
39
+ export default await CLIFactory(cli => cli
40
+ .scriptName('./bin/cli')
41
+ .usage('Usage: $0 <command> [<options>]')
42
+ .command(commands)
43
+ .demandCommand(1, 'Command is missing.')
44
+ )
45
+ ```
46
+
47
+ - Global **`CLI`** is injected when importing `juisy/cli`.
48
+ - Extensions: `package.json#juisy.extensions` for the `juisy` bin; project CLIs should `CLIFactory.use(cliPlugin)`.
49
+ - Disable a built-in with `.disableDefaultCommand('docs generate:api')` when you replace it.
50
+
51
+ ## DataExporter
52
+
53
+ | Kind | Formats | Default output |
54
+ | ---- | ------- | -------------- |
55
+ | Text | `json`, `jsonl`, `yaml`, `toml`, `csv`, `tsv`, `xml` | `string` |
56
+ | Binary | `bson`, `msgpack`, `cbor`, `protobuf`, `avro` | `Uint8Array` |
57
+
58
+ ```ts
59
+ import { DataExporter } from 'juisy'
60
+
61
+ new DataExporter('json').exportSync({ hello: 'world' })
62
+ new DataExporter('bson').exportSync({ n: 1 })
63
+ ```
64
+
65
+ `protobuf` / `avro` need a schema. See Cookbook → DataExporter for a full layout.
66
+
67
+ ## Minimal `dev.config.ts`
68
+
69
+ ```ts
70
+ import { type GlobalSettings } from 'juisy/cli'
71
+
72
+ export default {
73
+ changelog: {
74
+ infile: 'CHANGELOG.md',
75
+ preset: 'angular'
76
+ },
77
+ docs: { /* readme / cli paths */ },
78
+ gitHooks: { /* simple-git-hooks map */ },
79
+ lint: { /* eslint / commitlint / markdown / staged */ },
80
+ release: {
81
+ git: { commit: true, tag: true, push: true },
82
+ npm: { publish: false }
83
+ }
84
+ } satisfies GlobalSettings
85
+ ```