monocrate 0.11.0 → 0.13.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 (162) hide show
  1. package/README.md +171 -92
  2. package/dist/{collect-package-locations.d.ts → src/collect-package-locations.d.ts} +2 -0
  3. package/dist/src/collect-package-locations.d.ts.map +1 -0
  4. package/dist/{collect-package-locations.js → src/collect-package-locations.js} +4 -1
  5. package/dist/src/collect-package-locations.js.map +1 -0
  6. package/dist/src/compute-package-closure.d.ts.map +1 -0
  7. package/dist/{compute-package-closure.js → src/compute-package-closure.js} +3 -0
  8. package/dist/src/compute-package-closure.js.map +1 -0
  9. package/dist/src/file-copier.d.ts.map +1 -0
  10. package/dist/src/file-copier.js.map +1 -0
  11. package/dist/src/get-files-to-pack.d.ts.map +1 -0
  12. package/dist/src/get-files-to-pack.js.map +1 -0
  13. package/dist/src/import-rewriter.d.ts +16 -0
  14. package/dist/src/import-rewriter.d.ts.map +1 -0
  15. package/dist/{import-rewriter.js → src/import-rewriter.js} +15 -6
  16. package/dist/src/import-rewriter.js.map +1 -0
  17. package/dist/src/index.d.ts.map +1 -0
  18. package/dist/src/index.js.map +1 -0
  19. package/dist/src/main.d.ts.map +1 -0
  20. package/dist/src/main.js.map +1 -0
  21. package/dist/src/mirror-sources.d.ts.map +1 -0
  22. package/dist/src/mirror-sources.js.map +1 -0
  23. package/dist/src/monocrate-cli.d.ts.map +1 -0
  24. package/dist/{monocrate-cli.js → src/monocrate-cli.js} +19 -3
  25. package/dist/src/monocrate-cli.js.map +1 -0
  26. package/dist/{monocrate-options.d.ts → src/monocrate-options.d.ts} +11 -6
  27. package/dist/src/monocrate-options.d.ts.map +1 -0
  28. package/dist/src/monocrate-options.js.map +1 -0
  29. package/dist/{monocrate-result.d.ts → src/monocrate-result.d.ts} +5 -2
  30. package/dist/src/monocrate-result.d.ts.map +1 -0
  31. package/dist/{monocrate-result.js.map → src/monocrate-result.js.map} +1 -1
  32. package/dist/src/monocrate.d.ts.map +1 -0
  33. package/dist/{monocrate.js → src/monocrate.js} +19 -19
  34. package/dist/src/monocrate.js.map +1 -0
  35. package/dist/src/name-mangler.d.ts.map +1 -0
  36. package/dist/src/name-mangler.js.map +1 -0
  37. package/dist/src/npm-client.d.ts.map +1 -0
  38. package/dist/src/npm-client.js.map +1 -0
  39. package/dist/{package-assembler.d.ts → src/package-assembler.d.ts} +2 -1
  40. package/dist/src/package-assembler.d.ts.map +1 -0
  41. package/dist/{package-assembler.js → src/package-assembler.js} +21 -7
  42. package/dist/src/package-assembler.js.map +1 -0
  43. package/dist/src/package-closure.d.ts.map +1 -0
  44. package/dist/{package-closure.js.map → src/package-closure.js.map} +1 -1
  45. package/dist/{package-json.d.ts → src/package-json.d.ts} +1 -0
  46. package/dist/src/package-json.d.ts.map +1 -0
  47. package/dist/{package-json.js → src/package-json.js} +1 -0
  48. package/dist/src/package-json.js.map +1 -0
  49. package/dist/{package-location.d.ts → src/package-location.d.ts} +1 -1
  50. package/dist/src/package-location.d.ts.map +1 -0
  51. package/dist/{package-location.js.map → src/package-location.js.map} +1 -1
  52. package/dist/src/paths.d.ts.map +1 -0
  53. package/dist/src/paths.js.map +1 -0
  54. package/dist/src/publish.d.ts.map +1 -0
  55. package/dist/src/publish.js.map +1 -0
  56. package/dist/{repo-explorer.d.ts → src/repo-explorer.d.ts} +1 -1
  57. package/dist/src/repo-explorer.d.ts.map +1 -0
  58. package/dist/{repo-explorer.js → src/repo-explorer.js} +33 -30
  59. package/dist/src/repo-explorer.js.map +1 -0
  60. package/dist/{resolve-version.d.ts → src/resolve-version.d.ts} +2 -1
  61. package/dist/src/resolve-version.d.ts.map +1 -0
  62. package/dist/{resolve-version.js → src/resolve-version.js} +18 -1
  63. package/dist/src/resolve-version.js.map +1 -0
  64. package/dist/src/rewrite-package-json.d.ts.map +1 -0
  65. package/dist/{rewrite-package-json.js → src/rewrite-package-json.js} +7 -0
  66. package/dist/src/rewrite-package-json.js.map +1 -0
  67. package/dist/src/run-npm.d.ts.map +1 -0
  68. package/dist/src/run-npm.js.map +1 -0
  69. package/dist/src/validate-esm.d.ts +10 -0
  70. package/dist/src/validate-esm.d.ts.map +1 -0
  71. package/dist/src/validate-esm.js +30 -0
  72. package/dist/src/validate-esm.js.map +1 -0
  73. package/dist/src/validate-publish-names.d.ts.map +1 -0
  74. package/dist/src/validate-publish-names.js +12 -0
  75. package/dist/src/validate-publish-names.js.map +1 -0
  76. package/dist/src/version-specifier.d.ts +10 -0
  77. package/dist/src/version-specifier.d.ts.map +1 -0
  78. package/dist/{version-specifier.js → src/version-specifier.js} +2 -5
  79. package/dist/src/version-specifier.js.map +1 -0
  80. package/package.json +18 -16
  81. package/dist/collect-package-locations.d.ts.map +0 -1
  82. package/dist/collect-package-locations.js.map +0 -1
  83. package/dist/compute-package-closure.d.ts.map +0 -1
  84. package/dist/compute-package-closure.js.map +0 -1
  85. package/dist/file-copier.d.ts.map +0 -1
  86. package/dist/file-copier.js.map +0 -1
  87. package/dist/get-files-to-pack.d.ts.map +0 -1
  88. package/dist/get-files-to-pack.js.map +0 -1
  89. package/dist/import-rewriter.d.ts +0 -12
  90. package/dist/import-rewriter.d.ts.map +0 -1
  91. package/dist/import-rewriter.js.map +0 -1
  92. package/dist/index.d.ts.map +0 -1
  93. package/dist/index.js.map +0 -1
  94. package/dist/main.d.ts.map +0 -1
  95. package/dist/main.js.map +0 -1
  96. package/dist/mirror-sources.d.ts.map +0 -1
  97. package/dist/mirror-sources.js.map +0 -1
  98. package/dist/monocrate-cli.d.ts.map +0 -1
  99. package/dist/monocrate-cli.js.map +0 -1
  100. package/dist/monocrate-options.d.ts.map +0 -1
  101. package/dist/monocrate-options.js.map +0 -1
  102. package/dist/monocrate-result.d.ts.map +0 -1
  103. package/dist/monocrate.d.ts.map +0 -1
  104. package/dist/monocrate.js.map +0 -1
  105. package/dist/name-mangler.d.ts.map +0 -1
  106. package/dist/name-mangler.js.map +0 -1
  107. package/dist/npm-client.d.ts.map +0 -1
  108. package/dist/npm-client.js.map +0 -1
  109. package/dist/package-assembler.d.ts.map +0 -1
  110. package/dist/package-assembler.js.map +0 -1
  111. package/dist/package-closure.d.ts.map +0 -1
  112. package/dist/package-json.d.ts.map +0 -1
  113. package/dist/package-json.js.map +0 -1
  114. package/dist/package-location.d.ts.map +0 -1
  115. package/dist/paths.d.ts.map +0 -1
  116. package/dist/paths.js.map +0 -1
  117. package/dist/publish.d.ts.map +0 -1
  118. package/dist/publish.js.map +0 -1
  119. package/dist/repo-explorer.d.ts.map +0 -1
  120. package/dist/repo-explorer.js.map +0 -1
  121. package/dist/resolve-version.d.ts.map +0 -1
  122. package/dist/resolve-version.js.map +0 -1
  123. package/dist/rewrite-package-json.d.ts.map +0 -1
  124. package/dist/rewrite-package-json.js.map +0 -1
  125. package/dist/run-npm.d.ts.map +0 -1
  126. package/dist/run-npm.js.map +0 -1
  127. package/dist/validate-publish-names.d.ts.map +0 -1
  128. package/dist/validate-publish-names.js +0 -11
  129. package/dist/validate-publish-names.js.map +0 -1
  130. package/dist/version-specifier.d.ts +0 -8
  131. package/dist/version-specifier.d.ts.map +0 -1
  132. package/dist/version-specifier.js.map +0 -1
  133. /package/dist/{compute-package-closure.d.ts → src/compute-package-closure.d.ts} +0 -0
  134. /package/dist/{file-copier.d.ts → src/file-copier.d.ts} +0 -0
  135. /package/dist/{file-copier.js → src/file-copier.js} +0 -0
  136. /package/dist/{get-files-to-pack.d.ts → src/get-files-to-pack.d.ts} +0 -0
  137. /package/dist/{get-files-to-pack.js → src/get-files-to-pack.js} +0 -0
  138. /package/dist/{index.d.ts → src/index.d.ts} +0 -0
  139. /package/dist/{index.js → src/index.js} +0 -0
  140. /package/dist/{main.d.ts → src/main.d.ts} +0 -0
  141. /package/dist/{main.js → src/main.js} +0 -0
  142. /package/dist/{mirror-sources.d.ts → src/mirror-sources.d.ts} +0 -0
  143. /package/dist/{mirror-sources.js → src/mirror-sources.js} +0 -0
  144. /package/dist/{monocrate-cli.d.ts → src/monocrate-cli.d.ts} +0 -0
  145. /package/dist/{monocrate-options.js → src/monocrate-options.js} +0 -0
  146. /package/dist/{monocrate-result.js → src/monocrate-result.js} +0 -0
  147. /package/dist/{monocrate.d.ts → src/monocrate.d.ts} +0 -0
  148. /package/dist/{name-mangler.d.ts → src/name-mangler.d.ts} +0 -0
  149. /package/dist/{name-mangler.js → src/name-mangler.js} +0 -0
  150. /package/dist/{npm-client.d.ts → src/npm-client.d.ts} +0 -0
  151. /package/dist/{npm-client.js → src/npm-client.js} +0 -0
  152. /package/dist/{package-closure.d.ts → src/package-closure.d.ts} +0 -0
  153. /package/dist/{package-closure.js → src/package-closure.js} +0 -0
  154. /package/dist/{package-location.js → src/package-location.js} +0 -0
  155. /package/dist/{paths.d.ts → src/paths.d.ts} +0 -0
  156. /package/dist/{paths.js → src/paths.js} +0 -0
  157. /package/dist/{publish.d.ts → src/publish.d.ts} +0 -0
  158. /package/dist/{publish.js → src/publish.js} +0 -0
  159. /package/dist/{rewrite-package-json.d.ts → src/rewrite-package-json.d.ts} +0 -0
  160. /package/dist/{run-npm.d.ts → src/run-npm.d.ts} +0 -0
  161. /package/dist/{run-npm.js → src/run-npm.js} +0 -0
  162. /package/dist/{validate-publish-names.d.ts → src/validate-publish-names.d.ts} +0 -0
package/README.md CHANGED
@@ -1,100 +1,150 @@
1
1
  # monocrate
2
2
 
3
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)
4
+ [![CI](https://github.com/moojo-tech/monocrate/actions/workflows/ci.yml/badge.svg)](https://github.com/moojo-tech/monocrate/actions/workflows/ci.yml)
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
6
 
7
- Because publishing from a monorepo should take seconds, not days.
7
+ *Monorepos? Great. Publishing from a monorepo? Comically hard.*
8
8
 
9
9
  ## The Problem
10
10
 
11
- You have a monorepo, you are really proud of `@acme/my-awesome-package` and you want to make it open source. The package's main file, `packages/my-awesome-package/src/index.ts`, presumably looks something like this:
11
+ Consider `@acme/my-awesome-package`, which imports `@acme/internal-utils`, a workspace dependency.
12
12
 
13
+ Now you want to publish it.
13
14
 
14
- ```typescript
15
- // Reusing validation logic from elsewhere in the monorepo
16
- import { validateUserInput } from '@acme/internal-utils'
15
+ - **Naive approach**: `npm publish` produces an uninstallable package - `@acme/internal-utils` was never published.
16
+ - **Publish-all approach** (e.g., [Lerna](https://lerna.js.org/)): Publishes every internal dependency. Now your _internal_ `@acme/internal-utils` is a permanent public API - rename a function there, break consumers you never intended to have.
17
+ - **Bundler approach** (e.g., [esbuild](https://esbuild.github.io/)): Produces a self-contained blob, but types and sourcemaps break, and consumers can't tree-shake.
17
18
 
18
- export function processData(data: unknown) {
19
- const validated = validateUserInput(data)
20
- // ...
21
- }
22
- ```
19
+ ## The Solution
23
20
 
24
- When you publish, things look great:
21
+ [monocrate](https://www.npmjs.com/package/monocrate) is a publishing CLI that gets this right. It produces a single
22
+ publishable directory containing everything needed from your package and its in-repo dependencies. Essentially, it
23
+ produces a standard npm package that looks like you hand-crafted it for publication.
25
24
 
26
- ```bash
27
- $ cd packages/my-awesome-package
28
- $ npm publish
29
- npm notice
30
- npm notice 📦 @acme/my-awesome-package@1.0.0
31
- npm notice Tarball Contents
32
- npm notice 4.4kB README.md
33
- npm notice 9.1kB dist/index.js
34
- ...
35
- npm notice
36
- npm notice Publishing to https://registry.npmjs.org/ with tag latest and public access
37
-
38
- + @acme/my-awesome-package@1.0.0
39
- ```
25
+ - 📦 Consumers get one package with exactly the code they need
26
+ - 🔒 Internal packages remain unpublished
27
+ - Tree-shaking, sourcemaps, and types all work
40
28
 
41
- But when you try to install it, you discover it's broken:
29
+ ### Quickstart
42
30
 
43
31
  ```bash
44
- $ npm install @acme/my-awesome-package
45
- npm error code E404
46
- npm error 404 Not Found - GET https://registry.npmjs.org/@acme%2finternal-utils - Not found
47
- npm error 404
48
- npm error 404 '@acme/internal-utils@1.0.0' is not in this registry.
32
+ # Install
33
+ pnpm add --save-dev monocrate
34
+ # or: yarn add --dev monocrate
35
+ # or: npm install --save-dev monocrate
36
+
37
+ # Build (monocrate publishes, it doesn't build)
38
+ npm run build
39
+
40
+ # Publish
41
+ npx monocrate packages/my-awesome-package --bump patch
42
+
43
+ # Or use --dry-run to do everything short of publishing
44
+ npx monocrate packages/my-awesome-package --dry-run --output-dir /tmp/inspect --bump patch
49
45
  ```
50
46
 
51
- This is a big 🚨 oh-no 🚨 moment. What are your options?
47
+ > **⚠️ ESM only** monocrate requires ES modules and rejects CommonJS packages. If your monorepo uses CommonJS, consider [migrating to ESM](https://nodejs.org/api/esm.html) so that you can use monocrate.
52
48
 
53
- In theory, you could:
54
- - ...bundle with esbuild, rollup, and similar tools but tree-shaking breaks for consumers, source maps need a lot of attention to get right, and good luck getting those TypeScript types (.d.ts files) bundled.
55
- - ...manually create the right directory structure, replacing all the imports with relative paths. You will manage to pull it off once, but that's definitely not sustainable.
56
- - ...use a tool such as `lerna` which publishes every internal dependency as its own public package, but now `@acme/internal-utils` becomes a permanently published API you're committed to, and your internal refactoring freedom is gone.
49
+ ### What Gets Published
57
50
 
51
+ Given this monorepo structure:
52
+ ```
53
+ /path/to/my-monorepo/
54
+ └── packages/
55
+ ├── my-awesome-package/
56
+ │ ├── package.json # name: @acme/my-awesome-package
57
+ │ └── src/
58
+ │ └── index.ts # import ... from '@acme/internal-utils'
59
+ └── internal-utils/
60
+ ├── package.json # name: @acme/internal-utils (private)
61
+ └── src/
62
+ └── index.ts
63
+ ```
58
64
 
59
- ## The Solution
65
+ Running `npx monocrate packages/my-awesome-package` produces:
66
+ ```
67
+ /tmp/monocrate-xxxxxx/
68
+ └── packages/
69
+ └── my-awesome-package/ # preserves the package's path in the monorepo
70
+ ├── package.json # name: "@acme/my-awesome-package", version: "1.3.0" (the new resolved version)
71
+ ├── dist/
72
+ │ └── index.js # rewritten:
73
+ │ # import ... from '../deps/__acme__internal-utils/dist/index.js'
74
+ └── deps/
75
+ └── __acme__internal-utils/ # mangled package name, exact notation may vary.
76
+ └── dist/
77
+ └── index.js
78
+ ```
60
79
 
61
- Enter monocrate. It collects your package and its transitive internal dependencies into a single publishable unit. It handles subpath imports, dynamic imports, and TypeScript's module resolution rules correctly. Your internal packages stay private. Consumers install one package. Tree-shaking works. Sourcemaps work. Types work.
80
+ The `deps/` directory is where the files of in-repo dependencies get embedded. Each dependency is placed under a
81
+ mangled version of its package name. This avoids name collisions regardless of where packages live in the monorepo.
62
82
 
83
+ ### Version Resolution
63
84
 
64
- ## Usage
85
+ `monocrate` uses **registry-based versioning**: it queries the registry for the latest published version and bumps it
86
+ according to your `--bump` flag (`patch`, `minor`, `major`). Your source `package.json` is never modified.
65
87
 
66
- > **Note:** Monocrate is a publishing tool, not a build tool. If you have a build script, run it first:
67
- > ```bash
68
- > npm run build
69
- > ```
88
+ This means you don't need to maintain version numbers in your source code. The registry is the versioning source of
89
+ truth, and `monocrate` computes the next version at publish time. Of course, if an exact version is specified
90
+ (`--bump 1.7.9`) it is used as-is.
70
91
 
71
- Once the package is built, you can run monocrate:
92
+ For first-time publishing (when the package doesn't exist in the registry yet), `monocrate` treats the current version
93
+ as `0.0.0` and applies the bump—resulting in `0.0.1` for patch, `0.1.0` for minor (the default), or `1.0.0` for major.
94
+
95
+ If the version to publish to is already set in the package's `package.json` file (via `npm version`, Changesets, Lerna,
96
+ etc.), you can use `--bump package` to read the version directly from there:
72
97
 
73
98
  ```bash
74
- # Publish a package, patch bumping its version
75
- npx monocrate packages/my-awesome-package --bump patch
99
+ npm version minor --no-git-tag-version # Sets version in package.json
100
+ npx monocrate . --bump package # Uses that version
101
+ ```
76
102
 
77
- # Use --dry-run to run in "prepare" mode: do everything but stop short of publishing to the registry
78
- npx monocrate packages/my-awesome-package --output-dir /tmp/inspect --bump patch --dry-run
103
+ ## Examples
79
104
 
80
- # --bump defaults to "minor", so these two are identical:
105
+ ```bash
106
+ # --bump defaults to "minor", so these two are equivalent:
81
107
  npx monocrate packages/my-awesome-package --bump minor
82
108
  npx monocrate packages/my-awesome-package
83
109
 
84
110
  # Explicit version
85
111
  npx monocrate packages/my-awesome-package --bump 2.3.0
112
+
113
+ # Package location is resolved relative to CWD
114
+ cd /path/to/my-monorepo/packages
115
+ npx monocrate my-awesome-package --bump 2.3.0
116
+ ```
117
+
118
+ ## Programmatic API
119
+
120
+ For custom build steps, or integration with other tooling, you can use `monocrate` as a library instead of invoking the
121
+ CLI:
122
+
123
+ ```typescript
124
+ import { monocrate } from 'monocrate'
125
+
126
+ const result = await monocrate({
127
+ pathToSubjectPackages: ['packages/my-awesome-package'],
128
+ publish: true,
129
+ bump: 'minor',
130
+ cwd: process.cwd()
131
+ })
132
+
133
+ console.log(result.summaries[0].version) // '1.3.0'
86
134
  ```
87
135
 
88
- > **Note:** Monocrate does not modify your source code. Bump strategies are applied to the package's most recent version on the registry, not the version in your local `package.json`.
136
+ The above snippet is the programmatic equivalent of `npx monocrate packages/my-awesome-package --bump minor`.
137
+
138
+ ## Advanced Features
89
139
 
90
140
  ### Custom Publish Name
91
141
 
92
- Publish `@acme/my-awesome-package` as `best-package-ever` without doing a repo-wide renaming:
142
+ Sometimes your internal package name doesn't match the name you want on npm. Add a `monocrate.publishName` field to
143
+ your `package.json` to publish under a different name without renaming the package across your monorepo:
93
144
 
94
145
  ```json
95
146
  {
96
147
  "name": "@acme/my-awesome-package",
97
- ...
98
148
  "monocrate": {
99
149
  "publishName": "best-package-ever"
100
150
  }
@@ -103,41 +153,79 @@ Publish `@acme/my-awesome-package` as `best-package-ever` without doing a repo-w
103
153
 
104
154
  ### Mirroring to a Public Repo
105
155
 
106
- Want to open-source your package while keeping your monorepo private? Use `--mirror-to` to copy the package and its internal dependencies to a separate public repository:
156
+ Want to open-source your package while keeping your monorepo private? Use `--mirror-to` to copy the package and its
157
+ in-repo dependencies to a separate public repository:
107
158
 
108
159
  ```bash
109
160
  npx monocrate packages/my-awesome-package --mirror-to ../public-repo
110
161
  ```
111
162
 
112
- This way, your public repo is self-contained—no dangling references to internal packages. Contributors can clone and work on your package.
163
+ This way, your public repo stays in sync with what you publish—all necessary packages included. Contributors can
164
+ clone and work on your package.
113
165
 
114
- Only committed files (from `git HEAD`) are mirrored; fails if untracked files exist.
166
+ Requires a clean working tree. Only committed files (from `git HEAD`) are mirrored.
115
167
 
116
168
  ### Multiple Packages
117
169
 
118
- Publish several packages together with the same version:
170
+ If you have several public packages in your monorepo, publish them in one go by listing multiple directories:
119
171
 
120
172
  ```bash
121
- npx monocrate packages/lib-a packages/lib-b --bump 2.4.0
173
+ npx monocrate packages/lib-a packages/lib-b --bump patch
122
174
  ```
123
175
 
124
- ### CLI Reference
176
+ By default, each package will be published at its own version (individual versioning). If `lib-a` is at `1.0.0` and `lib-b`
177
+ is at `2.0.0`, a patch bump publishes them at `1.0.1` and `2.0.1` respectively.
178
+
179
+ You can also publish all specified packages at the same version (unified versioning, à la AWS SDK v3), by using the
180
+ `--max` flag. This applies the bump to the maximum version and publishes all packages at that version.
181
+
182
+ ```bash
183
+ # Now both will be published at 2.0.1 (the max)
184
+ npx monocrate packages/lib-a packages/lib-b --bump patch --max
185
+ ```
186
+
187
+ This is purely a stylistic choice; correctness is unaffected since in-repo dependencies are always embedded.
188
+
189
+ ## Scope
190
+
191
+ monocrate makes a few deliberate choices:
192
+
193
+ - **Runtime dependencies only** — Only `dependencies` are traversed and embedded. `devDependencies` are ignored since
194
+ consumers don't need your build tools.
195
+ - **Version conflicts fail early** — If two in-repo packages require different versions of the same third-party
196
+ dependency, monocrate stops with a clear error rather than silently picking one.
197
+ - **File selection via `npm pack`** — Your `files` field in package.json is the source of truth for what gets published.
198
+ monocrate doesn't introduce its own file configuration.
199
+ - **Validates before heavy work** — npm login and other prerequisites are checked upfront, before any file copying
200
+ begins.
201
+
202
+ A few constraints to be aware of:
203
+
204
+ - **Dynamic imports must use string literals** — `await import('@pkg/lib')` works; if a dynamic module path like `await import(variable)` is detected, `monocrate` stops with a clear error.
205
+ - **Prerelease versions require explicit `--bump`** — `--bump package` expects strict semver (`X.Y.Z`). For prereleases, pass the version explicitly: `--bump 1.0.0-beta.1`.
206
+ - **peerDependencies are preserved, not embedded** — As with any package publishing tool, you're responsible for ensuring peer dependencies (in-repo or not) are published and available to consumers.
207
+ - **optionalDependencies are preserved, not embedded** — If you list an in-repo package as optional, you're responsible for publishing it separately.
208
+ - **Symlinks must stay within monorepo** — Packages symlinked from outside the monorepo root are rejected.
209
+ - **Undeclared in-repo imports fail** — If your code imports an in-repo package not listed in `dependencies`, monocrate catches this and fails with a clear error.
210
+
211
+ ## CLI Reference
125
212
 
126
213
  ```
127
214
  monocrate <packages...> [options]
128
215
  ```
129
216
 
130
- #### Arguments
217
+ ### Arguments
131
218
 
132
219
  | Argument | Description |
133
220
  |----------|-------------|
134
221
  | `packages` | One or more package directories to publish (required) |
135
222
 
136
- #### Options
223
+ ### Options
137
224
 
138
225
  | Option | Alias | Type | Default | Description |
139
226
  |--------|-------|------|---------|-------------|
140
- | `--bump` | `-b` | `string` | `minor` | Version bump strategy: `patch`, `minor`, `major`, or explicit semver (e.g., `2.3.0`) |
227
+ | `--bump` | `-b` | `string` | `minor` | Version bump strategy: `patch`, `minor`, `major`, `package`, or explicit semver (e.g., `2.3.0`). Use `package` to read version from `package.json`. |
228
+ | `--max` | | `boolean` | `false` | Use max version across all packages (unified versioning). When false, each package uses its own version. |
141
229
  | `--dry-run` | `-d` | `boolean` | `false` | Prepare the package without publishing to npm |
142
230
  | `--output-dir` | `-o` | `string` | (temp dir) | Directory where assembled package is written |
143
231
  | `--root` | `-r` | `string` | (auto) | Monorepo root directory (auto-detected if omitted) |
@@ -146,55 +234,46 @@ monocrate <packages...> [options]
146
234
  | `--help` | | | | Show help |
147
235
  | `--version` | | | | Show version number |
148
236
 
149
- ## Programmatic API
150
-
151
- Use monocrate as a library for custom workflows or build scripts:
152
-
153
- ```typescript
154
- import { monocrate } from 'monocrate'
155
237
 
156
- const result = await monocrate({
157
- pathToSubjectPackages: ['packages/my-awesome-package'],
158
- publish: true,
159
- bump: 'minor',
160
- cwd: process.cwd()
161
- })
238
+ ## API Reference
162
239
 
163
- console.log(result.resolvedVersion) // '1.3.0'
164
- ```
165
-
166
- The above snippet is the programmatic equivalent of `npx monocrate packages/my-awesome-package --bump minor`.
167
-
168
- ### API Reference
169
-
170
- #### `monocrate(options): Promise<MonocrateResult>`
240
+ ### `monocrate(options): Promise<MonocrateResult>`
171
241
 
172
242
  Assembles one or more monorepo packages and their in-repo dependencies, and optionally publishes to npm.
173
243
 
174
- #### `MonocrateOptions`
244
+ ### `MonocrateOptions`
175
245
 
176
246
  | Property | Type | Required | Default | Description |
177
247
  |----------|------|----------|---------|-------------|
178
248
  | `pathToSubjectPackages` | `string \| string[]` | Yes | — | Package directories to assemble. Relative paths resolved from `cwd`. |
179
249
  | `publish` | `boolean` | Yes | — | Whether to publish to npm after assembly. |
180
250
  | `cwd` | `string` | Yes | — | Base directory for resolving relative paths. |
181
- | `bump` | `string` | No | `"minor"` | Version specifier: `"patch"`, `"minor"`, `"major"`, or explicit semver. |
251
+ | `bump` | `string` | No | `"minor"` | Version specifier: `"patch"`, `"minor"`, `"major"`, `"package"`, or explicit semver. |
252
+ | `max` | `boolean` | No | `false` | Use max version across all packages (unified versioning). |
182
253
  | `outputRoot` | `string` | No | (temp dir) | Output directory for the assembled package. |
183
254
  | `monorepoRoot` | `string` | No | (auto) | Monorepo root directory; auto-detected if omitted. |
184
- | `report` | `string` | No | — | Write resolved version to this file instead of stdout. |
185
255
  | `mirrorTo` | `string` | No | — | Mirror source files to this directory. |
186
256
  | `npmrcPath` | `string` | No | — | Path to `.npmrc` file for npm authentication. |
187
257
 
188
- #### `MonocrateResult`
258
+ ### `MonocrateResult`
189
259
 
190
260
  | Property | Type | Description |
191
261
  |----------|------|-------------|
192
262
  | `outputDir` | `string` | Directory where the first package was assembled. |
193
- | `resolvedVersion` | `string` | The resolved version that was applied. |
194
- | `summaries` | `Array<{ packageName: string; outputDir: string }>` | Details for each assembled package. |
263
+ | `resolvedVersion` | `string \| undefined` | The unified resolved version (only set when `max: true`). |
264
+ | `summaries` | `Array<{ packageName: string; outputDir: string; version: string }>` | Details for each assembled package, including its version. |
195
265
 
196
- ## Installation
197
266
 
198
- ```bash
199
- npm install --save-dev monocrate
200
- ```
267
+ ## The Assembly Process
268
+
269
+ Here's a conceptual breakdown of the steps that happen at a typical `monocrate` run:
270
+
271
+ 0. **Setup**: Creates a dedicated output directory
272
+ 1. **Version Resolution**: Computes the new version (see [above](#version-resolution))
273
+ 2. **Dependency Discovery**: Traverses the dependency graph to find all in-repo packages the package depends on, transitively
274
+ 3. **File Embedding**: Copies the publishable files (per `npm pack`) of each in-repo dependency into the output directory
275
+ 4. **Entry Point Resolution**: Examines each package's entry points (respecting `exports` and `main` fields) to compute
276
+ the exact file locations that import statements will resolve to
277
+ 5. **Import Rewriting**: Scans the `.js` and `.d.ts` files, converting imports of workspace packages to relative path
278
+ imports (`@acme/internal-utils` becomes `../deps/__acme__internal-utils/dist/index.js`)
279
+ 6. **Package.json Rewrite**: Sets the resolved version, removes in-repo deps, and adds any third-party deps they brought in
@@ -3,6 +3,8 @@ import type { PackageClosure } from './package-closure.js';
3
3
  import { AbsolutePath } from './paths.js';
4
4
  import type { PackageJson } from './package-json.js';
5
5
  import type { NpmClient } from './npm-client.js';
6
+ /** Directory name where in-repo dependencies are placed in the output. */
7
+ export declare const DEPS_DIR = "deps";
6
8
  /**
7
9
  * Resolves an import specifier to a package-relative path using Node.js resolution semantics.
8
10
  * Handles both bare imports (subpath='') and subpath imports (subpath='utils/helper').
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collect-package-locations.d.ts","sourceRoot":"","sources":["../../src/collect-package-locations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAG1D,OAAO,EAAE,YAAY,EAAgB,MAAM,YAAY,CAAA;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAGhD,0EAA0E;AAC1E,eAAO,MAAM,QAAQ,SAAS,CAAA;AAE9B;;;GAGG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAwB/E;AAwBD,wBAAsB,uBAAuB,CAC3C,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,YAAY,GACtB,OAAO,CAAC,eAAe,EAAE,CAAC,CAa5B"}
@@ -2,6 +2,9 @@ import * as fs from 'node:fs';
2
2
  import * as ResolveExports from 'resolve.exports';
3
3
  import { getFilesToPack } from './get-files-to-pack.js';
4
4
  import { AbsolutePath, RelativePath } from './paths.js';
5
+ import { manglePackageName } from './name-mangler.js';
6
+ /** Directory name where in-repo dependencies are placed in the output. */
7
+ export const DEPS_DIR = 'deps';
5
8
  /**
6
9
  * Resolves an import specifier to a package-relative path using Node.js resolution semantics.
7
10
  * Handles both bare imports (subpath='') and subpath imports (subpath='utils/helper').
@@ -48,6 +51,6 @@ export async function collectPackageLocations(npmClient, closure, outputDir) {
48
51
  // TODO(imaman): use promises()
49
52
  return Promise.all(closure.runtimeMembers.map((dep) => createPackageLocation(npmClient, dep, dep.name === closure.subjectPackageName
50
53
  ? outputDir
51
- : AbsolutePath.join(outputDir, RelativePath('deps'), dep.pathInRepo))));
54
+ : AbsolutePath.join(outputDir, RelativePath(DEPS_DIR), RelativePath(manglePackageName(dep.name))))));
52
55
  }
53
56
  //# sourceMappingURL=collect-package-locations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collect-package-locations.js","sourceRoot":"","sources":["../../src/collect-package-locations.ts"],"names":[],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AK,UAAU,qBAAqB,CAClC,SAAoB,EACpB,GAAoB,EACpB,iBAA+B;IAE/B,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC,SAAS,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IAEhE,iFAAiF;IACjF,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAA;IACxE,IAAI,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC7B,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC5B,CAAC;IAED,OAAO;QACL,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,KAAK,EAAE,iBAAiB;QACxB,WAAW;QACX,WAAW,EAAE,GAAG,CAAC,WAAW;KAC7B,CAAA;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,SAAoB,EACpB,OAAuB,EACvB,SAAuB;IAEvB,+BAA+B;IAC/B,OAAO,OAAO,CAAC,GAAG,CAChB,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CACjC,qBAAqB,CACnB,SAAS,EACT,GAAG,EACH,GAAG,CAAC,IAAI,KAAK,OAAO,CAAC,kBAAkB;QACrC,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CACpG,CACF,CACF,CAAA;AACH,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compute-package-closure.d.ts","sourceRoot":"","sources":["../../src/compute-package-closure.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAgC1D,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,GAAG,cAAc,CAiEjG"}
@@ -34,6 +34,9 @@ export function computePackageClosure(pkgName, repoExplorer) {
34
34
  if (depPackage) {
35
35
  visit(depPackage);
36
36
  }
37
+ else if (depVersion?.startsWith('workspace:')) {
38
+ throw new Error(`Workspace dependency "${depName}" (${depVersion}) in package "${pkg.name}" was not found in the monorepo`);
39
+ }
37
40
  else if (thirdPartyVersions && depVersion) {
38
41
  const existing = thirdPartyVersions.get(depName) ?? [];
39
42
  existing.push({ version: depVersion, requiredBy: pkg.name });
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compute-package-closure.js","sourceRoot":"","sources":["../../src/compute-package-closure.ts"],"names":[],"mappings":"AASA,SAAS,sBAAsB,CAAC,aAAyC;IACvE,MAAM,SAAS,GAAsC,EAAE,CAAA;IAEvD,KAAK,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC,IAAI,aAAa,CAAC,OAAO,EAAE,EAAE,CAAC;QAC9D,MAAM,cAAc,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;QACvE,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC9B,SAAS,CAAC,OAAO,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,OAAO,QAAQ,CAAC,CAAC,UAAU,GAAG,CAAC,CAAA;QACnF,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,SAAS,mBAAmB,CAAC,SAA4C;IACvE,MAAM,KAAK,GAAG,CAAC,oDAAoD,CAAC,CAAA;IAEpE,KAAK,MAAM,CAAC,OAAO,EAAE,QAAQ,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AC,OAAO,CAAA;IAC5C,CAAC;IAED,MAAM,kBAAkB,GAAG,QAAQ,CAAC,cAAc,EAAE,IAAI,CAAC,CAAA;IAEzD,OAAO;QACL,kBAAkB,EAAE,cAAc,CAAC,IAAI;QACvC,cAAc,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC;QAC5C,kBAAkB,EAAE,CAAC,GAAG,kBAAkB,CAAC,MAAM,EAAE,CAAC;QACpD,iBAAiB;KAClB,CAAA;AACH,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-copier.d.ts","sourceRoot":"","sources":["../../src/file-copier.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,YAAY,EAAgB,MAAM,YAAY,CAAA;AAOvD,qBAAa,UAAU;IACT,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAEpC,IAAI,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAkBrC,OAAO,CAAC,qBAAqB;CAc9B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-copier.js","sourceRoot":"","sources":["../../src/file-copier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAA;AAC9C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAEjC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAOvD,MAAM,OAAO,UAAU;IACD;IAApB,YAAoB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC;IAE9C,KAAK,CAAC,IAAI;QACR,MAAM,UAAU,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAA;QAE/C,iDAAiD;QACjD,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,WAAW,C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,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAYtG"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-files-to-pack.js","sourceRoot":"","sources":["../../src/get-files-to-pack.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,SAAoB,EAAE,UAAwB;IACjF,MAAM,CAAC,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA;IAC5D,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAA;IACvE,CAAC;IAED,MAAM,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IACnB,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;IACnD,CAAC;IAED,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;AACrC,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { PackageMap } from './package-location.js';
2
+ import { AbsolutePath } from './paths.js';
3
+ export type InRepoPackageChecker = (packageName: string) => boolean;
4
+ export type OutputPathToRepoPath = (outputPath: AbsolutePath) => string;
5
+ export declare class ImportRewriter {
6
+ private packageMap;
7
+ private isInRepoPackage;
8
+ private toRepoPath;
9
+ constructor(packageMap: PackageMap, isInRepoPackage: InRepoPackageChecker, toRepoPath: OutputPathToRepoPath);
10
+ rewriteAll(files: AbsolutePath[]): Promise<void>;
11
+ private rewriteFile;
12
+ private computeNewSpecifier;
13
+ private extractPackageName;
14
+ private computeRelativePath;
15
+ }
16
+ //# sourceMappingURL=import-rewriter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import-rewriter.d.ts","sourceRoot":"","sources":["../../src/import-rewriter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAEvD,OAAO,EAAE,YAAY,EAAgB,MAAM,YAAY,CAAA;AAEvD,MAAM,MAAM,oBAAoB,GAAG,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAA;AACnE,MAAM,MAAM,oBAAoB,GAAG,CAAC,UAAU,EAAE,YAAY,KAAK,MAAM,CAAA;AAEvE,qBAAa,cAAc;IAEvB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,eAAe;IACvB,OAAO,CAAC,UAAU;gBAFV,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,oBAAoB,EACrC,UAAU,EAAE,oBAAoB;IAGpC,UAAU,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;YAOxC,WAAW;IA4DzB,OAAO,CAAC,mBAAmB;IAqB3B,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,mBAAmB;CAO5B"}
@@ -4,12 +4,16 @@ import { resolveImport } from './collect-package-locations.js';
4
4
  import { AbsolutePath, RelativePath } from './paths.js';
5
5
  export class ImportRewriter {
6
6
  packageMap;
7
- constructor(packageMap) {
7
+ isInRepoPackage;
8
+ toRepoPath;
9
+ constructor(packageMap, isInRepoPackage, toRepoPath) {
8
10
  this.packageMap = packageMap;
11
+ this.isInRepoPackage = isInRepoPackage;
12
+ this.toRepoPath = toRepoPath;
9
13
  }
10
14
  async rewriteAll(files) {
11
- const jsAndDtsFiles = files.filter((f) => f.endsWith('.js') || f.endsWith('.d.ts'));
12
- for (const file of jsAndDtsFiles) {
15
+ const rewritableFiles = files.filter((f) => /\.(js|mjs|d\.ts|d\.mts)$/.test(f));
16
+ for (const file of rewritableFiles) {
13
17
  await this.rewriteFile(file);
14
18
  }
15
19
  }
@@ -18,7 +22,7 @@ export class ImportRewriter {
18
22
  const sourceFile = project.addSourceFileAtPath(pathToImporter);
19
23
  let modified = false;
20
24
  // Rewrite static import declarations:
21
- // import { foo } from '@myorg/utils' -> import { foo } from './deps/packages/utils/dist/index.js'
25
+ // import { foo } from '@myorg/utils' -> import { foo } from './deps/__myorg__utils/dist/index.js'
22
26
  for (const decl of sourceFile.getImportDeclarations()) {
23
27
  const specifier = decl.getModuleSpecifierValue();
24
28
  const newSpecifier = this.computeNewSpecifier(pathToImporter, specifier);
@@ -28,7 +32,7 @@ export class ImportRewriter {
28
32
  }
29
33
  }
30
34
  // Rewrite re-export declarations:
31
- // export { bar } from '@myorg/utils' -> export { bar } from './deps/packages/utils/dist/index.js'
35
+ // export { bar } from '@myorg/utils' -> export { bar } from './deps/__myorg__utils/dist/index.js'
32
36
  for (const decl of sourceFile.getExportDeclarations()) {
33
37
  const specifier = decl.getModuleSpecifierValue();
34
38
  if (specifier) {
@@ -40,7 +44,7 @@ export class ImportRewriter {
40
44
  }
41
45
  }
42
46
  // Rewrite dynamic import() calls:
43
- // const mod = await import('@myorg/utils') -> const mod = await import('./deps/packages/utils/dist/index.js')
47
+ // const mod = await import('@myorg/utils') -> const mod = await import('./deps/__myorg__utils/dist/index.js')
44
48
  for (const callExpr of sourceFile.getDescendantsOfKind(SyntaxKind.CallExpression)) {
45
49
  const expr = callExpr.getExpression();
46
50
  if (expr.getKind() === SyntaxKind.ImportKeyword) {
@@ -70,6 +74,11 @@ export class ImportRewriter {
70
74
  const { packageName, subPath } = this.extractPackageName(importSpecifier);
71
75
  const importeeLocation = this.packageMap.get(packageName);
72
76
  if (!importeeLocation) {
77
+ if (this.isInRepoPackage(packageName)) {
78
+ const repoPath = this.toRepoPath(pathToImporter);
79
+ throw new Error(`Import of in-repo package "${packageName}" found in ${repoPath}, ` +
80
+ `but "${packageName}" is not listed in package.json dependencies`);
81
+ }
73
82
  return undefined;
74
83
  }
75
84
  const pathAtImportee = resolveImport(importeeLocation.packageJson, subPath);
@@ -0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AAY,CAAC,cAAc,CAAC,CAAC,CACxE,CAAA;IACH,CAAC;IAEO,kBAAkB,CAAC,SAAiB;QAC1C,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAClC,MAAM,MAAM,GAAG,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAChD,OAAO,EAAE,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAA;IAClG,CAAC;IAEO,mBAAmB,CAAC,YAA0B,EAAE,oBAAkC;QACxF,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,oBAAoB,CAAC,CAAA;QAC9E,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAC9B,QAAQ,GAAG,IAAI,GAAG,QAAQ,CAAA;QAC5B,CAAC;QACD,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA+C,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEjD,YAAY,EAAE,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mirror-sources.d.ts","sourceRoot":"","sources":["../../src/mirror-sources.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,EAAE,YAAY,EAAgB,MAAM,YAAY,CAAA;AA2EvD;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,QAAQ,EAAE,eAAe,EAAE,EAAE,SAAS,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBvG"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mirror-sources.js","sourceRoot":"","sources":["../../src/mirror-sources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAA;AAC9C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAEjC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAOvD;;;;GAIG;AACH,SAAS,kBAAkB,CAAC,UAAwB;IAClD,6CAA6C;IAC7C,MAAM,eAAe,GAAG,QAAQ,CAAC,0CAA0C,EAAE;QAC3E,GAAG,EAAE,UAAU;QACf,QAAQ,EAAE,OAAO;KAClB,CAAC,CAAA;IACF,MAAM,cAAc,GAAG,eAAe;SACnC,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC1B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;IAEpC,IAAI,cAAc,CAAC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