isolate-package 1.2.0 → 1.2.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.
- package/README.md +28 -22
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -75,23 +75,22 @@ include them in the output.
|
|
|
75
75
|
|
|
76
76
|
How dependencies are listed with regards to versioning is not important, because
|
|
77
77
|
packages are matched based on their name. For example the following flavors all
|
|
78
|
-
work:
|
|
78
|
+
work (some depending on your package manager):
|
|
79
79
|
|
|
80
80
|
```cjson
|
|
81
81
|
// package.json
|
|
82
82
|
{
|
|
83
83
|
"dependencies": {
|
|
84
|
-
"shared-package": "
|
|
84
|
+
"shared-package": "0.0.0"
|
|
85
85
|
"shared-package": "*",
|
|
86
|
+
"shared-package": "workspace:*",
|
|
86
87
|
"shared-package": "../shared-package",
|
|
87
|
-
"shared-package": "^1.0.0"
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
-
So
|
|
93
|
-
|
|
94
|
-
its version specifier.
|
|
92
|
+
So if the a package name can be found as part of the workspace definition, it
|
|
93
|
+
will be processed regardless of its version specifier.
|
|
95
94
|
|
|
96
95
|
### Define "files" and "version" in each manifest
|
|
97
96
|
|
|
@@ -134,8 +133,9 @@ into the folders. So if you declare your packages to live in `packages/*` it
|
|
|
134
133
|
will only find the packages directly in that folder and not at
|
|
135
134
|
`packages/nested/more-packages`.
|
|
136
135
|
|
|
137
|
-
You can, however, declare multiple packages folders like
|
|
138
|
-
"apps/*"]`. It's just that the structure inside
|
|
136
|
+
You can, however, declare multiple packages folders. I personally like to use
|
|
137
|
+
`["packages/*", "apps/*", "services/*"]`. It's just that the structure inside
|
|
138
|
+
them should be flat.
|
|
139
139
|
|
|
140
140
|
## Usage
|
|
141
141
|
|
|
@@ -172,8 +172,8 @@ Here's an example using [Turborepo](https://turbo.build/):
|
|
|
172
172
|
}
|
|
173
173
|
```
|
|
174
174
|
|
|
175
|
-
With this configuration you can then run `firebase deploy --only functions`
|
|
176
|
-
the package.
|
|
175
|
+
With this configuration you can then run `npx firebase deploy --only functions`
|
|
176
|
+
from the package.
|
|
177
177
|
|
|
178
178
|
If you like to deploy to Firebase Functions from multiple packages you will also
|
|
179
179
|
need to configure a unique `codebase` identifier for each of them. For more
|
|
@@ -212,10 +212,11 @@ The Firebase configuration should then look something like this:
|
|
|
212
212
|
|
|
213
213
|
## Configuration Options
|
|
214
214
|
|
|
215
|
-
For most users no configuration should be
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
215
|
+
For most users no configuration should be necessary.
|
|
216
|
+
|
|
217
|
+
You can configure the isolate process by placing a `isolate.config.json` file in
|
|
218
|
+
the package that you want to isolate, except when you're [deploying to Firebase
|
|
219
|
+
from the root of the workspace](#deploying-firebase-from-the-root).
|
|
219
220
|
|
|
220
221
|
For the config file to be picked up, you will have to execute `isolate` from the
|
|
221
222
|
same location, as it uses the current working directory.
|
|
@@ -239,6 +240,11 @@ Yarn and NPM the lockfiles are included by default, but for PNPM they are
|
|
|
239
240
|
excluded by default because they are not supported yet. For more information see
|
|
240
241
|
[lockfiles](#lockfiles).
|
|
241
242
|
|
|
243
|
+
_Tip:_ If you can't use a lockfile I advise you to declare dependencies using
|
|
244
|
+
absolute versions in your manifest files. This doesn't prevent their
|
|
245
|
+
dependencies from installing newer versions, but at least you minimize the risk
|
|
246
|
+
of things breaking.
|
|
247
|
+
|
|
242
248
|
### includeDevDependencies
|
|
243
249
|
|
|
244
250
|
Type: `boolean`, default: `false`
|
|
@@ -297,10 +303,10 @@ from the root of the workspace.
|
|
|
297
303
|
|
|
298
304
|
Type: `string`, default: `"../.."`
|
|
299
305
|
|
|
300
|
-
The relative path to the root of the workspace / monorepo. In a typical
|
|
301
|
-
|
|
302
|
-
contain packages
|
|
303
|
-
up from the root.
|
|
306
|
+
The relative path to the root of the workspace / monorepo. In a typical setup
|
|
307
|
+
you will have a `packages` directory and possibly also an `apps` and a
|
|
308
|
+
`services` directory, all of which contain packages. So any package you would
|
|
309
|
+
want to isolate is located 2 levels up from the root.
|
|
304
310
|
|
|
305
311
|
For example
|
|
306
312
|
|
|
@@ -372,10 +378,10 @@ conversion](https://github.com/0x80/isolate-package/issues/5) which makes it
|
|
|
372
378
|
unusable at the moment. Until that is resolved, the lockfile is automatically
|
|
373
379
|
excluded for PNPM.
|
|
374
380
|
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
dependencies
|
|
378
|
-
|
|
381
|
+
_Tip:_ If you can't use a lockfile I advise you to declare dependencies using
|
|
382
|
+
absolute versions in your manifest files. This doesn't prevent their
|
|
383
|
+
dependencies from installing newer versions, but at least you minimize the risk
|
|
384
|
+
of things breaking.
|
|
379
385
|
|
|
380
386
|
## Different Package Managers
|
|
381
387
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isolate-package",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Isolate a monorepo package by bundling the build output with its shared workspace packages and lock file to form a self-contained directory.",
|
|
5
5
|
"author": "Thijs Koerselman",
|
|
6
6
|
"license": "MIT",
|