@b9g/shovel 0.2.0-beta.6 → 0.2.0-beta.7
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/bin/cli.js +3 -20
- package/package.json +9 -9
package/bin/cli.js
CHANGED
|
@@ -25,7 +25,7 @@ import * as Platform from "@b9g/platform";
|
|
|
25
25
|
import * as ESBuild from "esbuild";
|
|
26
26
|
import { existsSync } from "fs";
|
|
27
27
|
import { resolve, join, dirname as dirname2 } from "path";
|
|
28
|
-
import { mkdir
|
|
28
|
+
import { mkdir } from "fs/promises";
|
|
29
29
|
import { assetsPlugin } from "@b9g/assets/plugin";
|
|
30
30
|
|
|
31
31
|
// src/esbuild/import-meta-plugin.ts
|
|
@@ -97,13 +97,11 @@ var Watcher = class {
|
|
|
97
97
|
#initialBuildComplete;
|
|
98
98
|
#initialBuildResolve;
|
|
99
99
|
#currentEntrypoint;
|
|
100
|
-
#previousEntrypoint;
|
|
101
100
|
constructor(options) {
|
|
102
101
|
this.#options = options;
|
|
103
102
|
this.#projectRoot = findProjectRoot();
|
|
104
103
|
this.#initialBuildComplete = false;
|
|
105
104
|
this.#currentEntrypoint = "";
|
|
106
|
-
this.#previousEntrypoint = "";
|
|
107
105
|
}
|
|
108
106
|
/**
|
|
109
107
|
* Start watching and building
|
|
@@ -153,29 +151,15 @@ var Watcher = class {
|
|
|
153
151
|
}
|
|
154
152
|
if (success) {
|
|
155
153
|
logger.info("Build complete", { entrypoint: outputPath });
|
|
156
|
-
if (this.#currentEntrypoint && this.#currentEntrypoint !== outputPath) {
|
|
157
|
-
try {
|
|
158
|
-
await unlink(this.#currentEntrypoint);
|
|
159
|
-
await unlink(this.#currentEntrypoint + ".map").catch(
|
|
160
|
-
() => {
|
|
161
|
-
}
|
|
162
|
-
);
|
|
163
|
-
logger.debug("Cleaned up old build", {
|
|
164
|
-
oldEntrypoint: this.#currentEntrypoint
|
|
165
|
-
});
|
|
166
|
-
} catch {
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
154
|
} else {
|
|
170
155
|
logger.error("Build errors", { errors: result.errors });
|
|
171
156
|
}
|
|
172
|
-
this.#previousEntrypoint = this.#currentEntrypoint;
|
|
173
157
|
this.#currentEntrypoint = outputPath;
|
|
174
158
|
if (!this.#initialBuildComplete) {
|
|
175
159
|
this.#initialBuildComplete = true;
|
|
176
160
|
this.#initialBuildResolve?.({ success, entrypoint: outputPath });
|
|
177
161
|
} else {
|
|
178
|
-
this.#options.onBuild?.(success, outputPath);
|
|
162
|
+
await this.#options.onBuild?.(success, outputPath);
|
|
179
163
|
}
|
|
180
164
|
});
|
|
181
165
|
}
|
|
@@ -201,7 +185,6 @@ var Watcher = class {
|
|
|
201
185
|
};
|
|
202
186
|
|
|
203
187
|
// src/commands/develop.ts
|
|
204
|
-
var logger2 = getLogger2(["cli"]);
|
|
205
188
|
await configure({
|
|
206
189
|
contextLocalStorage: new AsyncContext.Variable(),
|
|
207
190
|
sinks: {
|
|
@@ -220,6 +203,7 @@ await configure({
|
|
|
220
203
|
{ category: ["worker"], level: "debug", sinks: ["console"] }
|
|
221
204
|
]
|
|
222
205
|
});
|
|
206
|
+
var logger2 = getLogger2(["cli"]);
|
|
223
207
|
async function developCommand(entrypoint, options) {
|
|
224
208
|
try {
|
|
225
209
|
const platformName = Platform.resolvePlatform(options);
|
|
@@ -368,7 +352,6 @@ import { configure as configure2, getConsoleSink as getConsoleSink2, getLogger a
|
|
|
368
352
|
import { AsyncContext as AsyncContext2 } from "@b9g/async-context";
|
|
369
353
|
await configure2({
|
|
370
354
|
reset: true,
|
|
371
|
-
// Allow reconfiguration if already configured
|
|
372
355
|
contextLocalStorage: new AsyncContext2.Variable(),
|
|
373
356
|
sinks: {
|
|
374
357
|
console: getConsoleSink2()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@b9g/shovel",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.7",
|
|
4
4
|
"description": "ServiceWorker-first universal deployment platform. Write ServiceWorker apps once, deploy anywhere (Node/Bun/Cloudflare). Registry-based multi-app orchestration.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"@b9g/filesystem": "^0.1.6",
|
|
28
28
|
"@b9g/http-errors": "^0.1.5",
|
|
29
29
|
"@b9g/libuild": "^0.1.17",
|
|
30
|
-
"@b9g/platform": "^0.1.
|
|
31
|
-
"@b9g/platform-bun": "^0.1.
|
|
32
|
-
"@b9g/platform-cloudflare": "^0.1.
|
|
33
|
-
"@b9g/platform-node": "^0.1.
|
|
30
|
+
"@b9g/platform": "^0.1.10",
|
|
31
|
+
"@b9g/platform-bun": "^0.1.8",
|
|
32
|
+
"@b9g/platform-cloudflare": "^0.1.7",
|
|
33
|
+
"@b9g/platform-node": "^0.1.10",
|
|
34
34
|
"@b9g/router": "^0.1.8",
|
|
35
35
|
"@types/bun": "^1.2.2",
|
|
36
36
|
"mitata": "^1.0.34",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@b9g/node-webworker": "^0.1.3",
|
|
41
|
-
"@b9g/platform": "^0.1.
|
|
42
|
-
"@b9g/platform-node": "^0.1.
|
|
43
|
-
"@b9g/platform-cloudflare": "^0.1.
|
|
44
|
-
"@b9g/platform-bun": "^0.1.
|
|
41
|
+
"@b9g/platform": "^0.1.10",
|
|
42
|
+
"@b9g/platform-node": "^0.1.10",
|
|
43
|
+
"@b9g/platform-cloudflare": "^0.1.7",
|
|
44
|
+
"@b9g/platform-bun": "^0.1.8",
|
|
45
45
|
"@b9g/cache": "^0.1.4",
|
|
46
46
|
"@b9g/filesystem": "^0.1.6",
|
|
47
47
|
"@b9g/http-errors": "^0.1.5"
|