@uibot/design-md-importer 0.0.0-stage → 0.2.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.
- package/dist/importers/css-variables.d.ts +12 -0
- package/dist/importers/open-design-systems.d.ts +2 -0
- package/dist/importers/tailwind.d.ts +14 -0
- package/dist/importers/tokens-json.d.ts +16 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +61 -0
- package/dist/types.d.ts +29 -0
- package/package.json +40 -4
- package/README.md +0 -3
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error captured during a non-destructive import scan. Importers push
|
|
3
|
+
* structured errors to this array instead of throwing, so a single bad
|
|
4
|
+
* file does not abort the whole scan.
|
|
5
|
+
*/
|
|
6
|
+
export interface ImporterError {
|
|
7
|
+
/** Source file that triggered the error (absolute or project-relative). */
|
|
8
|
+
source: string;
|
|
9
|
+
/** Machine-readable code, e.g. "parse-failed", "unsupported-expression". */
|
|
10
|
+
code: string;
|
|
11
|
+
/** Human-readable detail, safe to surface in UI. */
|
|
12
|
+
message: string;
|
|
13
|
+
}
|
|
14
|
+
/** Subset of scanners the caller wishes to run. */
|
|
15
|
+
export type ImporterKind = "tailwind" | "tokens" | "css" | "open-design-systems";
|
|
16
|
+
export interface ScanAutoDesignMdOptions {
|
|
17
|
+
/** Absolute project root. Must resolve beneath `UIBOT_AGENT_ROOT_DIR` when called via the Studio scan handler. */
|
|
18
|
+
projectRoot: string;
|
|
19
|
+
/** Optional open-design design-systems root. Defaults to projectRoot for this scanner. */
|
|
20
|
+
openDesignSystemsRoot?: string;
|
|
21
|
+
/** Which sub-scanners to run. Defaults to all three. */
|
|
22
|
+
enabled?: ImporterKind[];
|
|
23
|
+
}
|
|
24
|
+
export interface ScanResult {
|
|
25
|
+
/** Entries produced by the scanner(s), ready to feed into `DesignMdRegistry.addAll(entries, { layer: "auto" })`. */
|
|
26
|
+
entries: Array<import("@uibot/contracts").DesignMd>;
|
|
27
|
+
/** Non-fatal errors collected during the scan. */
|
|
28
|
+
errors: ImporterError[];
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uibot/design-md-importer",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/Foundj/uibot.git",
|
|
8
|
+
"directory": "packages/design-md-importer"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"main": "./dist/index.js",
|
|
12
|
+
"module": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"!dist/**/*.map",
|
|
23
|
+
"!dist/**/*.test.d.ts",
|
|
24
|
+
"!dist/**/*.spec.d.ts"
|
|
25
|
+
],
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@uibot/contracts": "^0.2.0",
|
|
31
|
+
"@babel/parser": "^7.26.0",
|
|
32
|
+
"@babel/traverse": "^7.26.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/babel__traverse": "^7.20.6"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "rm -rf dist && bun build --minify ./src/index.ts --outdir ./dist --format esm --target bun && bun x tsc -p tsconfig.json",
|
|
39
|
+
"typecheck": "bun x tsc -p tsconfig.json --noEmit",
|
|
40
|
+
"test": "bun test"
|
|
41
|
+
}
|
|
42
|
+
}
|
package/README.md
DELETED