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.
Files changed (2) hide show
  1. package/README.md +11 -7
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Monocrate
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/monocrate.svg)](https://www.npmjs.com/package/monocrate)
4
+ [![CI](https://github.com/imaman/monocrate/actions/workflows/ci.yml/badge.svg)](https://github.com/imaman/monocrate/actions/workflows/ci.yml)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](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 `dist/` directory to the output
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
- dist/ ← app's compiled code
88
+ <app files> ← app's publishable files
85
89
  deps/
86
90
  packages/
87
- utils/dist/ ← utils' compiled code (imports rewritten)
88
- core/dist/ ← core's compiled code (imports rewritten)
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 the `dist/` directory stays in the same relative position.
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
- - All packages must be compiled (have a `dist/` directory)
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monocrate",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "From monorepo to npm in one command",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",