@treelocator/init 0.2.0 → 0.3.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 (3) hide show
  1. package/dist/index.js +20 -11
  2. package/package.json +2 -2
  3. package/LICENSE +0 -22
package/dist/index.js CHANGED
@@ -443,7 +443,7 @@ async function runCheck(info) {
443
443
  const isOk = printCheckResults(results);
444
444
  process.exit(isOk ? 0 : 1);
445
445
  }
446
- async function runSetup(info) {
446
+ async function runSetup(info, skipConfirm = false) {
447
447
  console.log(pc.bold(pc.cyan("\n TreeLocatorJS Setup Wizard\n")));
448
448
  console.log(pc.dim("Detected:"));
449
449
  console.log(pc.dim(` Package manager: ${info.packageManager}`));
@@ -460,15 +460,19 @@ async function runSetup(info) {
460
460
  console.log(pc.red("Could not detect framework."));
461
461
  process.exit(1);
462
462
  }
463
- const { confirm } = await prompts({
464
- type: "confirm",
465
- name: "confirm",
466
- message: "Install and configure TreeLocatorJS?",
467
- initial: true
468
- });
469
- if (!confirm) {
470
- console.log(pc.dim("Cancelled."));
471
- process.exit(0);
463
+ if (!skipConfirm) {
464
+ const { confirm } = await prompts({
465
+ type: "confirm",
466
+ name: "confirm",
467
+ message: "Install and configure TreeLocatorJS?",
468
+ initial: true
469
+ });
470
+ if (!confirm) {
471
+ console.log(pc.dim("Cancelled."));
472
+ process.exit(0);
473
+ }
474
+ } else {
475
+ console.log(pc.green("Running in non-interactive mode, proceeding with installation..."));
472
476
  }
473
477
  const packages = ["@treelocator/runtime"];
474
478
  if (info.buildTool === "vite") {
@@ -515,6 +519,7 @@ async function main() {
515
519
  const args = process.argv.slice(2);
516
520
  const isCheck = args.includes("--check") || args.includes("-c") || args.includes("check");
517
521
  const isHelp = args.includes("--help") || args.includes("-h") || args.includes("help");
522
+ const isYes = args.includes("--yes") || args.includes("-y") || process.env.TREELOCATOR_AUTO_CONFIRM === "1";
518
523
  if (isHelp) {
519
524
  console.log(`
520
525
  ${pc.bold(pc.cyan("TreeLocatorJS Setup"))}
@@ -526,8 +531,12 @@ ${pc.bold("Usage:")}
526
531
 
527
532
  ${pc.bold("Options:")}
528
533
  --check, -c, check Verify existing configuration without making changes
534
+ --yes, -y Skip confirmation prompt (non-interactive mode)
529
535
  --help, -h, help Show this help message
530
536
 
537
+ ${pc.bold("Environment Variables:")}
538
+ TREELOCATOR_AUTO_CONFIRM=1 Skip confirmation prompt (same as --yes)
539
+
531
540
  ${pc.bold("What it checks:")}
532
541
  \u2022 @treelocator/runtime package is installed
533
542
  \u2022 @locator/babel-jsx (Vite) or @locator/webpack-loader (Next.js) is installed
@@ -540,7 +549,7 @@ ${pc.bold("What it checks:")}
540
549
  if (isCheck) {
541
550
  await runCheck(info);
542
551
  } else {
543
- await runSetup(info);
552
+ await runSetup(info, isYes);
544
553
  }
545
554
  }
546
555
  main().catch(console.error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treelocator/init",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Setup wizard for TreeLocatorJS - auto-configure component ancestry tracking",
5
5
  "bin": {
6
6
  "treelocatorjs": "./dist/index.js",
@@ -48,5 +48,5 @@
48
48
  "component-ancestry"
49
49
  ],
50
50
  "license": "MIT",
51
- "gitHead": "5d53daa18f4fef5e815c3fd281b899608f8673ea"
51
+ "gitHead": "afc8a534284e818665bb4d03b7fa940ec5ad5880"
52
52
  }
package/LICENSE DELETED
@@ -1,22 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Krzysztof Wende
4
- Copyright (c) 2023 Michael Musil (original LocatorJS)
5
-
6
- Permission is hereby granted, free of charge, to any person obtaining a copy
7
- of this software and associated documentation files (the "Software"), to deal
8
- in the Software without restriction, including without limitation the rights
9
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- copies of the Software, and to permit persons to whom the Software is
11
- furnished to do so, subject to the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be included in all
14
- copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- SOFTWARE.