depflow 2.0.0 β†’ 2.0.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.
Files changed (2) hide show
  1. package/README.md +66 -55
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,89 +1,100 @@
1
- # πŸš€ Dependency Flow
1
+ # πŸš€ DepFlow (Dependency Flow)
2
2
 
3
- This project provides a lightweight, straightforward dependency manager that leverages Git repositories. It's designed for simplicity and efficiency, allowing you to manage project dependencies directly from their source repositories without the complexity of larger package managers.
3
+ **DepFlow** is a lightweight, high-performance dependency manager that leverages Git repositories and NPM packages to orchestrate your project's infrastructure. Designed for the **NetFeez** ecosystem, it allows you to manage dependencies directly from their source without the overhead of traditional package managers.
4
4
 
5
- This tool is actively used in real-world projects, which ensures it is continuously improved and enhanced with practical features based on actual usage.
5
+ Starting with **v2.0.0**, DepFlow introduces a schema-driven architecture that automatically configures your development environment, providing a seamless experience in editors like VSCode.
6
6
 
7
7
  ---
8
8
 
9
9
  # πŸ’Ύ Installation
10
10
 
11
- Install the Dependency Manager globally using **npm**:
11
+ Install DepFlow globally using **npm**:
12
12
 
13
13
  ```console
14
- npm install -g depflow
14
+ npm install -g @netfeez/depflow
15
15
  ```
16
16
 
17
- > [!NOTE]
18
- > A global installation (`-g`) makes the `dep` command available from any directory in your terminal.
17
+ > [!TIP]
18
+ > Global installation makes the `dep` command available everywhere. For version 2.0.0, ensure you are using the `@netfeez` scope.
19
19
 
20
20
  ---
21
21
 
22
22
  # πŸ’» CLI Usage
23
23
 
24
- You can interact with the dependency flow in two ways:
25
-
26
- 1. **Interactive Mode**: Run `dep` without any arguments to open an interactive command-line interface.
27
- 2. **Direct Command**: Execute commands directly, for example: `dep list`.
24
+ DepFlow offers a clean interface for managing your project's lifecycle:
28
25
 
29
26
  ### Commands
30
27
 
31
28
  | Command | Usage | Description |
32
29
  |---|---|---|
33
- | `list` | `dep list` | Lists all dependencies configured in `depFlow.json`. |
34
- | `add` | `dep add <repo_url> [name]` | Adds a new dependency to your configuration. |
35
- | `remove`| `dep remove <name_or_repo_url>` | Removes a dependency using its name or repository URL. |
36
- | `install`| `dep install [name...]`| Clones and sets up all dependencies, or specific ones. |
37
- | `uninstall`| `dep uninstall [name...]`| Removes the files of all, or specific, dependencies. |
30
+ | `sync` | `dep sync` | **(New)** Synchronizes `tsconfig.json` paths and `importmap` based on your config. |
31
+ | `install`| `dep install [name...]`| Clones, builds, and sets up all or specific dependencies. |
32
+ | `list` | `dep list` | Lists all dependencies configured in your project. |
33
+ | `add` | `dep add <repo_url> [name]` | Adds a new repository dependency to your configuration. |
34
+ | `remove`| `dep remove <name>` | Removes a dependency from the configuration. |
35
+ | `uninstall`| `dep uninstall [name...]`| Removes the local files of your dependencies. |
38
36
 
39
37
  ---
40
38
 
41
- # βš™οΈ Configuration File (`depFlow.json`)
42
-
43
- All dependencies are defined in a `depFlow.json` file located in your project's root directory. This file contains a JSON array of dependency objects.
39
+ # βš™οΈ Configuration File (`depflow.json`)
44
40
 
45
- ## Schema and Examples
41
+ The configuration has evolved from a simple array to a powerful object schema.
46
42
 
47
- Here’s a look at the structure of a `depFlow.json` file:
43
+ ## New Schema Structure
48
44
 
49
45
  ```json
50
- [
51
- {
52
- "name": "my-library",
53
- "repo": "https://github.com/user/my-library.git",
54
- "branch": "main",
55
- "builder": [ { "move": "libs/my-library"} ]
56
- },
57
- {
58
- "name": "another-dependency",
59
- "repo": "https://github.com/user/another.git",
60
- "builder": [
61
- { "run": "npm install" },
62
- { "run": [
63
- "npm run compile",
64
- "npm run normalize"
65
- ] }
66
- {
67
- "move": {
68
- "out": {
69
- "src/": "public/js/another-dep/",
70
- "assets/css/": "public/css/"
71
- }
46
+ {
47
+ "flowFolder": ".depflow",
48
+ "tsconfig": "tsconfig.json",
49
+ "importmap": "importmap.json",
50
+ "dependencies": [
51
+ {
52
+ "name": "my-library",
53
+ "repo": "https://github.com/user/my-library.git",
54
+ "tag": "main",
55
+ "builder": [
56
+ { "run": "npm install", "maxTimeMs": 10000 },
57
+ { "move": { "build": "web/logic/.lib/my-lib" } }
58
+ ],
59
+ "resolver": [
60
+ {
61
+ "alias": "my-lib",
62
+ "target": {
63
+ "local": "./web/logic/.lib/my-lib/index.js",
64
+ "cdn": "https://cdn.com/my-lib.js"
65
+ }
66
+ }
67
+ ]
72
68
  }
73
- }
74
69
  ]
75
- }
76
- ]
70
+ }
77
71
  ```
78
72
 
79
73
  ## Fields Explained
80
74
 
81
- * **`name`** (string): A unique identifier for the dependency. If you don't provide one with the `add` command, a name will be generated from the repository URL.
82
- * **`repo`** (string): The full HTTPS or SSH URL for the Git repository.
83
- * **`branch`** (string, optional): The name of the branch you want to clone. If omitted, the repository's default branch is used.
84
- * **`build`: an array to indicate a pipeline to build the repository.
85
- * **`builder[].run`** (string | string[]): defines a command or list of commands.
86
- * **`builder[].move`** (string | string[] | object, optional): Defines where the dependency's files should be placed.
87
- * **As a string**: The entire repository is cloned into this single path.
88
- * **As a string array**: The repository content is copied to each path in the array.
89
- * **As an object**: A map where keys are source paths within the repository and values are the destination paths in your project. You can use `'/'` as a key to refer to the repository's root.
75
+ ### Root Configuration
76
+ * **`flowFolder`** (string): The directory where DepFlow stores internal data (default: `.depflow`).
77
+ * **`tsconfig`** (string, optional): Path to your TypeScript config. When set, `dep sync` will automatically manage your `compilerOptions.paths`.
78
+ * **`importmap`** (string, optional): Path to your importmap file. When set, `dep sync` keeps your browser imports up to date.
79
+ * **`dependencies`** (array): Your list of Git-based dependencies.
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.
91
+
92
+ ---
93
+
94
+ # πŸš€ Migration to v2.0.0
95
+
96
+ To upgrade from v1:
97
+ 1. Wrap your existing array into a `{"dependencies": [...]}` object.
98
+ 2. Rename any `pathResolver` fields to `resolver`.
99
+ 3. Add the `$schema` field to enable VSCode autocompletion and validation.
100
+ 4. Run `dep sync` to initialize your environment.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "depflow",
3
3
  "description": "is a simple dependency manager based on github repositories",
4
- "version": "2.0.0",
4
+ "version": "2.0.1",
5
5
  "main": "build/cli/DepFlowCLI.js",
6
6
  "type": "module",
7
7
  "bin": {