monocrate 0.11.0 → 0.12.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 +175 -91
  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
@@ -4,97 +4,152 @@
4
4
  [![CI](https://github.com/imaman/monocrate/actions/workflows/ci.yml/badge.svg)](https://github.com/imaman/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. The naive
12
+ approach - running `npm publish` - produces an uninstallable package because `@acme/internal-utils` was never published
13
+ to npm.
12
14
 
15
+ The standard solution is the "publish everything" approach. Tools like [Lerna](https://lerna.js.org/) will publish every
16
+ internal dependency as its own public package. Installation now works, but `@acme/internal-utils` just became a
17
+ permanently published API you're committed to maintaining. _Your internal refactoring freedom is gone._
13
18
 
14
- ```typescript
15
- // Reusing validation logic from elsewhere in the monorepo
16
- import { validateUserInput } from '@acme/internal-utils'
19
+ You can throw a bundler at the problem: tools like [esbuild](https://esbuild.github.io/) or
20
+ [Rollup](https://rollupjs.org/) produce a self-contained file from a given entrypoint. But type declarations and
21
+ sourcemaps often break, and consumers can't tree-shake a pre-bundled blob.
17
22
 
18
- export function processData(data: unknown) {
19
- const validated = validateUserInput(data)
20
- // ...
21
- }
22
- ```
23
+ ## The Solution
23
24
 
24
- When you publish, things look great:
25
+ [monocrate](https://www.npmjs.com/package/monocrate) is a publishing CLI that gets this right. It produces a single
26
+ publishable directory containing everything needed from your package and its in-repo dependencies. Essentially, it
27
+ produces a standard npm package that looks like you hand-crafted it for publication.
25
28
 
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
- ```
29
+ - 📦 Consumers get one package with exactly the code they need
30
+ - 🔒 Internal packages remain unpublished
31
+ - Tree-shaking, sourcemaps, and types all work
32
+
33
+ > [!NOTE]
34
+ > **ESM only** — monocrate supports ES modules exclusively. CommonJS packages (`.cjs` files or `.js` without `"type": "module"`) are not supported. If your monorepo uses CommonJS, consider [migrating to ESM](https://nodejs.org/api/esm.html).
40
35
 
41
- But when you try to install it, you discover it's broken:
36
+ ### Quickstart
42
37
 
43
38
  ```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.
39
+ # Install
40
+ pnpm add --save-dev monocrate
41
+ # or: yarn add --dev monocrate
42
+ # or: npm install --save-dev monocrate
43
+
44
+ # Build (monocrate publishes, it doesn't build)
45
+ npm run build
46
+
47
+ # Publish
48
+ npx monocrate packages/my-awesome-package --bump patch
49
+
50
+ # Or use --dry-run to do everything short of publishing
51
+ npx monocrate packages/my-awesome-package --dry-run --output-dir /tmp/inspect --bump patch
49
52
  ```
50
53
 
51
- This is a big 🚨 oh-no 🚨 moment. What are your options?
54
+ ### What Gets Published
52
55
 
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.
56
+ Given this monorepo structure:
57
+ ```
58
+ /path/to/my-monorepo/
59
+ └── packages/
60
+ ├── my-awesome-package/
61
+ │ ├── package.json # name: @acme/my-awesome-package
62
+ │ └── src/
63
+ │ └── index.ts # import ... from '@acme/internal-utils'
64
+ └── internal-utils/
65
+ ├── package.json # name: @acme/internal-utils (private)
66
+ └── src/
67
+ └── index.ts
68
+ ```
57
69
 
70
+ Running `npx monocrate packages/my-awesome-package` produces:
71
+ ```
72
+ /tmp/monocrate-xxxxxx/
73
+ └── packages/
74
+ └── my-awesome-package/ # preserves the package's path in the monorepo
75
+ ├── package.json # name: "@acme/my-awesome-package", version: "1.3.0" (the new resolved version)
76
+ ├── dist/
77
+ │ └── index.js # rewritten:
78
+ │ # import ... from '../deps/__acme__internal-utils/dist/index.js'
79
+ └── deps/
80
+ └── __acme__internal-utils/ # mangled package name, exact notation may vary.
81
+ └── dist/
82
+ └── index.js
83
+ ```
58
84
 
59
- ## The Solution
85
+ The `deps/` directory is where the files of in-repo dependencies get embedded. Each dependency is placed under a
86
+ mangled version of its package name. This avoids name collisions regardless of where packages live in the monorepo.
60
87
 
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.
88
+ ### Version Resolution
62
89
 
90
+ `monocrate` uses **registry-based versioning**: it queries the registry for the latest published version and bumps it
91
+ according to your `--bump` flag (`patch`, `minor`, `major`). Your source `package.json` is never modified.
63
92
 
64
- ## Usage
93
+ This means you don't need to maintain version numbers in your source code. The registry is the versioning source of
94
+ truth, and `monocrate` computes the next version at publish time. Of course, if an exact version is specified
95
+ (`--bump 1.7.9`) it is used as-is.
65
96
 
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
- > ```
97
+ For first-time publishing (when the package doesn't exist in the registry yet), `monocrate` treats the current version
98
+ 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.
70
99
 
71
- Once the package is built, you can run monocrate:
100
+ If the version to publish to is already set in the package's `package.json` file (via `npm version`, Changesets, Lerna,
101
+ etc.), you can use `--bump package` to read the version directly from there:
72
102
 
73
103
  ```bash
74
- # Publish a package, patch bumping its version
75
- npx monocrate packages/my-awesome-package --bump patch
104
+ npm version minor --no-git-tag-version # Sets version in package.json
105
+ npx monocrate . --bump package # Uses that version
106
+ ```
76
107
 
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
108
+ ## Examples
79
109
 
80
- # --bump defaults to "minor", so these two are identical:
110
+ ```bash
111
+ # --bump defaults to "minor", so these two are equivalent:
81
112
  npx monocrate packages/my-awesome-package --bump minor
82
113
  npx monocrate packages/my-awesome-package
83
114
 
84
115
  # Explicit version
85
116
  npx monocrate packages/my-awesome-package --bump 2.3.0
117
+
118
+ # Package location is resolved relative to CWD
119
+ cd /path/to/my-monorepo/packages
120
+ npx monocrate my-awesome-package --bump 2.3.0
121
+ ```
122
+
123
+ ## Programmatic API
124
+
125
+ For custom build steps, or integration with other tooling, you can use `monocrate` as a library instead of invoking the
126
+ CLI:
127
+
128
+ ```typescript
129
+ import { monocrate } from 'monocrate'
130
+
131
+ const result = await monocrate({
132
+ pathToSubjectPackages: ['packages/my-awesome-package'],
133
+ publish: true,
134
+ bump: 'minor',
135
+ cwd: process.cwd()
136
+ })
137
+
138
+ console.log(result.summaries[0].version) // '1.3.0'
86
139
  ```
87
140
 
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`.
141
+ The above snippet is the programmatic equivalent of `npx monocrate packages/my-awesome-package --bump minor`.
142
+
143
+ ## Advanced Features
89
144
 
90
145
  ### Custom Publish Name
91
146
 
92
- Publish `@acme/my-awesome-package` as `best-package-ever` without doing a repo-wide renaming:
147
+ Sometimes your internal package name doesn't match the name you want on npm. Add a `monocrate.publishName` field to
148
+ your `package.json` to publish under a different name without renaming the package across your monorepo:
93
149
 
94
150
  ```json
95
151
  {
96
152
  "name": "@acme/my-awesome-package",
97
- ...
98
153
  "monocrate": {
99
154
  "publishName": "best-package-ever"
100
155
  }
@@ -103,41 +158,79 @@ Publish `@acme/my-awesome-package` as `best-package-ever` without doing a repo-w
103
158
 
104
159
  ### Mirroring to a Public Repo
105
160
 
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:
161
+ Want to open-source your package while keeping your monorepo private? Use `--mirror-to` to copy the package and its
162
+ in-repo dependencies to a separate public repository:
107
163
 
108
164
  ```bash
109
165
  npx monocrate packages/my-awesome-package --mirror-to ../public-repo
110
166
  ```
111
167
 
112
- This way, your public repo is self-contained—no dangling references to internal packages. Contributors can clone and work on your package.
168
+ This way, your public repo stays in sync with what you publish—all necessary packages included. Contributors can
169
+ clone and work on your package.
113
170
 
114
- Only committed files (from `git HEAD`) are mirrored; fails if untracked files exist.
171
+ Requires a clean working tree. Only committed files (from `git HEAD`) are mirrored.
115
172
 
116
173
  ### Multiple Packages
117
174
 
118
- Publish several packages together with the same version:
175
+ If you have several public packages in your monorepo, publish them in one go by listing multiple directories:
119
176
 
120
177
  ```bash
121
- npx monocrate packages/lib-a packages/lib-b --bump 2.4.0
178
+ npx monocrate packages/lib-a packages/lib-b --bump patch
122
179
  ```
123
180
 
124
- ### CLI Reference
181
+ By default, each package will be published at its own version (individual versioning). If `lib-a` is at `1.0.0` and `lib-b`
182
+ is at `2.0.0`, a patch bump publishes them at `1.0.1` and `2.0.1` respectively.
183
+
184
+ You can also publish all specified packages at the same version (unified versioning, à la AWS SDK v3), by using the
185
+ `--max` flag. This applies the bump to the maximum version and publishes all packages at that version.
186
+
187
+ ```bash
188
+ # Now both will be published at 2.0.1 (the max)
189
+ npx monocrate packages/lib-a packages/lib-b --bump patch --max
190
+ ```
191
+
192
+ This is purely a stylistic choice; correctness is unaffected since in-repo dependencies are always embedded.
193
+
194
+ ## Scope
195
+
196
+ monocrate makes a few deliberate choices:
197
+
198
+ - **Runtime dependencies only** — Only `dependencies` are traversed and embedded. `devDependencies` are ignored since
199
+ consumers don't need your build tools.
200
+ - **Version conflicts fail early** — If two in-repo packages require different versions of the same third-party
201
+ dependency, monocrate stops with a clear error rather than silently picking one.
202
+ - **File selection via `npm pack`** — Your `files` field in package.json is the source of truth for what gets published.
203
+ monocrate doesn't introduce its own file configuration.
204
+ - **Validates before heavy work** — npm login and other prerequisites are checked upfront, before any file copying
205
+ begins.
206
+
207
+ A few constraints to be aware of:
208
+
209
+ - **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.
210
+ - **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`.
211
+ - **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.
212
+ - **optionalDependencies are preserved, not embedded** — If you list an in-repo package as optional, you're responsible for publishing it separately.
213
+ - **Symlinks must stay within monorepo** — Packages symlinked from outside the monorepo root are rejected.
214
+ - **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.
215
+
216
+ ## CLI Reference
125
217
 
126
218
  ```
127
219
  monocrate <packages...> [options]
128
220
  ```
129
221
 
130
- #### Arguments
222
+ ### Arguments
131
223
 
132
224
  | Argument | Description |
133
225
  |----------|-------------|
134
226
  | `packages` | One or more package directories to publish (required) |
135
227
 
136
- #### Options
228
+ ### Options
137
229
 
138
230
  | Option | Alias | Type | Default | Description |
139
231
  |--------|-------|------|---------|-------------|
140
- | `--bump` | `-b` | `string` | `minor` | Version bump strategy: `patch`, `minor`, `major`, or explicit semver (e.g., `2.3.0`) |
232
+ | `--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`. |
233
+ | `--max` | | `boolean` | `false` | Use max version across all packages (unified versioning). When false, each package uses its own version. |
141
234
  | `--dry-run` | `-d` | `boolean` | `false` | Prepare the package without publishing to npm |
142
235
  | `--output-dir` | `-o` | `string` | (temp dir) | Directory where assembled package is written |
143
236
  | `--root` | `-r` | `string` | (auto) | Monorepo root directory (auto-detected if omitted) |
@@ -146,55 +239,46 @@ monocrate <packages...> [options]
146
239
  | `--help` | | | | Show help |
147
240
  | `--version` | | | | Show version number |
148
241
 
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
242
 
156
- const result = await monocrate({
157
- pathToSubjectPackages: ['packages/my-awesome-package'],
158
- publish: true,
159
- bump: 'minor',
160
- cwd: process.cwd()
161
- })
243
+ ## API Reference
162
244
 
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>`
245
+ ### `monocrate(options): Promise<MonocrateResult>`
171
246
 
172
247
  Assembles one or more monorepo packages and their in-repo dependencies, and optionally publishes to npm.
173
248
 
174
- #### `MonocrateOptions`
249
+ ### `MonocrateOptions`
175
250
 
176
251
  | Property | Type | Required | Default | Description |
177
252
  |----------|------|----------|---------|-------------|
178
253
  | `pathToSubjectPackages` | `string \| string[]` | Yes | — | Package directories to assemble. Relative paths resolved from `cwd`. |
179
254
  | `publish` | `boolean` | Yes | — | Whether to publish to npm after assembly. |
180
255
  | `cwd` | `string` | Yes | — | Base directory for resolving relative paths. |
181
- | `bump` | `string` | No | `"minor"` | Version specifier: `"patch"`, `"minor"`, `"major"`, or explicit semver. |
256
+ | `bump` | `string` | No | `"minor"` | Version specifier: `"patch"`, `"minor"`, `"major"`, `"package"`, or explicit semver. |
257
+ | `max` | `boolean` | No | `false` | Use max version across all packages (unified versioning). |
182
258
  | `outputRoot` | `string` | No | (temp dir) | Output directory for the assembled package. |
183
259
  | `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
260
  | `mirrorTo` | `string` | No | — | Mirror source files to this directory. |
186
261
  | `npmrcPath` | `string` | No | — | Path to `.npmrc` file for npm authentication. |
187
262
 
188
- #### `MonocrateResult`
263
+ ### `MonocrateResult`
189
264
 
190
265
  | Property | Type | Description |
191
266
  |----------|------|-------------|
192
267
  | `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. |
268
+ | `resolvedVersion` | `string \| undefined` | The unified resolved version (only set when `max: true`). |
269
+ | `summaries` | `Array<{ packageName: string; outputDir: string; version: string }>` | Details for each assembled package, including its version. |
195
270
 
196
- ## Installation
197
271
 
198
- ```bash
199
- npm install --save-dev monocrate
200
- ```
272
+ ## The Assembly Process
273
+
274
+ Here's a conceptual breakdown of the steps that happen at a typical `monocrate` run:
275
+
276
+ 0. **Setup**: Creates a dedicated output directory
277
+ 1. **Version Resolution**: Computes the new version (see [above](#version-resolution))
278
+ 2. **Dependency Discovery**: Traverses the dependency graph to find all in-repo packages the package depends on, transitively
279
+ 3. **File Embedding**: Copies the publishable files (per `npm pack`) of each in-repo dependency into the output directory
280
+ 4. **Entry Point Resolution**: Examines each package's entry points (respecting `exports` and `main` fields) to compute
281
+ the exact file locations that import statements will resolve to
282
+ 5. **Import Rewriting**: Scans the `.js` and `.d.ts` files, converting imports of workspace packages to relative path
283
+ imports (`@acme/internal-utils` becomes `../deps/__acme__internal-utils/dist/index.js`)
284
+ 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":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,K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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,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QAC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AC,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,CAAC,CAAC,CAAC,CAAA;QACjF,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE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AC,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,0 +1 @@
1
+ {"version":3,"file":"import-rewriter.js","sourceRoot":"","sources":["../../src/import-rew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B,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,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CACb,wB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