@larose-ui/cli 0.1.0 → 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.
Files changed (3) hide show
  1. package/README.md +54 -0
  2. package/dist/cli.js +24 -9
  3. package/package.json +11 -6
package/README.md ADDED
@@ -0,0 +1,54 @@
1
+ # @larose-ui/cli
2
+
3
+ > CLI for quality gates, migration, and code generation.
4
+
5
+ Part of **[laRose UI](https://github.com/hamdymohamedak/larose-ui)** — the UI Operating System for modern SaaS applications.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @larose-ui/cli
11
+ # or
12
+ pnpm add @larose-ui/cli
13
+ # or
14
+ yarn add @larose-ui/cli
15
+ ```
16
+
17
+
18
+
19
+ ## Quick start
20
+
21
+ ```tsx
22
+ # After global install or npx:
23
+ larose doctor --ci
24
+ larose migrate --to 1.0.0 --apply
25
+ larose generate feature EmployeeList ./EmployeeList.tsx
26
+ ```
27
+
28
+ ## Features
29
+
30
+ - `larose doctor` — budgets, a11y, contracts, quality scores
31
+ - `larose migrate` — deprecation scan and codemods
32
+ - `larose generate` — form, page, and feature scaffolds
33
+ - `larose release` — monorepo release intelligence
34
+
35
+ ## Related packages
36
+
37
+ | Layer | Packages |
38
+ |-------|----------|
39
+ | Foundation | `@larose-ui/core`, `@larose-ui/tokens`, `@larose-ui/react` |
40
+ | Runtime | `@larose-ui/runtime`, `@larose-ui/network`, `@larose-ui/offline` |
41
+ | Intelligence | `@larose-ui/data`, `@larose-ui/forms`, `@larose-ui/permissions` |
42
+ | Platform | `@larose-ui/observability`, `@larose-ui/enterprise`, `@larose-ui/ai` |
43
+
44
+ ## Documentation
45
+
46
+ - [Monorepo README](https://github.com/hamdymohamedak/larose-ui#readme)
47
+ - [Package docs](https://github.com/hamdymohamedak/larose-ui/blob/main/docs/quality/QUALITY_ENGINE.md)
48
+ - [Architecture](https://github.com/hamdymohamedak/larose-ui/blob/main/docs/architecture/ARCHITECTURE.md)
49
+ - [Roadmap](https://github.com/hamdymohamedak/larose-ui/blob/main/docs/ROADMAP.md)
50
+ - [Report an issue](https://github.com/hamdymohamedak/larose-ui/issues)
51
+
52
+ ## License
53
+
54
+ MIT © [laRose UI](https://github.com/hamdymohamedak/larose-ui)
package/dist/cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  // src/cli.ts
4
4
  import { writeFileSync } from "fs";
5
- import { resolve } from "path";
5
+ import { resolve as resolve2 } from "path";
6
6
 
7
7
  // src/doctor.ts
8
8
  import { readdir as readdir2, readFile as readFile2, stat, writeFile } from "fs/promises";
@@ -730,16 +730,16 @@ function formatVisualRegressionReport(result) {
730
730
 
731
731
  // src/doctor.ts
732
732
  var BUNDLE_BUDGETS_KB = {
733
- "@larose-ui/core": 10,
734
- "@larose-ui/tokens": 5,
733
+ "@larose-ui/core": 15,
734
+ "@larose-ui/tokens": 65,
735
735
  "@larose-ui/network": 6,
736
736
  "@larose-ui/offline": 5,
737
737
  "@larose-ui/permissions": 8,
738
738
  "@larose-ui/data": 15,
739
739
  "@larose-ui/forms": 10,
740
- "@larose-ui/react": 70,
741
- "@larose-ui/runtime": 36,
742
- "@larose-ui/observability": 26,
740
+ "@larose-ui/react": 460,
741
+ "@larose-ui/runtime": 40,
742
+ "@larose-ui/observability": 28,
743
743
  "@larose-ui/contracts": 5,
744
744
  "@larose-ui/migration": 14,
745
745
  "@larose-ui/testing": 10,
@@ -1099,10 +1099,24 @@ async function runRelease(rootDir2, json = false) {
1099
1099
  return { output, ready };
1100
1100
  }
1101
1101
 
1102
+ // src/pathSafety.ts
1103
+ import { resolve, sep } from "path";
1104
+ function resolveSafePath(rootDir2, targetPath) {
1105
+ const root = resolve(rootDir2);
1106
+ const resolved = resolve(root, targetPath);
1107
+ if (resolved === root) {
1108
+ return resolved;
1109
+ }
1110
+ if (!resolved.startsWith(root + sep)) {
1111
+ throw new Error(`Path must stay within the project directory: ${targetPath}`);
1112
+ }
1113
+ return resolved;
1114
+ }
1115
+
1102
1116
  // src/cli.ts
1103
1117
  var args = process.argv.slice(2);
1104
1118
  var command = args[0] ?? "help";
1105
- var rootDir = resolve(process.cwd());
1119
+ var rootDir = resolve2(process.cwd());
1106
1120
  function hasFlag(flag) {
1107
1121
  return args.includes(flag);
1108
1122
  }
@@ -1142,8 +1156,9 @@ async function main() {
1142
1156
  const output = args[3];
1143
1157
  const code = runGenerate(type, name);
1144
1158
  if (output) {
1145
- writeFileSync(output, code);
1146
- console.log(`Generated ${output}`);
1159
+ const safeOutput = resolveSafePath(rootDir, output);
1160
+ writeFileSync(safeOutput, code);
1161
+ console.log(`Generated ${safeOutput}`);
1147
1162
  } else {
1148
1163
  console.log(code);
1149
1164
  }
package/package.json CHANGED
@@ -1,18 +1,19 @@
1
1
  {
2
2
  "name": "@larose-ui/cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "CLI for laRose UI platform — doctor, migrate, generate",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "larose": "./dist/cli.js"
8
8
  },
9
9
  "files": [
10
- "dist"
10
+ "dist",
11
+ "README.md"
11
12
  ],
12
13
  "dependencies": {
13
- "@larose-ui/accessibility": "0.1.0",
14
- "@larose-ui/contracts": "0.1.0",
15
- "@larose-ui/migration": "0.1.0"
14
+ "@larose-ui/accessibility": "0.1.2",
15
+ "@larose-ui/contracts": "0.1.2",
16
+ "@larose-ui/migration": "0.1.1"
16
17
  },
17
18
  "devDependencies": {
18
19
  "tsup": "^8.3.5",
@@ -25,7 +26,7 @@
25
26
  },
26
27
  "repository": {
27
28
  "type": "git",
28
- "url": "https://github.com/larose-ui/larose.git",
29
+ "url": "git+https://github.com/hamdymohamedak/larose-ui.git",
29
30
  "directory": "packages/cli"
30
31
  },
31
32
  "keywords": [
@@ -35,6 +36,10 @@
35
36
  "design-system",
36
37
  "saas"
37
38
  ],
39
+ "homepage": "https://github.com/hamdymohamedak/larose-ui/blob/main/packages/cli#readme",
40
+ "bugs": {
41
+ "url": "https://github.com/hamdymohamedak/larose-ui/issues"
42
+ },
38
43
  "scripts": {
39
44
  "build": "tsup",
40
45
  "dev": "tsup src/cli.ts --format esm --watch",