@flipova/foundation 2.0.4 → 2.1.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/CHANGELOG.md +16 -0
- package/README.md +32 -5
- package/design/documentation.xml +30 -7
- package/design/tools/design.js +24 -9
- package/design/tools/npm.js +225 -47
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 39083f9: flipova-design no longer copies the registries into the consumer project: it drives the toolchain already installed in node_modules/@flipova/foundation/design
|
|
8
|
+
init/inject inject only the app-level files (tailwind.config.js, postcss.config.js, globals.css) plus the design:\* npm scripts, and never overwrite what exists unless --force
|
|
9
|
+
new where prints the resolved registries and artifacts, inject replays the wiring without the toolchain
|
|
10
|
+
a project design/manifest.xml stays supported as an explicit fork, and gen then writes into the project
|
|
11
|
+
design.js honours FOUNDATION_VENV and FOUNDATION_DOCS_OUT, and probes the project venv or any python on PATH that can import lxml
|
|
12
|
+
|
|
13
|
+
## 2.0.5
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 6b211df: release chain observability: flow status and flow release status report npm, the Release run announces its decision, flow merge names the next step, and flow is a menu in a terminal
|
|
18
|
+
|
|
3
19
|
## 2.0.4
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -53,7 +53,31 @@ npm install gluestack-ui
|
|
|
53
53
|
npx flipova-design init
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
`init` **does not copy the registries into your project**. The XML registries and
|
|
57
|
+
the whole toolchain stay in `node_modules/@flipova/foundation/design`, and the
|
|
58
|
+
command only injects the app-level wiring that the package cannot own:
|
|
59
|
+
|
|
60
|
+
- `tailwind.config.js`, `postcss.config.js`, `globals.css` - created only when
|
|
61
|
+
missing (never overwritten unless `--force`);
|
|
62
|
+
- the `design:*` npm scripts in your `package.json` (`design:gen`, `design:lint`,
|
|
63
|
+
`design:check`, `design:verify`, `design:canonical`, `design:doc`,
|
|
64
|
+
`design:pipeline`).
|
|
65
|
+
|
|
66
|
+
| Command | What it does |
|
|
67
|
+
| :--- | :--- |
|
|
68
|
+
| `npx flipova-design where` | print the resolved registries/artifacts paths |
|
|
69
|
+
| `npx flipova-design inject` | re-run the injection only |
|
|
70
|
+
| `npx flipova-design gen [--check]` | compile the registries into `config.ts` + `tokens.js` |
|
|
71
|
+
| `npx flipova-design lint` | XSD-validate the registries |
|
|
72
|
+
|
|
73
|
+
`gen` writes into the resolved output root, i.e. straight into the installed
|
|
74
|
+
package (`node_modules/@flipova/foundation/components/ui/gluestack-ui-provider`),
|
|
75
|
+
so the artifacts consumed by `@flipova/foundation/tokens` and
|
|
76
|
+
`@flipova/foundation/ui` are always the ones the pipeline produced. Add your own
|
|
77
|
+
`design/manifest.xml` in the project only when you deliberately want to fork the
|
|
78
|
+
registries: it then takes over as the source and the outputs land in the project.
|
|
79
|
+
|
|
80
|
+
The generated theme is wired into your Tailwind config (app-level files are not
|
|
57
81
|
shipped by the package):
|
|
58
82
|
|
|
59
83
|
```js
|
|
@@ -65,15 +89,17 @@ module.exports = {
|
|
|
65
89
|
};
|
|
66
90
|
```
|
|
67
91
|
|
|
68
|
-
and
|
|
92
|
+
and the provider is mounted once at the root:
|
|
69
93
|
|
|
70
94
|
```tsx
|
|
71
95
|
import { GluestackUIProvider } from '@flipova/foundation/ui';
|
|
72
96
|
// <GluestackUIProvider mode="system"> ... </GluestackUIProvider>
|
|
73
97
|
```
|
|
74
98
|
|
|
75
|
-
|
|
76
|
-
|
|
99
|
+
The design tooling needs Python 3.8+ with `lxml` (`design/tools/requirements.txt`).
|
|
100
|
+
Resolution order: `$FOUNDATION_PYTHON`, then `$FOUNDATION_VENV`, then
|
|
101
|
+
`design/tools/.venv`, then any `python3`/`python` on `PATH` that can import
|
|
102
|
+
`lxml`.
|
|
77
103
|
|
|
78
104
|
## Documentation
|
|
79
105
|
|
|
@@ -87,4 +113,5 @@ cd docs && npm start
|
|
|
87
113
|
|
|
88
114
|
## License
|
|
89
115
|
|
|
90
|
-
MIT © Flipova
|
|
116
|
+
MIT © Flipova. Participation is governed by
|
|
117
|
+
[the Code of Conduct](CODE_OF_CONDUCT.md).
|
package/design/documentation.xml
CHANGED
|
@@ -37,14 +37,29 @@ npm install gluestack-ui
|
|
|
37
37
|
npx flipova-design init
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
The registries are **not** copied into your project. They live in the installed
|
|
41
|
+
package (`node_modules/@flipova/foundation/design`) together with the whole
|
|
42
|
+
toolchain, and the CLI drives them from there. `init` only injects what a package
|
|
43
|
+
cannot own:
|
|
44
|
+
|
|
45
|
+
- `tailwind.config.js`, `postcss.config.js` and `globals.css`, created only when
|
|
46
|
+
missing (an existing file is never overwritten unless you pass `--force`);
|
|
47
|
+
- the `design:*` npm scripts in your `package.json`, so the pipeline is
|
|
48
|
+
reachable as `npm run design:gen`, `design:lint`, `design:check`, ... ;
|
|
49
|
+
- a short recap of what to do next.
|
|
50
|
+
|
|
51
|
+
Use `npx flipova-design where` at any time to print the resolved paths, and
|
|
52
|
+
`npx flipova-design inject` to re-run only the injection.
|
|
53
|
+
|
|
54
|
+
If you deliberately want to fork the registries, create your own
|
|
55
|
+
`design/manifest.xml`: it then becomes the source of truth for that project and
|
|
56
|
+
the generated artifacts land in the project instead of in `node_modules`.
|
|
42
57
|
|
|
43
58
|
## Wire the theme into your Tailwind config
|
|
44
59
|
|
|
45
60
|
`tailwind.config.js`, `globals.css` and `postcss.config.js` are app-level files,
|
|
46
|
-
so the package does not ship them:
|
|
47
|
-
|
|
61
|
+
so the package does not ship them: `init` injects them, and the whole design
|
|
62
|
+
system is one generated Tailwind theme, published as
|
|
48
63
|
`@flipova/foundation/tokens`.
|
|
49
64
|
|
|
50
65
|
```js
|
|
@@ -105,19 +120,27 @@ no variable.
|
|
|
105
120
|
|
|
106
121
|
## Optional virtual environment
|
|
107
122
|
|
|
123
|
+
A `python3` (or `python`) that can import `lxml` is enough; the tooling probes
|
|
124
|
+
`PATH` for one. To pin the dependencies instead, create a venv anywhere and point
|
|
125
|
+
`FOUNDATION_VENV` at it:
|
|
126
|
+
|
|
108
127
|
```bash
|
|
109
128
|
python3 -m venv design/tools/.venv
|
|
110
|
-
design/tools/.venv/bin/pip install -r design/tools/requirements.txt # Linux/macOS
|
|
111
|
-
design/tools/.venv/Scripts/python -m pip install -r design/tools/requirements.txt # Windows
|
|
129
|
+
design/tools/.venv/bin/pip install -r node_modules/@flipova/foundation/design/tools/requirements.txt # Linux/macOS
|
|
130
|
+
design/tools/.venv/Scripts/python -m pip install -r node_modules/@flipova/foundation/design/tools/requirements.txt # Windows
|
|
112
131
|
```
|
|
113
132
|
|
|
133
|
+
Resolution order: `$FOUNDATION_PYTHON`, then `$FOUNDATION_VENV`, then
|
|
134
|
+
`design/tools/.venv`, then the first `python3`/`python` on `PATH` able to import
|
|
135
|
+
`lxml`.
|
|
136
|
+
|
|
114
137
|
## Verify the install
|
|
115
138
|
|
|
116
139
|
```bash
|
|
117
140
|
npx flipova-design lint
|
|
118
141
|
```
|
|
119
142
|
|
|
120
|
-
A clean
|
|
143
|
+
A clean install reports zero errors. Continue with **Quick Start**.
|
|
121
144
|
]]> </content>
|
|
122
145
|
</article>
|
|
123
146
|
<article id="quick-start" title="Quick Start" slug="getting-started/quick-start">
|
package/design/tools/design.js
CHANGED
|
@@ -18,8 +18,15 @@
|
|
|
18
18
|
*
|
|
19
19
|
* Python resolution order:
|
|
20
20
|
* 1. $FOUNDATION_PYTHON (explicit override)
|
|
21
|
-
* 2. design/tools/.venv
|
|
22
|
-
*
|
|
21
|
+
* 2. $FOUNDATION_VENV, else design/tools/.venv
|
|
22
|
+
* (Scripts/python.exe on Windows, bin/python otherwise)
|
|
23
|
+
* 3. `python3` then `python` on PATH, when `lxml` is importable
|
|
24
|
+
*
|
|
25
|
+
* Environment:
|
|
26
|
+
* FOUNDATION_DESIGN_DIR registry root (defaults to design/ next to tools/)
|
|
27
|
+
* FOUNDATION_PROJECT_ROOT output root for the generated artifacts
|
|
28
|
+
* FOUNDATION_DOCS_OUT docs output root (defaults to <root>/docs/generated)
|
|
29
|
+
* FOUNDATION_VENV venv directory holding the design dependencies
|
|
23
30
|
*
|
|
24
31
|
* Examples:
|
|
25
32
|
* node design/tools/design.js gen --check
|
|
@@ -44,7 +51,9 @@ const REPO_ROOT = process.env.FOUNDATION_PROJECT_ROOT
|
|
|
44
51
|
const MANIFEST = path.join(DESIGN_DIR, 'manifest.xml');
|
|
45
52
|
const SCHEMA = path.join(DESIGN_DIR, 'schema.xsd');
|
|
46
53
|
const DOCUMENTATION = path.join(DESIGN_DIR, 'documentation.xml');
|
|
47
|
-
const DOCS_OUT =
|
|
54
|
+
const DOCS_OUT = process.env.FOUNDATION_DOCS_OUT
|
|
55
|
+
? path.resolve(process.env.FOUNDATION_DOCS_OUT)
|
|
56
|
+
: path.join(REPO_ROOT, 'docs', 'generated');
|
|
48
57
|
|
|
49
58
|
const TARGETS = {
|
|
50
59
|
gen: {
|
|
@@ -91,12 +100,18 @@ const TARGETS = {
|
|
|
91
100
|
function findPython() {
|
|
92
101
|
if (process.env.FOUNDATION_PYTHON) return process.env.FOUNDATION_PYTHON;
|
|
93
102
|
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
103
|
+
const venvDirs = [];
|
|
104
|
+
if (process.env.FOUNDATION_VENV) venvDirs.push(path.resolve(process.env.FOUNDATION_VENV));
|
|
105
|
+
venvDirs.push(path.join(TOOLS_DIR, '.venv'));
|
|
106
|
+
if (REPO_ROOT !== DESIGN_DIR) venvDirs.push(path.join(REPO_ROOT, 'design', 'tools', '.venv'));
|
|
107
|
+
|
|
108
|
+
for (const dir of venvDirs) {
|
|
109
|
+
const candidates = process.platform === 'win32'
|
|
110
|
+
? [path.join(dir, 'Scripts', 'python.exe')]
|
|
111
|
+
: [path.join(dir, 'bin', 'python3'), path.join(dir, 'bin', 'python')];
|
|
112
|
+
for (const candidate of candidates) {
|
|
113
|
+
if (fs.existsSync(candidate)) return candidate;
|
|
114
|
+
}
|
|
100
115
|
}
|
|
101
116
|
|
|
102
117
|
const pathExes = process.platform === 'win32'
|
package/design/tools/npm.js
CHANGED
|
@@ -1,65 +1,243 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Project entry point for the design toolchain shipped by @flipova/foundation.
|
|
4
|
+
*
|
|
5
|
+
* Design philosophy: the registries live in the INSTALLED package, never in the
|
|
6
|
+
* consumer project. `npx flipova-design` therefore drives the tooling that
|
|
7
|
+
* already sits in `node_modules/@flipova/foundation/design`, and only injects
|
|
8
|
+
* the app-level wiring (Tailwind / PostCSS / global CSS + npm scripts) into the
|
|
9
|
+
* project.
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* npx flipova-design init inject app-level wiring (never overwrites)
|
|
13
|
+
* npx flipova-design init --force overwrite the injected files
|
|
14
|
+
* npx flipova-design inject re-run the injection only
|
|
15
|
+
* npx flipova-design where print the resolved paths (diagnostics)
|
|
16
|
+
* npx flipova-design gen [--check] compile registries -> gluestack artifacts
|
|
17
|
+
* npx flipova-design check|verify|canonical|lint|doc|edit|run|pipeline
|
|
18
|
+
*
|
|
19
|
+
* Registry resolution:
|
|
20
|
+
* 1. <projectRoot>/design/manifest.xml (explicit project override, opt-in)
|
|
21
|
+
* 2. <packageRoot>/design/manifest.xml (the installed package, default)
|
|
22
|
+
*
|
|
23
|
+
* `gen` writes into the resolved output root, so by default it refreshes
|
|
24
|
+
* `node_modules/@flipova/foundation/components/ui/gluestack-ui-provider/*` -- the
|
|
25
|
+
* exact files consumed by `@flipova/foundation/tokens` and `@flipova/foundation/ui`.
|
|
26
|
+
*/
|
|
3
27
|
'use strict';
|
|
4
28
|
|
|
5
29
|
const { spawnSync } = require('child_process');
|
|
6
30
|
const fs = require('fs');
|
|
7
31
|
const path = require('path');
|
|
8
32
|
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
33
|
+
const PACKAGE_ROOT = path.resolve(__dirname, '..', '..');
|
|
34
|
+
const PACKAGE_DESIGN = path.join(PACKAGE_ROOT, 'design');
|
|
35
|
+
const TOOL = path.join(PACKAGE_DESIGN, 'tools', 'design.js');
|
|
36
|
+
const PROJECT_ROOT = process.cwd();
|
|
37
|
+
const PROJECT_DESIGN = path.join(PROJECT_ROOT, 'design');
|
|
38
|
+
|
|
39
|
+
/* ------------------------------------------------------------------ *
|
|
40
|
+
* Resolution
|
|
41
|
+
* ------------------------------------------------------------------ */
|
|
42
|
+
|
|
43
|
+
function resolution() {
|
|
44
|
+
const override = fs.existsSync(path.join(PROJECT_DESIGN, 'manifest.xml'));
|
|
45
|
+
return {
|
|
46
|
+
override,
|
|
47
|
+
designDir: override ? PROJECT_DESIGN : PACKAGE_DESIGN,
|
|
48
|
+
outputRoot: override ? PROJECT_ROOT : PACKAGE_ROOT,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function readPackageVersion() {
|
|
53
|
+
try {
|
|
54
|
+
return JSON.parse(fs.readFileSync(path.join(PACKAGE_ROOT, 'package.json'), 'utf8')).version;
|
|
55
|
+
} catch (_) {
|
|
56
|
+
return 'unknown';
|
|
22
57
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
58
|
+
}
|
|
59
|
+
/* ------------------------------------------------------------------ *
|
|
60
|
+
* Injected app-level files (never copied registries)
|
|
61
|
+
* ------------------------------------------------------------------ */
|
|
62
|
+
|
|
63
|
+
const TAILWIND_CONFIG = `// tailwind.config.js
|
|
64
|
+
// Injected by \`npx flipova-design init\` -- safe to edit, safe to regenerate.
|
|
65
|
+
// The whole design system is the generated theme below: it holds no design value.
|
|
66
|
+
const tokens = require('@flipova/foundation/tokens');
|
|
67
|
+
|
|
68
|
+
/** @type {import('tailwindcss').Config} */
|
|
69
|
+
module.exports = {
|
|
70
|
+
content: [
|
|
71
|
+
'./app/**/*.{tsx,ts,jsx,js}',
|
|
72
|
+
'./components/**/*.{tsx,ts,jsx,js}',
|
|
73
|
+
'./src/**/*.{tsx,ts,jsx,js}',
|
|
74
|
+
],
|
|
75
|
+
presets: [require('nativewind/preset')],
|
|
76
|
+
important: 'html',
|
|
77
|
+
theme: { extend: tokens.theme },
|
|
78
|
+
};
|
|
79
|
+
`;
|
|
80
|
+
|
|
81
|
+
const POSTCSS_CONFIG = `// postcss.config.js
|
|
82
|
+
// Injected by \`npx flipova-design init\` -- safe to edit, safe to regenerate.
|
|
83
|
+
module.exports = { plugins: { tailwindcss: {}, autoprefixer: {} } };
|
|
84
|
+
`;
|
|
85
|
+
|
|
86
|
+
const GLOBALS_CSS = `/* globals.css */
|
|
87
|
+
/* Injected by \`npx flipova-design init\` -- safe to edit, safe to regenerate. */
|
|
88
|
+
@tailwind base;
|
|
89
|
+
@tailwind components;
|
|
90
|
+
@tailwind utilities;
|
|
91
|
+
|
|
92
|
+
/*
|
|
93
|
+
* Some registry families delegate to the app fonts through these variables
|
|
94
|
+
* (font-sans / font-body / font-heading). font-system, font-mono and font-serif
|
|
95
|
+
* are self-contained and need no variable.
|
|
96
|
+
*/
|
|
97
|
+
:root {
|
|
98
|
+
--font-sans: Inter, system-ui, sans-serif;
|
|
99
|
+
--font-heading: Inter, system-ui, sans-serif;
|
|
100
|
+
}
|
|
101
|
+
`;
|
|
102
|
+
|
|
103
|
+
const NPM_SCRIPTS = {
|
|
104
|
+
'design:gen': 'flipova-design gen',
|
|
105
|
+
'design:gen:check': 'flipova-design gen --check',
|
|
106
|
+
'design:check': 'flipova-design check',
|
|
107
|
+
'design:verify': 'flipova-design verify',
|
|
108
|
+
'design:canonical': 'flipova-design canonical',
|
|
109
|
+
'design:lint': 'flipova-design lint',
|
|
110
|
+
'design:doc': 'flipova-design doc',
|
|
111
|
+
'design:pipeline': 'flipova-design pipeline',
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const INJECTED_FILES = [
|
|
115
|
+
['tailwind.config.js', TAILWIND_CONFIG],
|
|
116
|
+
['postcss.config.js', POSTCSS_CONFIG],
|
|
117
|
+
['globals.css', GLOBALS_CSS],
|
|
118
|
+
];
|
|
119
|
+
|
|
120
|
+
function writeIfMissing(name, contents, force, created, skipped) {
|
|
121
|
+
const target = path.join(PROJECT_ROOT, name);
|
|
122
|
+
if (fs.existsSync(target) && !force) {
|
|
123
|
+
skipped.push(name);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
fs.writeFileSync(target, contents, 'utf8');
|
|
127
|
+
created.push(name);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function injectScripts(force, created, skipped) {
|
|
131
|
+
const pkgPath = path.join(PROJECT_ROOT, 'package.json');
|
|
132
|
+
if (!fs.existsSync(pkgPath)) return;
|
|
133
|
+
|
|
134
|
+
let pkg;
|
|
135
|
+
try {
|
|
136
|
+
pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
137
|
+
} catch (error) {
|
|
138
|
+
process.stderr.write(`Cannot parse ${pkgPath}: ${error.message}\n`);
|
|
26
139
|
process.exit(2);
|
|
27
140
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
141
|
+
|
|
142
|
+
pkg.scripts = pkg.scripts || {};
|
|
143
|
+
let changed = false;
|
|
144
|
+
const added = [];
|
|
145
|
+
const kept = [];
|
|
146
|
+
|
|
147
|
+
for (const [name, command] of Object.entries(NPM_SCRIPTS)) {
|
|
148
|
+
if (pkg.scripts[name] !== undefined && !force) {
|
|
149
|
+
kept.push(name);
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
if (pkg.scripts[name] !== command) changed = true;
|
|
153
|
+
pkg.scripts[name] = command;
|
|
154
|
+
added.push(name);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (changed) {
|
|
158
|
+
fs.writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`, 'utf8');
|
|
159
|
+
}
|
|
160
|
+
created.push(...added.map((name) => `package.json#scripts.${name}`));
|
|
161
|
+
skipped.push(...kept.map((name) => `package.json#scripts.${name}`));
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function inject(force) {
|
|
165
|
+
const created = [];
|
|
166
|
+
const skipped = [];
|
|
167
|
+
|
|
168
|
+
for (const [name, contents] of INJECTED_FILES) {
|
|
169
|
+
writeIfMissing(name, contents, force, created, skipped);
|
|
37
170
|
}
|
|
38
|
-
|
|
171
|
+
injectScripts(force, created, skipped);
|
|
172
|
+
|
|
173
|
+
const { override, designDir, outputRoot } = resolution();
|
|
174
|
+
const artifacts = path.join(outputRoot, 'components', 'ui', 'gluestack-ui-provider');
|
|
175
|
+
|
|
176
|
+
process.stdout.write(`Flipova Foundation ${readPackageVersion()}\n`);
|
|
177
|
+
process.stdout.write(` registries : ${designDir}${override ? ' (project override)' : ' (from node_modules)'}\n`);
|
|
178
|
+
process.stdout.write(` artifacts : ${artifacts}\n`);
|
|
179
|
+
for (const name of created) process.stdout.write(` created : ${name}\n`);
|
|
180
|
+
for (const name of skipped) process.stdout.write(` kept : ${name}\n`);
|
|
181
|
+
|
|
182
|
+
process.stdout.write('\nNext steps:\n');
|
|
183
|
+
process.stdout.write(' 1. npm install gluestack-ui\n');
|
|
184
|
+
process.stdout.write(' 2. wrap the app in <GluestackUIProvider mode="system"> from @flipova/foundation/ui\n');
|
|
185
|
+
process.stdout.write(' 3. npx flipova-design lint # verify\n');
|
|
39
186
|
}
|
|
40
187
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
process.
|
|
188
|
+
function printWhere() {
|
|
189
|
+
const { override, designDir, outputRoot } = resolution();
|
|
190
|
+
process.stdout.write(`package ${PACKAGE_ROOT}\n`);
|
|
191
|
+
process.stdout.write(`version ${readPackageVersion()}\n`);
|
|
192
|
+
process.stdout.write(`project ${PROJECT_ROOT}\n`);
|
|
193
|
+
process.stdout.write(`registries ${designDir}${override ? ' (project override)' : ' (node_modules)'}\n`);
|
|
194
|
+
process.stdout.write(`artifacts ${path.join(outputRoot, 'components', 'ui', 'gluestack-ui-provider')}\n`);
|
|
195
|
+
process.stdout.write(`tool ${TOOL}\n`);
|
|
196
|
+
process.stdout.write(`python ${process.env.FOUNDATION_PYTHON || '(auto-detect)'}\n`);
|
|
45
197
|
}
|
|
46
198
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
199
|
+
function runTool(command, args) {
|
|
200
|
+
if (!fs.existsSync(TOOL)) {
|
|
201
|
+
process.stderr.write(`Design toolchain missing at ${TOOL}. Reinstall @flipova/foundation.\n`);
|
|
202
|
+
process.exit(2);
|
|
203
|
+
}
|
|
204
|
+
const { designDir, outputRoot } = resolution();
|
|
205
|
+
const result = spawnSync(process.execPath, [TOOL, command, ...args], {
|
|
206
|
+
cwd: PROJECT_ROOT,
|
|
207
|
+
env: {
|
|
208
|
+
...process.env,
|
|
209
|
+
FOUNDATION_DESIGN_DIR: designDir,
|
|
210
|
+
FOUNDATION_PROJECT_ROOT: outputRoot,
|
|
211
|
+
FOUNDATION_DOCS_OUT: path.join(PROJECT_ROOT, 'docs', 'generated'),
|
|
212
|
+
},
|
|
213
|
+
stdio: 'inherit',
|
|
214
|
+
});
|
|
215
|
+
if (result.error) {
|
|
216
|
+
process.stderr.write(`${result.error}\n`);
|
|
217
|
+
process.exit(1);
|
|
218
|
+
}
|
|
219
|
+
process.exit(result.status == null ? 1 : result.status);
|
|
50
220
|
}
|
|
51
221
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
if (
|
|
62
|
-
|
|
63
|
-
|
|
222
|
+
function main() {
|
|
223
|
+
const argv = process.argv.slice(2);
|
|
224
|
+
const command = argv[0];
|
|
225
|
+
const args = argv.slice(1);
|
|
226
|
+
|
|
227
|
+
if (command === 'init' || command === 'inject') {
|
|
228
|
+
inject(args.includes('--force'));
|
|
229
|
+
process.exit(0);
|
|
230
|
+
}
|
|
231
|
+
if (command === 'where') {
|
|
232
|
+
printWhere();
|
|
233
|
+
process.exit(0);
|
|
234
|
+
}
|
|
235
|
+
if (command === undefined) {
|
|
236
|
+
process.stderr.write(
|
|
237
|
+
'Usage: npx flipova-design <init|inject|where|gen|check|verify|canonical|lint|doc|edit|run|pipeline>\n');
|
|
238
|
+
process.exit(2);
|
|
239
|
+
}
|
|
240
|
+
runTool(command, args);
|
|
64
241
|
}
|
|
65
|
-
|
|
242
|
+
|
|
243
|
+
main();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flipova/foundation",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "gluestack-ui components for React Native (iOS, Android) and Web, with a registry-driven theming pipeline (XML tokens/themes to gluestack config + Tailwind theme)",
|
|
5
5
|
"author": "Flipova",
|
|
6
6
|
"license": "MIT",
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"docs": "npm run design:doc",
|
|
63
63
|
"docs:build": "npm --prefix docs run build",
|
|
64
64
|
"flow": "node .github/scripts/flow.mjs",
|
|
65
|
+
"maintain": "node .github/scripts/maintain.mjs",
|
|
65
66
|
"test": "vitest run",
|
|
66
67
|
"design:gen": "node design/tools/design.js gen",
|
|
67
68
|
"design:gen:check": "node design/tools/design.js gen --check",
|