depflow 2.0.1 → 3.0.0-dev.1
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 +93 -57
- 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 +7 -6
- package/build/config/Tsconfig.js.map +1 -1
- package/build/config/schemas.d.ts +604 -51
- package/build/config/schemas.js +36 -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/Git.js +4 -12
- package/build/support/Git.js.map +1 -1
- package/build/support/PathResolver/AliasCompiler.d.ts +2 -2
- 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 +10 -0
- package/build/support/Utils.js +43 -0
- package/build/support/Utils.js.map +1 -1
- package/package.json +4 -4
- package/build/support/Dependency.d.ts +0 -109
- package/build/support/Dependency.js +0 -257
- 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,19 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import Logger, { DebugUI } from "@netfeez/vterm";
|
|
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;
|
|
14
15
|
constructor(configPath = 'depFlow.json') {
|
|
15
16
|
super();
|
|
16
17
|
this.configPath = configPath;
|
|
18
|
+
this.out = new Logger({
|
|
19
|
+
logger: this.out,
|
|
20
|
+
formatter: { maxMessageLength: 100 }
|
|
21
|
+
});
|
|
17
22
|
const absoluteConfigPath = path.resolve(process.cwd(), this.configPath);
|
|
18
23
|
this.projectRoot = path.dirname(absoluteConfigPath);
|
|
19
24
|
this.addCommand('add', this.commandAdd, { usage: 'dep add <repo_url> [name]', description: 'Add a dependency to the configuration file.' });
|
|
@@ -25,138 +30,169 @@ export class DepFlowCLI extends DebugUI {
|
|
|
25
30
|
this.addCommand('sync', this.commandSync, { usage: 'dep sync', description: 'Syncs depFlow.json with tsconfig.json and generates the importmap.' });
|
|
26
31
|
}
|
|
27
32
|
async commandAdd(command, args) {
|
|
28
|
-
this.out.info(`&C(255,180,220)╭──────────────────────────────────────────────────`);
|
|
29
|
-
this.out.info(`&C(255,180,220)│ Adding dependency...`);
|
|
30
|
-
let [repo, name] = args;
|
|
31
33
|
try {
|
|
34
|
+
let [repo, name] = args;
|
|
35
|
+
this.out.group(Utils.newGroup('#FFB4DC'));
|
|
36
|
+
this.out.info(`Adding dependency...`);
|
|
32
37
|
Validator.validateRepo(repo);
|
|
33
38
|
if (!name)
|
|
34
39
|
name = Utils.getRepoName(repo);
|
|
40
|
+
const dep = Schemas.GitDependency.processData({ name, repo });
|
|
35
41
|
const config = await Config.load(this.configPath);
|
|
36
|
-
const dep = schemas.dependency.processData({ name, repo });
|
|
37
42
|
config.dependencies.push(dep);
|
|
38
43
|
await Config.save(this.configPath, config);
|
|
39
|
-
this.out.info(
|
|
44
|
+
this.out.info(`Added dependency "${dep.name}".`);
|
|
40
45
|
}
|
|
41
46
|
catch (error) {
|
|
42
|
-
this.out.error(`&
|
|
47
|
+
this.out.error(`&C1${error}`);
|
|
43
48
|
}
|
|
44
49
|
finally {
|
|
45
|
-
this.out.
|
|
50
|
+
this.out.groupEnd();
|
|
46
51
|
}
|
|
47
52
|
}
|
|
48
53
|
async commandRemove(command, args) {
|
|
49
|
-
this.out.info(`&C(255,180,220)╭──────────────────────────────────────────────────`);
|
|
50
|
-
const [identifier] = args;
|
|
51
54
|
try {
|
|
55
|
+
const [identifier] = args;
|
|
56
|
+
this.out.group(Utils.newGroup('#FFB4DC'));
|
|
52
57
|
if (!identifier)
|
|
53
58
|
throw new Error('Usage: dep remove <name> | <repo_url>');
|
|
54
59
|
const config = await Config.load(this.configPath);
|
|
55
60
|
config.dependencies = config.dependencies.filter(dep => dep.name !== identifier && dep.repo !== identifier);
|
|
56
61
|
await Config.save(this.configPath, config);
|
|
57
|
-
this.out.info(
|
|
62
|
+
this.out.info(`Removed dependency "${identifier}".`);
|
|
58
63
|
}
|
|
59
64
|
catch (error) {
|
|
60
|
-
this.out.error(`&
|
|
65
|
+
this.out.error(`&C1${error}`);
|
|
61
66
|
}
|
|
62
67
|
finally {
|
|
63
|
-
this.out.
|
|
68
|
+
this.out.groupEnd();
|
|
64
69
|
}
|
|
65
70
|
}
|
|
66
71
|
async commandInstall(command, args) {
|
|
67
|
-
this.out.info(`&C(255,180,220)╭──────────────────────────────────────────────────`);
|
|
68
72
|
try {
|
|
73
|
+
this.out.group(Utils.newGroup('#FFB4DC'));
|
|
69
74
|
const config = await Config.load(this.configPath);
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
75
|
+
const gitDependencies = config.dependencies;
|
|
76
|
+
if (gitDependencies.length === 0)
|
|
72
77
|
throw new Error(args.length > 0 ? 'Specified dependencies not found.' : 'No dependencies to install.');
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
this.out.info(`&C5Installing dependencies...`);
|
|
79
|
+
for (const dep of gitDependencies) {
|
|
80
|
+
try {
|
|
81
|
+
this.out.group(Utils.newGroup('#FFB4DC'));
|
|
82
|
+
this.out.info(`&C5Installing &C6"${dep.name}" &C5from &C6${dep.repo}&C5...`);
|
|
83
|
+
this.out.line();
|
|
84
|
+
const dependency = new GitDependency(config.flowFolder, dep, this.out);
|
|
85
|
+
await dependency.install();
|
|
86
|
+
this.out.line();
|
|
87
|
+
this.out.info(`&C2Installed &C6${dep.name}.`);
|
|
88
|
+
}
|
|
89
|
+
finally {
|
|
90
|
+
this.out.groupEnd();
|
|
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
|
+
}
|
|
79
107
|
}
|
|
108
|
+
await this.commandSync('sync', []);
|
|
80
109
|
}
|
|
81
110
|
catch (error) {
|
|
82
|
-
this.out.error(`&
|
|
111
|
+
this.out.error(`&C1${error}`);
|
|
83
112
|
}
|
|
84
113
|
finally {
|
|
85
|
-
this.out.
|
|
114
|
+
this.out.groupEnd();
|
|
86
115
|
}
|
|
87
|
-
this.commandSync('sync', []);
|
|
88
116
|
}
|
|
89
117
|
async uninstall(command, args) {
|
|
90
|
-
this.out.info(`&C(255,180,220)╭──────────────────────────────────────────────────`);
|
|
91
118
|
try {
|
|
119
|
+
this.out.group(Utils.newGroup('#FFB4DC'));
|
|
92
120
|
const config = await Config.load(this.configPath);
|
|
93
121
|
const dependencies = config.dependencies;
|
|
94
122
|
if (dependencies.length === 0)
|
|
95
123
|
throw new Error(args.length > 0 ? 'Specified dependencies not found.' : 'No dependencies to uninstall.');
|
|
96
124
|
for (const dep of dependencies) {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
125
|
+
try {
|
|
126
|
+
this.out.group(Utils.newGroup('#FFB4DC'));
|
|
127
|
+
this.out.info(`&C1Uninstalling "${dep.name}" from "${dep.repo}"...`);
|
|
128
|
+
this.out.line();
|
|
129
|
+
const dependency = new GitDependency(config.flowFolder, dep, this.out);
|
|
130
|
+
await dependency.uninstall();
|
|
131
|
+
this.out.line();
|
|
132
|
+
this.out.info(`Uninstalled "${dep.name}".`);
|
|
133
|
+
this.out.groupEnd();
|
|
134
|
+
}
|
|
135
|
+
finally {
|
|
136
|
+
this.out.groupEnd();
|
|
137
|
+
}
|
|
102
138
|
}
|
|
103
139
|
}
|
|
104
140
|
catch (error) {
|
|
105
|
-
this.out.error(`&
|
|
141
|
+
this.out.error(`&C1${error}`);
|
|
106
142
|
}
|
|
107
143
|
finally {
|
|
108
|
-
this.out.
|
|
144
|
+
this.out.groupEnd();
|
|
109
145
|
}
|
|
110
146
|
}
|
|
111
147
|
async list(command, args) {
|
|
112
|
-
this.out.
|
|
148
|
+
this.out.group(Utils.newGroup('#FFB4DC'));
|
|
113
149
|
try {
|
|
114
150
|
const config = await Config.load(this.configPath);
|
|
115
151
|
if (config.dependencies.length === 0) {
|
|
116
|
-
this.out.info(
|
|
152
|
+
this.out.info(`No dependencies found.`);
|
|
117
153
|
}
|
|
118
154
|
for (const dep of config.dependencies) {
|
|
119
|
-
this.out.info(`&
|
|
155
|
+
this.out.info(`&C6${dep.name} &C7from &C2${dep.repo}`);
|
|
120
156
|
}
|
|
121
157
|
}
|
|
122
158
|
catch (error) {
|
|
123
|
-
this.out.error(`&
|
|
159
|
+
this.out.error(`&C1${error}`);
|
|
124
160
|
}
|
|
125
161
|
finally {
|
|
126
|
-
this.out.
|
|
162
|
+
this.out.groupEnd();
|
|
127
163
|
}
|
|
128
164
|
}
|
|
129
165
|
async rewritePaths(command, args) {
|
|
130
|
-
this.out.
|
|
166
|
+
this.out.group(Utils.newGroup('#FFB4DC'));
|
|
131
167
|
try {
|
|
132
168
|
const config = await Config.load(this.configPath);
|
|
133
169
|
const watch = args.includes('--watch') || args.includes('-w');
|
|
134
170
|
const useCDN = args.includes('--cdn');
|
|
135
171
|
const mode = useCDN ? 'cdn' : 'local';
|
|
136
|
-
this.out.info(
|
|
172
|
+
this.out.info(`Mode: &C3${useCDN ? 'CDN' : 'Local'}`);
|
|
137
173
|
if (watch)
|
|
138
|
-
this.out.info(
|
|
139
|
-
const resolver = new
|
|
174
|
+
this.out.info(`Watcher: &C2Enabled`);
|
|
175
|
+
const resolver = new PathResolver(config, { logger: this.out });
|
|
140
176
|
if (watch)
|
|
141
177
|
await resolver.watch(mode);
|
|
142
178
|
else
|
|
143
179
|
await resolver.rewritePaths(mode);
|
|
144
180
|
}
|
|
145
181
|
catch (error) {
|
|
146
|
-
this.out.error(`&
|
|
182
|
+
this.out.error(`&C1${error.message || error}`);
|
|
147
183
|
}
|
|
148
184
|
finally {
|
|
149
|
-
this.out.
|
|
185
|
+
this.out.groupEnd();
|
|
150
186
|
}
|
|
151
187
|
}
|
|
152
188
|
async commandSync(command, args) {
|
|
153
|
-
this.out.info(`&C(255,180,220)╭──────────────────────────────────────────────────`);
|
|
154
|
-
this.out.info(`&C(255,180,220)│ Synchronizing configurations...`);
|
|
155
189
|
try {
|
|
190
|
+
this.out.group(Utils.newGroup('#FFB4DC'));
|
|
191
|
+
this.out.info(`Synchronizing configurations...`);
|
|
156
192
|
const useCDN = args.includes('--cdn');
|
|
157
193
|
const mode = useCDN ? 'cdn' : 'local';
|
|
158
194
|
const config = await Config.load(this.configPath);
|
|
159
|
-
const resolver = new
|
|
195
|
+
const resolver = new PathResolver(config, { logger: this.out });
|
|
160
196
|
const tsconfigFile = config.tsconfig;
|
|
161
197
|
const importMapFile = config.importmap;
|
|
162
198
|
if (tsconfigFile) {
|
|
@@ -165,21 +201,21 @@ export class DepFlowCLI extends DebugUI {
|
|
|
165
201
|
await tsconfig.save();
|
|
166
202
|
}
|
|
167
203
|
else
|
|
168
|
-
this.out.warn(
|
|
204
|
+
this.out.warn(`No tsconfig file specified in configuration. Skipping tsconfig synchronization.`);
|
|
169
205
|
if (importMapFile) {
|
|
170
206
|
const importmap = await ImportMap.load(this.projectRoot, importMapFile, { logger: this.out });
|
|
171
207
|
importmap.updateImports(resolver.aliases, mode);
|
|
172
208
|
await importmap.save();
|
|
173
209
|
}
|
|
174
210
|
else
|
|
175
|
-
this.out.warn(
|
|
176
|
-
this.out.info(`&
|
|
211
|
+
this.out.warn(`No import map file specified in configuration. Skipping import map synchronization.`);
|
|
212
|
+
this.out.info(`&C2Successfully synced all configurations.`);
|
|
177
213
|
}
|
|
178
214
|
catch (error) {
|
|
179
|
-
this.out.error(`&
|
|
215
|
+
this.out.error(`&C1Error during sync: ${error}`);
|
|
180
216
|
}
|
|
181
217
|
finally {
|
|
182
|
-
this.out.
|
|
218
|
+
this.out.groupEnd();
|
|
183
219
|
}
|
|
184
220
|
}
|
|
185
221
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DepFLowCLI.js","sourceRoot":"","sources":["../../src/cli/DepFLowCLI.ts"],"names":[],"mappings":"AAAA,
|
|
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,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AAM,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,iFAAiF,CAAC,CAAC;YACxG,IAAI,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,MA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AAG,CAAC,KAAK,CAAC,oBAAoB,WAAW,EAAE,CAAC,CAAC;YACjD,GAAG,CAAC,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;
|