@sakana-y/vue-grab-cli 0.1.1 → 0.1.2

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/CHANGELOG.md ADDED
@@ -0,0 +1,34 @@
1
+ # @sakana-y/vue-grab-cli
2
+
3
+ ## 0.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#38](https://github.com/SaKaNa-Y/vue-grab/pull/38) [`a90677f`](https://github.com/SaKaNa-Y/vue-grab/commit/a90677f19389bb7875ca54164e4554830f80a2d7) Thanks [@SaKaNa-Y](https://github.com/SaKaNa-Y)! - Hide beta toolbar entries by default and label Magnifier, Logs, and Network as Beta in Dock settings.
8
+
9
+ - [#38](https://github.com/SaKaNa-Y/vue-grab/pull/38) [`a90677f`](https://github.com/SaKaNa-Y/vue-grab/commit/a90677f19389bb7875ca54164e4554830f80a2d7) Thanks [@SaKaNa-Y](https://github.com/SaKaNa-Y)! - Add package README, license, and npm metadata so published package pages show documentation and project links.
10
+
11
+ ## 0.1.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [#30](https://github.com/SaKaNa-Y/vue-grab/pull/30) [`33772ce`](https://github.com/SaKaNa-Y/vue-grab/commit/33772ce81dc425d3f9a93d43faf1f809ff45c2a4) Thanks [@SaKaNa-Y](https://github.com/SaKaNa-Y)! - Implement `vue-grab init` for Vite + Vue projects with safe setup edits, dependency installation, dry-run support, and Vite plugin wiring.
16
+
17
+ ## 0.1.0
18
+
19
+ ### Minor Changes
20
+
21
+ - [#21](https://github.com/SaKaNa-Y/vue-grab/pull/21) [`6df5750`](https://github.com/SaKaNa-Y/vue-grab/commit/6df5750f22dc975340180c22a656294a4d85291d) Thanks [@SaKaNa-Y](https://github.com/SaKaNa-Y)! - Rename `errorCapture` → `consoleCapture` and broaden capture from `console.error` only to all five console levels (`log`, `info`, `warn`, `error`, `debug`). The FloatingButton panel now surfaces every captured entry with per-level filter pills and a message search input; the badge counts only `warn` + `error` entries to keep it actionable.
22
+
23
+ Breaking changes — no backwards-compatible aliases:
24
+ - Config key `errorCapture` → `consoleCapture`.
25
+ - Type `ErrorCaptureConfig` → `ConsoleCaptureConfig`:
26
+ - `maxErrors` (default 50) → `maxEntries` (default 200).
27
+ - `captureConsoleError: boolean` replaced by `levels: LogLevel[]` (default is all five levels enabled). The levels array is replaced wholesale by `mergeConfig`, not element-merged.
28
+ - `captureUnhandled` and `captureVueErrors` retained with identical semantics.
29
+ - Type `CapturedError` → `CapturedLog`. The single `type` field is replaced with two axes: `level: "log" | "info" | "warn" | "error" | "debug"` and `source: "console" | "runtime" | "promise" | "vue"`. Runtime/promise/Vue entries always carry `level: "error"`.
30
+ - Constant `VUE_ERROR_EVENT` retained (the underlying window-event string `"vue-grab:vue-error"` is unchanged).
31
+ - Standalone `init()` API: `onError` / `clearErrors` → `onLog` / `clearLogs`.
32
+ - FloatingButton methods: `setErrors` / `onErrorsClear` → `setLogs` / `onLogsClear` (internal, only affects code that imports `FloatingButton` directly).
33
+ - Dedup fingerprint now includes `source` and `level`, so the same message at different levels or from different sources produces distinct entries.
34
+ - Arguments passed to `console.*` are now stringified at capture time via a safe stringifier that handles circular references, Error instances (preserving `.stack`), and truncates very long values.
package/README.md ADDED
@@ -0,0 +1,60 @@
1
+ # Vue Grab CLI
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@sakana-y/vue-grab-cli)](https://www.npmjs.com/package/@sakana-y/vue-grab-cli)
4
+ [![license](https://img.shields.io/npm/l/@sakana-y/vue-grab-cli)](./LICENSE)
5
+
6
+ CLI setup tool for adding Vue Grab to Vite and Vue projects.
7
+
8
+ `vue-grab init` installs `@sakana-y/vue-grab`, wires the Vue runtime plugin into your app entry, and adds the Vite editor companion plugin when it can safely update your project.
9
+
10
+ ## Usage
11
+
12
+ ```bash
13
+ npx @sakana-y/vue-grab-cli init
14
+ ```
15
+
16
+ Preview the planned changes without editing files:
17
+
18
+ ```bash
19
+ npx @sakana-y/vue-grab-cli init --dry-run
20
+ ```
21
+
22
+ Run non-interactively:
23
+
24
+ ```bash
25
+ npx @sakana-y/vue-grab-cli init --yes
26
+ ```
27
+
28
+ Skip dependency installation when you want to manage dependencies yourself:
29
+
30
+ ```bash
31
+ npx @sakana-y/vue-grab-cli init --skip-install
32
+ ```
33
+
34
+ ## What It Does
35
+
36
+ - Detects the package manager from lockfiles.
37
+ - Adds `@sakana-y/vue-grab` as a development dependency.
38
+ - Updates the Vue app entry to install `createVueGrab()`.
39
+ - Updates Vite config to use `vueGrabPlugin()` from `@sakana-y/vue-grab/vite`.
40
+ - Avoids duplicate setup when Vue Grab is already configured.
41
+ - Supports dry-run output before any file edits.
42
+
43
+ ## Supported Package Managers
44
+
45
+ - pnpm
46
+ - npm
47
+ - yarn
48
+ - bun
49
+
50
+ ## Related Packages
51
+
52
+ - `@sakana-y/vue-grab`: Vue plugin, runtime APIs, and Vite integration.
53
+ - `@sakana-y/vue-grab-shared`: Shared types, defaults, config merging, and protocol constants.
54
+
55
+ ## Links
56
+
57
+ - Repository: https://github.com/SaKaNa-Y/vue-grab
58
+ - Issues: https://github.com/SaKaNa-Y/vue-grab/issues
59
+ - Changelog: ./CHANGELOG.md
60
+ - License: ./LICENSE
package/dist/bin.cjs CHANGED
@@ -6,4 +6,4 @@ require(`./init-BNCDwtX-.cjs`);let e=require(`events`);function t(e){return e==n
6
6
  `)}),i&&(a=i(a)||a),console.log(a.map(e=>e.title?`${e.title}:
7
7
  ${e.body}`:e.body).join(`
8
8
 
9
- `))}outputVersion(){let{name:e}=this.cli,{versionNumber:t}=this.cli.globalCommand;t&&console.log(`${e}/${t} ${_}`)}checkRequiredArgs(){let e=this.args.filter(e=>e.required).length;if(this.cli.args.length<e)throw new m(`missing required args for command \`${this.rawName}\``)}checkUnknownOptions(){let{options:e,globalCommand:t}=this.cli;if(!this.config.allowUnknownOptions){for(let n of Object.keys(e))if(n!==`--`&&!this.hasOption(n)&&!t.hasOption(n))throw new m(`Unknown option \`${n.length>1?`--${n}`:`-${n}`}\``)}}checkOptionValue(){let{options:e,globalCommand:t}=this.cli,n=[...t.options,...this.options];for(let t of n){let r=e[t.name.split(`.`)[0]];if(t.required){let e=n.some(e=>e.negated&&e.names.includes(t.name));if(r===!0||r===!1&&!e)throw new m(`option \`${t.rawName}\` value is missing`)}}}},y=class extends v{constructor(e){super(`@@global@@`,``,{},e)}},b=Object.assign,x=class extends e.EventEmitter{constructor(e=``){super(),this.name=e,this.commands=[],this.rawArgs=[],this.args=[],this.options={},this.globalCommand=new y(this),this.globalCommand.usage(`<command> [options]`)}usage(e){return this.globalCommand.usage(e),this}command(e,t,n){let r=new v(e,t||``,n,this);return r.globalCommand=this.globalCommand,this.commands.push(r),r}option(e,t,n){return this.globalCommand.option(e,t,n),this}help(e){return this.globalCommand.option(`-h, --help`,`Display this message`),this.globalCommand.helpCallback=e,this.showHelpOnExit=!0,this}version(e,t=`-v, --version`){return this.globalCommand.version(e,t),this.showVersionOnExit=!0,this}example(e){return this.globalCommand.example(e),this}outputHelp(){this.matchedCommand?this.matchedCommand.outputHelp():this.globalCommand.outputHelp()}outputVersion(){this.globalCommand.outputVersion()}setParsedInfo({args:e,options:t},n,r){return this.args=e,this.options=t,n&&(this.matchedCommand=n),r&&(this.matchedCommandName=r),this}unsetMatchedCommand(){this.matchedCommand=void 0,this.matchedCommandName=void 0}parse(e=g,{run:t=!0}={}){this.rawArgs=e,this.name||=e[1]?f(e[1]):`cli`;let n=!0;for(let t of this.commands){let r=this.mri(e.slice(2),t),i=r.args[0];if(t.isMatched(i)){n=!1;let e=b(b({},r),{args:r.args.slice(1)});this.setParsedInfo(e,t,i),this.emit(`command:${i}`,t)}}if(n){for(let t of this.commands)if(t.name===``){n=!1;let r=this.mri(e.slice(2),t);this.setParsedInfo(r,t),this.emit(`command:!`,t)}}if(n){let t=this.mri(e.slice(2));this.setParsedInfo(t)}this.options.help&&this.showHelpOnExit&&(this.outputHelp(),t=!1,this.unsetMatchedCommand()),this.options.version&&this.showVersionOnExit&&this.matchedCommandName==null&&(this.outputVersion(),t=!1,this.unsetMatchedCommand());let r={args:this.args,options:this.options};return t&&this.runMatchedCommand(),!this.matchedCommand&&this.args[0]&&this.emit(`command:*`),r}mri(e,t){let n=[...this.globalCommand.options,...t?t.options:[]],i=o(n),a=[],s=e.indexOf(`--`);s>-1&&(a=e.slice(s+1),e=e.slice(0,s));let c=r(e,i);c=Object.keys(c).reduce((e,t)=>b(b({},e),{[p(t)]:c[t]}),{_:[]});let l=c._,f={"--":a},m=t&&t.config.ignoreOptionDefaultValue?t.config.ignoreOptionDefaultValue:this.globalCommand.config.ignoreOptionDefaultValue,h=Object.create(null);for(let e of n){if(!m&&e.config.default!==void 0)for(let t of e.names)f[t]=e.config.default;Array.isArray(e.config.type)&&h[e.name]===void 0&&(h[e.name]=Object.create(null),h[e.name].shouldTransform=!0,h[e.name].transformFunction=e.config.type[0])}for(let e of Object.keys(c))e!==`_`&&(u(f,e.split(`.`),c[e]),d(f,h));return{args:l,options:f}}runMatchedCommand(){let{args:e,options:t,matchedCommand:n}=this;if(!n||!n.commandAction)return;n.checkUnknownOptions(),n.checkOptionValue(),n.checkRequiredArgs();let r=[];return n.args.forEach((t,n)=>{t.variadic?r.push(e.slice(n)):r.push(e[n])}),r.push(t),n.commandAction.apply(this,r)}},S=(e=``)=>new x(e),C=`0.1.1`,w=S(`vue-grab`);w.command(`init`,`Initialize vue-grab in your project`).option(`-y, --yes`,`Skip prompts and use defaults`).option(`--dry-run`,`Show the planned changes without writing files or installing packages`).option(`--skip-install`,`Do not install @sakana-y/vue-grab`).action(async e=>{try{let{initProject:t}=await Promise.resolve().then(()=>require(`./init-BNCDwtX-.cjs`)).then(e=>e.n),n=await t(e),r=n.main.status===`changed`||n.vite.status===`changed`||n.install.needed&&!n.install.skipped;n.cancelReason===`non-interactive`&&r&&(process.exitCode=1)}catch(e){console.error(e instanceof Error?e.message:String(e)),process.exitCode=1}}),w.help(),w.version(C),w.parse();
9
+ `))}outputVersion(){let{name:e}=this.cli,{versionNumber:t}=this.cli.globalCommand;t&&console.log(`${e}/${t} ${_}`)}checkRequiredArgs(){let e=this.args.filter(e=>e.required).length;if(this.cli.args.length<e)throw new m(`missing required args for command \`${this.rawName}\``)}checkUnknownOptions(){let{options:e,globalCommand:t}=this.cli;if(!this.config.allowUnknownOptions){for(let n of Object.keys(e))if(n!==`--`&&!this.hasOption(n)&&!t.hasOption(n))throw new m(`Unknown option \`${n.length>1?`--${n}`:`-${n}`}\``)}}checkOptionValue(){let{options:e,globalCommand:t}=this.cli,n=[...t.options,...this.options];for(let t of n){let r=e[t.name.split(`.`)[0]];if(t.required){let e=n.some(e=>e.negated&&e.names.includes(t.name));if(r===!0||r===!1&&!e)throw new m(`option \`${t.rawName}\` value is missing`)}}}},y=class extends v{constructor(e){super(`@@global@@`,``,{},e)}},b=Object.assign,x=class extends e.EventEmitter{constructor(e=``){super(),this.name=e,this.commands=[],this.rawArgs=[],this.args=[],this.options={},this.globalCommand=new y(this),this.globalCommand.usage(`<command> [options]`)}usage(e){return this.globalCommand.usage(e),this}command(e,t,n){let r=new v(e,t||``,n,this);return r.globalCommand=this.globalCommand,this.commands.push(r),r}option(e,t,n){return this.globalCommand.option(e,t,n),this}help(e){return this.globalCommand.option(`-h, --help`,`Display this message`),this.globalCommand.helpCallback=e,this.showHelpOnExit=!0,this}version(e,t=`-v, --version`){return this.globalCommand.version(e,t),this.showVersionOnExit=!0,this}example(e){return this.globalCommand.example(e),this}outputHelp(){this.matchedCommand?this.matchedCommand.outputHelp():this.globalCommand.outputHelp()}outputVersion(){this.globalCommand.outputVersion()}setParsedInfo({args:e,options:t},n,r){return this.args=e,this.options=t,n&&(this.matchedCommand=n),r&&(this.matchedCommandName=r),this}unsetMatchedCommand(){this.matchedCommand=void 0,this.matchedCommandName=void 0}parse(e=g,{run:t=!0}={}){this.rawArgs=e,this.name||=e[1]?f(e[1]):`cli`;let n=!0;for(let t of this.commands){let r=this.mri(e.slice(2),t),i=r.args[0];if(t.isMatched(i)){n=!1;let e=b(b({},r),{args:r.args.slice(1)});this.setParsedInfo(e,t,i),this.emit(`command:${i}`,t)}}if(n){for(let t of this.commands)if(t.name===``){n=!1;let r=this.mri(e.slice(2),t);this.setParsedInfo(r,t),this.emit(`command:!`,t)}}if(n){let t=this.mri(e.slice(2));this.setParsedInfo(t)}this.options.help&&this.showHelpOnExit&&(this.outputHelp(),t=!1,this.unsetMatchedCommand()),this.options.version&&this.showVersionOnExit&&this.matchedCommandName==null&&(this.outputVersion(),t=!1,this.unsetMatchedCommand());let r={args:this.args,options:this.options};return t&&this.runMatchedCommand(),!this.matchedCommand&&this.args[0]&&this.emit(`command:*`),r}mri(e,t){let n=[...this.globalCommand.options,...t?t.options:[]],i=o(n),a=[],s=e.indexOf(`--`);s>-1&&(a=e.slice(s+1),e=e.slice(0,s));let c=r(e,i);c=Object.keys(c).reduce((e,t)=>b(b({},e),{[p(t)]:c[t]}),{_:[]});let l=c._,f={"--":a},m=t&&t.config.ignoreOptionDefaultValue?t.config.ignoreOptionDefaultValue:this.globalCommand.config.ignoreOptionDefaultValue,h=Object.create(null);for(let e of n){if(!m&&e.config.default!==void 0)for(let t of e.names)f[t]=e.config.default;Array.isArray(e.config.type)&&h[e.name]===void 0&&(h[e.name]=Object.create(null),h[e.name].shouldTransform=!0,h[e.name].transformFunction=e.config.type[0])}for(let e of Object.keys(c))e!==`_`&&(u(f,e.split(`.`),c[e]),d(f,h));return{args:l,options:f}}runMatchedCommand(){let{args:e,options:t,matchedCommand:n}=this;if(!n||!n.commandAction)return;n.checkUnknownOptions(),n.checkOptionValue(),n.checkRequiredArgs();let r=[];return n.args.forEach((t,n)=>{t.variadic?r.push(e.slice(n)):r.push(e[n])}),r.push(t),n.commandAction.apply(this,r)}},S=(e=``)=>new x(e),C=`0.1.2`,w=S(`vue-grab`);w.command(`init`,`Initialize vue-grab in your project`).option(`-y, --yes`,`Skip prompts and use defaults`).option(`--dry-run`,`Show the planned changes without writing files or installing packages`).option(`--skip-install`,`Do not install @sakana-y/vue-grab`).action(async e=>{try{let{initProject:t}=await Promise.resolve().then(()=>require(`./init-BNCDwtX-.cjs`)).then(e=>e.n),n=await t(e),r=n.main.status===`changed`||n.vite.status===`changed`||n.install.needed&&!n.install.skipped;n.cancelReason===`non-interactive`&&r&&(process.exitCode=1)}catch(e){console.error(e instanceof Error?e.message:String(e)),process.exitCode=1}}),w.help(),w.version(C),w.parse();
package/dist/bin.mjs CHANGED
@@ -270,7 +270,7 @@ ${e.body}` : e.body).join("\n\n"));
270
270
  t.variadic ? r.push(e.slice(n)) : r.push(e[n]);
271
271
  }), r.push(t), n.commandAction.apply(this, r);
272
272
  }
273
- }, S = (e = "") => new x(e), C = "0.1.1", w = S("vue-grab");
273
+ }, S = (e = "") => new x(e), C = "0.1.2", w = S("vue-grab");
274
274
  w.command("init", "Initialize vue-grab in your project").option("-y, --yes", "Skip prompts and use defaults").option("--dry-run", "Show the planned changes without writing files or installing packages").option("--skip-install", "Do not install @sakana-y/vue-grab").action(async (e) => {
275
275
  try {
276
276
  let { initProject: t } = await import("./init-BuQE50ix.js").then((e) => e.n), n = await t(e), r = n.main.status === "changed" || n.vite.status === "changed" || n.install.needed && !n.install.skipped;
package/package.json CHANGED
@@ -1,12 +1,35 @@
1
1
  {
2
2
  "name": "@sakana-y/vue-grab-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "private": false,
5
+ "description": "CLI setup tool for adding Vue Grab to Vite and Vue projects.",
6
+ "keywords": [
7
+ "ai",
8
+ "cli",
9
+ "debugging",
10
+ "devtools",
11
+ "scaffold",
12
+ "vite",
13
+ "vue"
14
+ ],
15
+ "bugs": {
16
+ "url": "https://github.com/SaKaNa-Y/vue-grab/issues"
17
+ },
18
+ "license": "MIT",
19
+ "author": "SaKaNa-Y",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/SaKaNa-Y/vue-grab.git",
23
+ "directory": "packages/cli"
24
+ },
5
25
  "bin": {
6
26
  "vue-grab": "./dist/bin.mjs"
7
27
  },
8
28
  "files": [
9
- "dist"
29
+ "dist",
30
+ "README.md",
31
+ "LICENSE",
32
+ "CHANGELOG.md"
10
33
  ],
11
34
  "type": "module",
12
35
  "main": "./dist/index.cjs",