monocrate 0.6.0 → 0.7.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/README.md +11 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Monocrate
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/monocrate)
|
|
4
|
+
[](https://github.com/imaman/monocrate/actions/workflows/ci.yml)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
3
7
|
From monorepo to npm in one command.
|
|
4
8
|
|
|
5
9
|
## Why
|
|
@@ -66,8 +70,8 @@ monocrate publish packages/sdk --mirror-to ../public-repo/packages
|
|
|
66
70
|
|
|
67
71
|
1. Discovers all packages in the monorepo via workspace configuration
|
|
68
72
|
2. Builds a dependency graph starting from your target package
|
|
69
|
-
3. Copies each package's `
|
|
70
|
-
4. Rewrites import statements from package names to relative paths
|
|
73
|
+
3. Copies each package's publishable files (determined by `npm pack`) to the output
|
|
74
|
+
4. Rewrites import statements from package names to relative paths (using `exports` or `main` fields)
|
|
71
75
|
5. Generates a `package.json` with merged third-party dependencies
|
|
72
76
|
|
|
73
77
|
### Output Structure
|
|
@@ -81,19 +85,19 @@ monorepo/
|
|
|
81
85
|
|
|
82
86
|
output/
|
|
83
87
|
package.json ← merged deps, in-repo refs removed
|
|
84
|
-
|
|
88
|
+
<app files> ← app's publishable files
|
|
85
89
|
deps/
|
|
86
90
|
packages/
|
|
87
|
-
utils/
|
|
88
|
-
core/
|
|
91
|
+
utils/ ← utils' publishable files (imports rewritten)
|
|
92
|
+
core/ ← core's publishable files (imports rewritten)
|
|
89
93
|
```
|
|
90
94
|
|
|
91
|
-
Entry points (`main`, `types`, `exports`) work unchanged because
|
|
95
|
+
Entry points (`main`, `types`, `exports`) work unchanged because each package's file structure stays in the same relative position.
|
|
92
96
|
|
|
93
97
|
## Requirements
|
|
94
98
|
|
|
95
99
|
- Node.js 20+
|
|
96
|
-
-
|
|
100
|
+
- Packages must have valid entry points (`exports` or `main` field in package.json)
|
|
97
101
|
- Monorepo must use npm, yarn, or pnpm workspaces
|
|
98
102
|
|
|
99
103
|
## Programmatic API
|