depflow 2.0.2 → 3.0.0-dev.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/README.md +129 -58
- package/build/cli/DepFLowCLI.js +32 -16
- package/build/cli/DepFLowCLI.js.map +1 -1
- package/build/cli/bin.js +16 -12
- package/build/cli/bin.js.map +1 -1
- package/build/config/Config.d.ts +3 -3
- package/build/config/Config.js +3 -3
- package/build/config/ImportMap.d.ts +2 -3
- package/build/config/ImportMap.js +9 -10
- package/build/config/ImportMap.js.map +1 -1
- package/build/config/Tsconfig.d.ts +2 -2
- package/build/config/Tsconfig.js +17 -7
- package/build/config/Tsconfig.js.map +1 -1
- package/build/config/schemas.d.ts +634 -51
- package/build/config/schemas.js +37 -21
- package/build/config/schemas.js.map +1 -1
- package/build/support/Builder/Builder.d.ts +36 -0
- package/build/support/Builder/Builder.js +89 -0
- package/build/support/Builder/Builder.js.map +1 -0
- package/build/support/Dependency/Dependency.d.ts +38 -0
- package/build/support/Dependency/Dependency.js +14 -0
- package/build/support/Dependency/Dependency.js.map +1 -0
- package/build/support/Dependency/GitDependency.d.ts +20 -0
- package/build/support/Dependency/GitDependency.js +67 -0
- package/build/support/Dependency/GitDependency.js.map +1 -0
- package/build/support/Dependency/NpmDependency.d.ts +18 -0
- package/build/support/Dependency/NpmDependency.js +65 -0
- package/build/support/Dependency/NpmDependency.js.map +1 -0
- package/build/support/Dependency/Resolver.d.ts +7 -0
- package/build/support/Dependency/Resolver.js +4 -0
- package/build/support/Dependency/Resolver.js.map +1 -0
- package/build/support/PathResolver/AliasCompiler.d.ts +3 -2
- package/build/support/PathResolver/AliasCompiler.js +9 -3
- package/build/support/PathResolver/AliasCompiler.js.map +1 -1
- package/build/support/PathResolver/PathResolver.d.ts +3 -3
- package/build/support/PathResolver/PathResolver.js +6 -1
- package/build/support/PathResolver/PathResolver.js.map +1 -1
- package/build/support/Utils.d.ts +8 -0
- package/build/support/Utils.js +30 -0
- package/build/support/Utils.js.map +1 -1
- package/package.json +2 -2
- package/build/support/Dependency.d.ts +0 -109
- package/build/support/Dependency.js +0 -274
- package/build/support/Dependency.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,100 +1,171 @@
|
|
|
1
|
-
#
|
|
1
|
+
# DepFlow — Dependency Flow Manager
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
DepFlow is a focused dependency orchestration tool that lets projects consume Git repositories and NPM packages as managed dependencies. It simplifies building, extracting, and mapping artifacts into your application (for example, populating an `importmap` or TypeScript `paths`).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Key goals:
|
|
6
|
+
- Keep repository-sourced modules reproducible and buildable.
|
|
7
|
+
- Provide automatic path/importmap resolution for browser and TypeScript workflows.
|
|
8
|
+
- Support lightweight builder pipelines for extracted artifacts.
|
|
6
9
|
|
|
7
10
|
---
|
|
8
11
|
|
|
9
|
-
|
|
12
|
+
## Features
|
|
13
|
+
- Git-based dependencies with optional build pipelines
|
|
14
|
+
- NPM dependency extraction and local mirroring
|
|
15
|
+
- Automatic `tsconfig` paths and browser `importmap` generation via `dep sync`
|
|
16
|
+
- Flexible resolver aliases for local and CDN targets
|
|
10
17
|
|
|
11
|
-
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
Install globally with npm to use the CLI system-wide:
|
|
12
23
|
|
|
13
|
-
```
|
|
24
|
+
```bash
|
|
14
25
|
npm install -g @netfeez/depflow
|
|
15
26
|
```
|
|
16
27
|
|
|
17
|
-
|
|
18
|
-
> Global installation makes the `dep` command available everywhere. For version 2.0.0, ensure you are using the `@netfeez` scope.
|
|
28
|
+
Alternatively, add it as a dev-dependency for project-specific usage.
|
|
19
29
|
|
|
20
30
|
---
|
|
21
31
|
|
|
22
|
-
|
|
32
|
+
## Quick Start
|
|
23
33
|
|
|
24
|
-
|
|
34
|
+
1. Create a configuration file (recommended name: `depflow.json`).
|
|
35
|
+
2. Run `dep install` to fetch and build all configured dependencies.
|
|
36
|
+
3. Run `dep sync` to update `tsconfig` paths and `importmap` (if configured).
|
|
25
37
|
|
|
26
|
-
|
|
38
|
+
CLI examples:
|
|
27
39
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
40
|
+
```bash
|
|
41
|
+
# install dependencies defined in .df.json
|
|
42
|
+
dep install
|
|
43
|
+
# --flow filepath.json for use an specific config
|
|
44
|
+
|
|
45
|
+
# sync tsconfig/importmap from the configuration
|
|
46
|
+
dep sync
|
|
47
|
+
```
|
|
36
48
|
|
|
37
49
|
---
|
|
38
50
|
|
|
39
|
-
|
|
51
|
+
## Configuration
|
|
52
|
+
|
|
53
|
+
DepFlow uses a JSON configuration file describing where to fetch dependencies and how to build and expose them. The minimal structure:
|
|
54
|
+
|
|
55
|
+
- `flowFolder` (string): folder where DepFlow stores temporary state (default: `.depflow`).
|
|
56
|
+
- `outDir` (string): project output root used by extract rules.
|
|
57
|
+
- `tsconfig` (string|null): optional path to TypeScript `tsconfig.json` to update `compilerOptions.paths`.
|
|
58
|
+
- `importmap` (string|null): optional path to write a browser `importmap`.
|
|
59
|
+
- `dependencies` (array): Git-based dependencies.
|
|
60
|
+
- `npmDependencies` (array): NPM packages to extract files from.
|
|
40
61
|
|
|
41
|
-
|
|
62
|
+
Each dependency supports `builder` steps (run commands, file extraction) and `resolver` entries that map aliases to local or CDN targets.
|
|
42
63
|
|
|
43
|
-
|
|
64
|
+
### Example Configuration
|
|
65
|
+
|
|
66
|
+
Below is an example adapted from a real project configuration. Use it as a template for your repository.
|
|
44
67
|
|
|
45
68
|
```json
|
|
46
69
|
{
|
|
47
70
|
"flowFolder": ".depflow",
|
|
48
|
-
"
|
|
49
|
-
"
|
|
71
|
+
"outDir": ".",
|
|
72
|
+
"tsconfig": "tsconfig.web.json",
|
|
73
|
+
"importmap": "public/importmap.json",
|
|
50
74
|
"dependencies": [
|
|
51
75
|
{
|
|
52
|
-
"name": "
|
|
53
|
-
"repo": "https://github.com/
|
|
54
|
-
"tag": "main",
|
|
76
|
+
"name": "NetFeez.Vizui",
|
|
77
|
+
"repo": "https://github.com/NetFeez/Vizui.git",
|
|
55
78
|
"builder": [
|
|
56
|
-
{
|
|
57
|
-
|
|
79
|
+
{
|
|
80
|
+
"run": ["npm install", "npm run compile"],
|
|
81
|
+
"extract": [
|
|
82
|
+
{ "from": "build/**/*.js", "to": "public/lib/vizui/", "replacer": "^build/" },
|
|
83
|
+
{ "from": "build/**/*.d.ts", "to": "public/lib/vizui/", "replacer": "^build/" }
|
|
84
|
+
]
|
|
85
|
+
}
|
|
58
86
|
],
|
|
59
87
|
"resolver": [
|
|
88
|
+
{ "alias": "vizui", "target": "public/lib/vizui/vizui.js" },
|
|
89
|
+
{ "alias": "vizui/*", "target": "public/lib/vizui/*" }
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"npmDependencies": [
|
|
94
|
+
{
|
|
95
|
+
"name": "@netfeez/common",
|
|
96
|
+
"version": "latest",
|
|
97
|
+
"builder": [
|
|
60
98
|
{
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
}
|
|
99
|
+
"extract": [
|
|
100
|
+
{ "from": "build/**/*.js", "to": "public/lib/common/", "replacer": "^build/" },
|
|
101
|
+
{ "from": "build/**/*.d.ts", "to": "public/lib/common/", "replacer": "^build/" }
|
|
102
|
+
]
|
|
66
103
|
}
|
|
104
|
+
],
|
|
105
|
+
"resolver": [
|
|
106
|
+
{ "alias": "@netfeez/common", "target": "public/lib/common/index.js" },
|
|
107
|
+
{ "alias": "@netfeez/common/*", "target": "public/lib/common/*" }
|
|
67
108
|
]
|
|
68
109
|
}
|
|
69
110
|
]
|
|
70
111
|
}
|
|
71
112
|
```
|
|
72
113
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
### Dependency Object
|
|
82
|
-
* **`name`** (string): Unique identifier for the dependency.
|
|
83
|
-
* **`repo`** (string): The Git repository URL.
|
|
84
|
-
* **`tag`** (string, optional): **(New)** Specify a branch, tag, or commit hash (e.g., `main`, `v1.2.0`).
|
|
85
|
-
* **`builder`**: A pipeline to build and organize the dependency files.
|
|
86
|
-
* **`run`** (string | string[]): Command(s) to execute (e.g., `npm run compile`).
|
|
87
|
-
* **`move`** (string | object): Defines where to place the built files.
|
|
88
|
-
* **`resolver`**: **(Renamed)** Configuration for path mapping.
|
|
89
|
-
* alias`**: The import alias (e.g., `my-lib`).
|
|
90
|
-
* **`target`**: Can be a string path or an object defining `local` and `cdn` targets for hybrid environments.
|
|
114
|
+
### Builder rules
|
|
115
|
+
- `run`: a string or array of shell commands executed inside the dependency checkout.
|
|
116
|
+
- `extract`: patterns describing which files to copy from the dependency build output into your project. Each extractor may include `from`, `to`, and an optional `replacer` regex used to rewrite paths.
|
|
117
|
+
|
|
118
|
+
### Resolver entries
|
|
119
|
+
- `alias`: module alias exposed to your project (used in `importmap` and `tsconfig` paths).
|
|
120
|
+
- `target`: a string path or an object with `local` and `cdn` properties for multi-target deployments.
|
|
91
121
|
|
|
92
122
|
---
|
|
93
123
|
|
|
94
|
-
|
|
124
|
+
## CLI Reference
|
|
125
|
+
|
|
126
|
+
Use the distribution script in `build/cli/bin.js` or install the package globally.
|
|
127
|
+
|
|
128
|
+
- `install`: Clone, build and extract artifacts for all dependencies in your config.
|
|
129
|
+
- `sync`: Generate/update `tsconfig` paths and browser `importmap` according to `resolver` entries.
|
|
130
|
+
- `list`: Show configured dependencies and their status.
|
|
131
|
+
|
|
132
|
+
Use `node ./build/cli/bin.js <command> --flow <config>` when running locally from the repository.
|
|
133
|
+
|
|
134
|
+
### Commands
|
|
135
|
+
|
|
136
|
+
The CLI exposes the following commands (all commands accept the global `--flow <file>` flag to specify a custom configuration file):
|
|
137
|
+
|
|
138
|
+
| Command | Usage | Description |
|
|
139
|
+
|---|---|---|
|
|
140
|
+
| `add` | `dep add <repo_url> [name] [--flow <file>]` | Add a git dependency to the configuration file. If the configuration file does not exist it will be created automatically (default: `depflow.json`). If `name` is omitted the repo name is used. |
|
|
141
|
+
| `remove` | `dep remove <name|repo_url> [--flow <file>]` | Remove a dependency by `name` or repository URL. |
|
|
142
|
+
| `install` | `dep install [name1 name2 ...] [--flow <file>]` | Clone, build and extract artifacts for all or specific dependencies. Runs `dep sync` after install. |
|
|
143
|
+
| `uninstall` | `dep uninstall [name1 name2 ...] [--flow <file>]` | Remove local files for configured dependencies. |
|
|
144
|
+
| `list` | `dep list [--flow <file>]` | List all dependencies declared in the configuration. |
|
|
145
|
+
| `rewrite-paths` | `dep rewrite-paths [--watch] [--cdn] [--flow <file>]` | Rewrite built files' paths according to resolver aliases. Use `--watch` to run a watcher; use `--cdn` to apply CDN targets instead of local targets. |
|
|
146
|
+
| `sync` | `dep sync [--cdn] [--flow <file>]` | Update `tsconfig` paths and generate `importmap` from resolver aliases. Use `--cdn` to prefer CDN targets when generating the importmap. |
|
|
147
|
+
|
|
148
|
+
### Flags
|
|
149
|
+
|
|
150
|
+
- `--flow <file>`: Specify an alternate configuration file (for example `.df.json` or `depflow.json`). If omitted, the CLI defaults to `depflow.json` in the current working directory.
|
|
151
|
+
- `--cdn`: When present for `sync` or `rewrite-paths`, instructs the tool to use CDN targets from resolver entries instead of `local` targets when generating the `importmap` or rewriting paths.
|
|
152
|
+
- `--watch` / `-w`: For `rewrite-paths` only — run a file watcher that keeps rewriting paths as files change.
|
|
153
|
+
|
|
154
|
+
Examples:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
# install using custom flow file
|
|
158
|
+
dep install --flow .df.json
|
|
159
|
+
|
|
160
|
+
# sync using CDN targets for importmap
|
|
161
|
+
dep sync --flow .df.json --cdn
|
|
162
|
+
|
|
163
|
+
# rewrite paths and start watcher (local targets)
|
|
164
|
+
dep rewrite-paths --flow .df.json --watch
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
---
|
|
95
168
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
3. Add the `$schema` field to enable VSCode autocompletion and validation.
|
|
100
|
-
4. Run `dep sync` to initialize your environment.
|
|
169
|
+
If you want, I can also:
|
|
170
|
+
- add quick examples for `tsconfig` path snippets generated by `dep sync`,
|
|
171
|
+
- or produce a Spanish summary for quick internal reference.
|
package/build/cli/DepFLowCLI.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import path from "node:path";
|
|
1
2
|
import Logger, { DebugUI } from "@netfeez/vterm";
|
|
2
|
-
import Validator from "../support/Validator.js";
|
|
3
3
|
import Utils from "../support/Utils.js";
|
|
4
|
+
import Validator from "../support/Validator.js";
|
|
5
|
+
import GitDependency from "../support/Dependency/GitDependency.js";
|
|
6
|
+
import PathResolver from "../support/PathResolver/PathResolver.js";
|
|
4
7
|
import Config from "../config/Config.js";
|
|
5
|
-
import
|
|
6
|
-
import Dependency from "../support/Dependency.js";
|
|
8
|
+
import Schemas from "../config/schemas.js";
|
|
7
9
|
import Tsconfig from "../config/Tsconfig.js";
|
|
8
|
-
import pathResolver from "../support/PathResolver/PathResolver.js";
|
|
9
10
|
import ImportMap from "../config/ImportMap.js";
|
|
10
|
-
import
|
|
11
|
+
import NpmDependency from "../support/Dependency/NpmDependency.js";
|
|
11
12
|
export class DepFlowCLI extends DebugUI {
|
|
12
13
|
configPath;
|
|
13
14
|
projectRoot;
|
|
@@ -36,7 +37,7 @@ export class DepFlowCLI extends DebugUI {
|
|
|
36
37
|
Validator.validateRepo(repo);
|
|
37
38
|
if (!name)
|
|
38
39
|
name = Utils.getRepoName(repo);
|
|
39
|
-
const dep =
|
|
40
|
+
const dep = Schemas.GitDependency.processData({ name, repo });
|
|
40
41
|
const config = await Config.load(this.configPath);
|
|
41
42
|
config.dependencies.push(dep);
|
|
42
43
|
await Config.save(this.configPath, config);
|
|
@@ -71,16 +72,16 @@ export class DepFlowCLI extends DebugUI {
|
|
|
71
72
|
try {
|
|
72
73
|
this.out.group(Utils.newGroup('#FFB4DC'));
|
|
73
74
|
const config = await Config.load(this.configPath);
|
|
74
|
-
const
|
|
75
|
-
if (
|
|
75
|
+
const gitDependencies = config.dependencies;
|
|
76
|
+
if (gitDependencies.length === 0)
|
|
76
77
|
throw new Error(args.length > 0 ? 'Specified dependencies not found.' : 'No dependencies to install.');
|
|
77
78
|
this.out.info(`&C5Installing dependencies...`);
|
|
78
|
-
for (const dep of
|
|
79
|
+
for (const dep of gitDependencies) {
|
|
79
80
|
try {
|
|
80
81
|
this.out.group(Utils.newGroup('#FFB4DC'));
|
|
81
82
|
this.out.info(`&C5Installing &C6"${dep.name}" &C5from &C6${dep.repo}&C5...`);
|
|
82
83
|
this.out.line();
|
|
83
|
-
const dependency = new
|
|
84
|
+
const dependency = new GitDependency(config.flowFolder, dep, this.out);
|
|
84
85
|
await dependency.install();
|
|
85
86
|
this.out.line();
|
|
86
87
|
this.out.info(`&C2Installed &C6${dep.name}.`);
|
|
@@ -89,6 +90,21 @@ export class DepFlowCLI extends DebugUI {
|
|
|
89
90
|
this.out.groupEnd();
|
|
90
91
|
}
|
|
91
92
|
}
|
|
93
|
+
const npmDependencies = config.npmDependencies;
|
|
94
|
+
for (const dep of npmDependencies) {
|
|
95
|
+
try {
|
|
96
|
+
this.out.group(Utils.newGroup('#FFB4DC'));
|
|
97
|
+
this.out.info(`&C5Installing npm dependency &C6"${dep.name}" &C5version &C6${dep.version}&C5...`);
|
|
98
|
+
this.out.line();
|
|
99
|
+
const dependency = new NpmDependency(config.flowFolder, dep, this.out);
|
|
100
|
+
await dependency.install();
|
|
101
|
+
this.out.line();
|
|
102
|
+
this.out.info(`&C2Installed npm dependency &C6${dep.name}.`);
|
|
103
|
+
}
|
|
104
|
+
finally {
|
|
105
|
+
this.out.groupEnd();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
92
108
|
await this.commandSync('sync', []);
|
|
93
109
|
}
|
|
94
110
|
catch (error) {
|
|
@@ -110,7 +126,7 @@ export class DepFlowCLI extends DebugUI {
|
|
|
110
126
|
this.out.group(Utils.newGroup('#FFB4DC'));
|
|
111
127
|
this.out.info(`&C1Uninstalling "${dep.name}" from "${dep.repo}"...`);
|
|
112
128
|
this.out.line();
|
|
113
|
-
const dependency = new
|
|
129
|
+
const dependency = new GitDependency(config.flowFolder, dep, this.out);
|
|
114
130
|
await dependency.uninstall();
|
|
115
131
|
this.out.line();
|
|
116
132
|
this.out.info(`Uninstalled "${dep.name}".`);
|
|
@@ -156,7 +172,7 @@ export class DepFlowCLI extends DebugUI {
|
|
|
156
172
|
this.out.info(`Mode: &C3${useCDN ? 'CDN' : 'Local'}`);
|
|
157
173
|
if (watch)
|
|
158
174
|
this.out.info(`Watcher: &C2Enabled`);
|
|
159
|
-
const resolver = new
|
|
175
|
+
const resolver = new PathResolver(config, { logger: this.out });
|
|
160
176
|
if (watch)
|
|
161
177
|
await resolver.watch(mode);
|
|
162
178
|
else
|
|
@@ -170,13 +186,13 @@ export class DepFlowCLI extends DebugUI {
|
|
|
170
186
|
}
|
|
171
187
|
}
|
|
172
188
|
async commandSync(command, args) {
|
|
173
|
-
this.out.group(Utils.newGroup('#FFB4DC'));
|
|
174
|
-
this.out.info(`Synchronizing configurations...`);
|
|
175
189
|
try {
|
|
190
|
+
this.out.group(Utils.newGroup('#FFB4DC'));
|
|
191
|
+
this.out.info(`Synchronizing configurations...`);
|
|
176
192
|
const useCDN = args.includes('--cdn');
|
|
177
193
|
const mode = useCDN ? 'cdn' : 'local';
|
|
178
194
|
const config = await Config.load(this.configPath);
|
|
179
|
-
const resolver = new
|
|
195
|
+
const resolver = new PathResolver(config, { logger: this.out });
|
|
180
196
|
const tsconfigFile = config.tsconfig;
|
|
181
197
|
const importMapFile = config.importmap;
|
|
182
198
|
if (tsconfigFile) {
|
|
@@ -196,7 +212,7 @@ export class DepFlowCLI extends DebugUI {
|
|
|
196
212
|
this.out.info(`&C2Successfully synced all configurations.`);
|
|
197
213
|
}
|
|
198
214
|
catch (error) {
|
|
199
|
-
this.out.error(`&C1Error during sync: ${error
|
|
215
|
+
this.out.error(`&C1Error during sync: ${error}`);
|
|
200
216
|
}
|
|
201
217
|
finally {
|
|
202
218
|
this.out.groupEnd();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DepFLowCLI.js","sourceRoot":"","sources":["../../src/cli/DepFLowCLI.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,
|
|
1
|
+
{"version":3,"file":"DepFLowCLI.js","sourceRoot":"","sources":["../../src/cli/DepFLowCLI.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,aAAa,MAAM,wCAAwC,CAAC;AACnE,OAAO,YAAY,MAAM,yCAAyC,CAAC;AACnE,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAC7C,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,aAAa,MAAM,wCAAwC,CAAC;AAEnE,MAAM,OAAO,UAAW,SAAQ,OAAO;IAGf;IAFD,WAAW,CAAS;IACvC,YACoB,aAAqB,cAAc;QACnD,KAAK,EAAE,CAAC;QADQ,eAAU,GAAV,UAAU,CAAyB;QAEnD,IAAI,CAAC,GAAG,GAAG,IAAI,MAAM,CAAC;YAClB,MAAM,EAAE,IAAI,CAAC,GAAG;YAChB,SAAS,EAAE,EAAE,gBAAgB,EAAE,GAAG,EAAE;SACvC,CAAC,C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AI,aAAa,EAAE,CAAC;gBAChB,MAAM,SAAS,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;gBAC9F,SAAS,CAAC,aAAa,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;gBAChD,MAAM,SAAS,CAAC,IAAI,EAAE,CAAC;YAC3B,CAAC;;gBAAM,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,qFAAqF,CAAC,CAAC;YAE5G,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAC;QAChE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,yBAAyB,KAAK,EAAE,CAAC,CAAC;QAAC,CAAC;gBAC7D,CAAC;YAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QAAC,CAAC;IACpC,CAAC;CACJ;AAED,eAAe,UAAU,CAAC"}
|
package/build/cli/bin.js
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { File } from "@netfeez/common-node";
|
|
2
3
|
import DepFlowCLI from "./DepFLowCLI.js";
|
|
3
4
|
import { Utils } from "../support/Utils.js";
|
|
4
|
-
import
|
|
5
|
-
function startupSchemaValidation(flowPath) {
|
|
6
|
-
const jsonSchema =
|
|
7
|
-
|
|
5
|
+
import Schemas from "../config/schemas.js";
|
|
6
|
+
async function startupSchemaValidation(flowPath) {
|
|
7
|
+
const jsonSchema = Schemas.Config.jsonSchema;
|
|
8
|
+
// Temporarily write the schema to the .depflow directory for validation purposes
|
|
9
|
+
// The vscode configuration was out for now, while ill enhance it we will use the $schema property in the depflow.json file to point to this schema
|
|
10
|
+
File.write(`.depflow/schema.json`, JSON.stringify(jsonSchema));
|
|
11
|
+
// Utils.addVscodeValidation(flowPath, jsonSchema);
|
|
8
12
|
}
|
|
9
13
|
const skip = 2;
|
|
10
|
-
const [commandName, ...
|
|
11
|
-
const
|
|
12
|
-
|
|
14
|
+
const [commandName, ...argsList] = process.argv.slice(skip);
|
|
15
|
+
const { args, flags } = Utils.extractFlags(argsList);
|
|
16
|
+
console.log(commandName, args, flags);
|
|
17
|
+
const flowTag = flags['--flow'] || flags['-f'] || [];
|
|
13
18
|
const flowPath = flowTag[0] || 'depflow.json';
|
|
14
19
|
const cli = new DepFlowCLI(flowPath);
|
|
15
|
-
startupSchemaValidation(flowPath);
|
|
16
|
-
console.log(flowPath);
|
|
20
|
+
await startupSchemaValidation(flowPath);
|
|
17
21
|
try {
|
|
18
22
|
if (commandName !== null) {
|
|
19
23
|
const command = cli.getCommand(commandName);
|
|
@@ -29,9 +33,9 @@ try {
|
|
|
29
33
|
cli.start();
|
|
30
34
|
}
|
|
31
35
|
catch (error) {
|
|
32
|
-
cli.out.error(`&C(
|
|
33
|
-
cli.out.error(`&C(
|
|
34
|
-
cli.out.error(`&C(
|
|
36
|
+
cli.out.error(`&C(#FFB4DC)╭─────────────────────────────────────────────`);
|
|
37
|
+
cli.out.error(`&C(#FFB4DC)│ &C1${error?.stack || error}`);
|
|
38
|
+
cli.out.error(`&C(#FFB4DC)╰─────────────────────────────────────────────`);
|
|
35
39
|
process.exit(1);
|
|
36
40
|
}
|
|
37
41
|
//# sourceMappingURL=bin.js.map
|
package/build/cli/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../../src/cli/bin.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../../src/cli/bin.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,OAAO,UAAU,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;A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AC,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;QACvD,CAAC;IACL,CAAC;;QAAM,GAAG,CAAC,KAAK,EAAE,CAAC;AACvB,CAAC;AAAC,OAAO,KAAU,EAAE,CAAC;IAClB,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,2DAA2D,CAAC,CAAC;IAC3E,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,mBAAmB,KAAK,EAAE,KAAK,IAAI,KAAK,EAAE,CAAC,CAAC;IAC1D,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,2DAA2D,CAAC,CAAC;IAC3E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACnB,CAAC"}
|
package/build/config/Config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Schemas from './schemas.js';
|
|
2
2
|
export declare class Config {
|
|
3
3
|
/**
|
|
4
4
|
* Loads the configuration from a file at the specified path.
|
|
@@ -22,7 +22,7 @@ export declare class Config {
|
|
|
22
22
|
static save(path: string, config: Config.ConfigToProcess): Promise<void>;
|
|
23
23
|
}
|
|
24
24
|
export declare namespace Config {
|
|
25
|
-
type Config = typeof
|
|
26
|
-
type ConfigToProcess = typeof
|
|
25
|
+
type Config = typeof Schemas.Config.infer;
|
|
26
|
+
type ConfigToProcess = typeof Schemas.Config.inferToProcess;
|
|
27
27
|
}
|
|
28
28
|
export default Config;
|
package/build/config/Config.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @license Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { File } from '@netfeez/common-node';
|
|
7
|
-
import
|
|
7
|
+
import Schemas from './schemas.js';
|
|
8
8
|
export class Config {
|
|
9
9
|
/**
|
|
10
10
|
* Loads the configuration from a file at the specified path.
|
|
@@ -17,14 +17,14 @@ export class Config {
|
|
|
17
17
|
*/
|
|
18
18
|
static async load(path) {
|
|
19
19
|
if (!await File.exists(path)) {
|
|
20
|
-
const defaults =
|
|
20
|
+
const defaults = Schemas.Config.processData({});
|
|
21
21
|
await Config.save(path, defaults);
|
|
22
22
|
return defaults;
|
|
23
23
|
}
|
|
24
24
|
else {
|
|
25
25
|
const content = await File.read(path, 'utf-8');
|
|
26
26
|
const json = JSON.parse(content);
|
|
27
|
-
const config =
|
|
27
|
+
const config = Schemas.Config.processData(json);
|
|
28
28
|
return config;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Logger } from '@netfeez/vterm';
|
|
2
2
|
import AliasCompiler from '../support/PathResolver/AliasCompiler.js';
|
|
3
|
+
import Schemas from './schemas.js';
|
|
3
4
|
export declare class ImportMap {
|
|
4
5
|
protected data: ImportMap.Data;
|
|
5
6
|
protected projectRoot: string;
|
|
@@ -28,9 +29,7 @@ export declare class ImportMap {
|
|
|
28
29
|
static load(projectRoot: string, filename: string, options?: ImportMap.Options): Promise<ImportMap>;
|
|
29
30
|
}
|
|
30
31
|
export declare namespace ImportMap {
|
|
31
|
-
|
|
32
|
-
imports: Record<string, string>;
|
|
33
|
-
}
|
|
32
|
+
type Data = Schemas.ImportMap['infer'];
|
|
34
33
|
interface Options {
|
|
35
34
|
logger?: Logger;
|
|
36
35
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import PATH from 'node:path';
|
|
2
2
|
import { Logger } from '@netfeez/vterm';
|
|
3
3
|
import { File, Path } from '@netfeez/common-node';
|
|
4
|
+
import Schemas from './schemas.js';
|
|
4
5
|
export class ImportMap {
|
|
5
6
|
data;
|
|
6
7
|
projectRoot;
|
|
@@ -27,9 +28,8 @@ export class ImportMap {
|
|
|
27
28
|
? aliasObj.targets.cdn
|
|
28
29
|
: aliasObj.targets.local;
|
|
29
30
|
if (target === aliasObj.targets.local) {
|
|
30
|
-
target =
|
|
31
|
-
|
|
32
|
-
target = `./${target}`;
|
|
31
|
+
target = Path.diff(this.projectRoot, target);
|
|
32
|
+
target = target.startsWith('/') ? target : `/${target}`;
|
|
33
33
|
target = Path.normalize(target);
|
|
34
34
|
}
|
|
35
35
|
if (aliasObj.isWildcard) {
|
|
@@ -46,11 +46,10 @@ export class ImportMap {
|
|
|
46
46
|
const logger = options.logger || new Logger({ name: 'IMP-MAP' });
|
|
47
47
|
const importMapPath = PATH.resolve(projectRoot, filename);
|
|
48
48
|
const folder = PATH.dirname(importMapPath);
|
|
49
|
-
|
|
50
|
-
await File.mkdir(folder, { recursive: true });
|
|
49
|
+
await File.ensureDir(folder);
|
|
51
50
|
const json = JSON.stringify(data, null, 4);
|
|
52
51
|
await File.write(importMapPath, json);
|
|
53
|
-
logger.log(`&
|
|
52
|
+
logger.log(`&C2Saved file &C4${filename}`);
|
|
54
53
|
}
|
|
55
54
|
/**
|
|
56
55
|
* Factory method: Loads, validates (or creates default), and returns an instance of the ImportMap class.
|
|
@@ -65,16 +64,16 @@ export class ImportMap {
|
|
|
65
64
|
static async load(projectRoot, filename, options = {}) {
|
|
66
65
|
const logger = options.logger || new Logger({ name: 'IMP-MAP' });
|
|
67
66
|
const importMapPath = PATH.resolve(projectRoot, filename);
|
|
68
|
-
let data
|
|
67
|
+
let data;
|
|
69
68
|
if (!await File.exists(importMapPath)) {
|
|
70
69
|
logger.warn(`&C3${filename} not found. Creating defaults...`);
|
|
71
|
-
|
|
72
|
-
await ImportMap.save(projectRoot, filename, data, { logger });
|
|
70
|
+
data = Schemas.ImportMap.processData({});
|
|
71
|
+
// await ImportMap.save(projectRoot, filename, data, { logger });
|
|
73
72
|
}
|
|
74
73
|
else {
|
|
75
74
|
const content = await File.read(importMapPath, 'utf-8');
|
|
76
75
|
const json = JSON.parse(content);
|
|
77
|
-
data = json;
|
|
76
|
+
data = Schemas.ImportMap.processData(json);
|
|
78
77
|
}
|
|
79
78
|
return new ImportMap(data, projectRoot, filename, { logger });
|
|
80
79
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImportMap.js","sourceRoot":"","sources":["../../src/config/ImportMap.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"ImportMap.js","sourceRoot":"","sources":["../../src/config/ImportMap.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAGlD,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,MAAM,OAAO,SAAS;IAIJ;IACA;IACA;IALJ,MAAM,CAAS;IAEzB,YACc,IAAoB,EACpB,WAAmB,EACnB,QAAgB,EAC1B,UAA6B,EAAE;QAHrB,SAAI,GAAJ,IAAI,CAAgB;QACpB,gBAAW,GAAX,WAAW,CAAQ;QACnB,aAAQ,GAAR,QAAQ,CAAQ;QAG1B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,IAAI,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;IACpE,CAAC;IAED;;;;;OAKG;IACI,aAAa,CAAC,OAAsC,EAAE,IAAqB;QAC9E,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAE/C,KAAK,MAAM,QAAQ,IAAI,OAAO,EAAE,CAAC;YAC7B,MAAM,GAAG,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;YAExE,IAAI,MAAM,GAAG,IAAI,KAA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AE,EAAE,MAAM,EAAE,CAAC,CAAC;IACpE,CAAC;CACJ;AAOD,eAAe,SAAS,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Logger } from '@netfeez/vterm';
|
|
2
|
-
import
|
|
2
|
+
import Schemas from "./schemas.js";
|
|
3
3
|
import AliasCompiler from '../support/PathResolver/AliasCompiler.js';
|
|
4
4
|
export declare class Tsconfig {
|
|
5
5
|
protected data: Tsconfig.Data;
|
|
@@ -49,7 +49,7 @@ export declare class Tsconfig {
|
|
|
49
49
|
static load(projectRoot: string, filename: string, options: Tsconfig.Options): Promise<Tsconfig>;
|
|
50
50
|
}
|
|
51
51
|
export declare namespace Tsconfig {
|
|
52
|
-
type Data =
|
|
52
|
+
type Data = Schemas.TsConfig['infer'];
|
|
53
53
|
interface Options {
|
|
54
54
|
logger?: Logger;
|
|
55
55
|
}
|