Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving @remix-pwa/dev fixes to stable release #101

Merged
merged 7 commits into from
Sep 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions packages/dev/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,21 @@

* **compiler:** handle imports on different OS 76a9d65

## @remix-pwa/dev 2.0.26-dev.2 (2023-09-30)


### Bug Fixes

* **dev:** fixed invalid build sequence 945d9b4





### Dependencies

* **@remix-pwa/worker-runtime:** upgraded to 2.0.6-dev.1

## @remix-pwa/dev 2.0.26-dev.1 (2023-09-27)


Expand Down
5 changes: 2 additions & 3 deletions packages/dev/cli/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ export const eject = async () => {

export const packages = async (dir: string) => {
const pkgManager = await detectPackageManager(dir);

// TODO: Add `ora` as an extra flair
console.log(blue('Installing base packages for remix-pwa...\n\n'));

console.log(blue('Installing base packages for remix-pwa...\n'));
console.log(
yellow('installing:\n- @remix-pwa/sw\n- @remix-pwa/dev\n- @remix-pwa/worker-runtime\n- @remix-pwa/cache\n')
);
Expand Down
7 changes: 6 additions & 1 deletion packages/dev/cli/resolveUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@ import { pathToFileURL } from 'url';
const isWindows = platform() === 'win32';

export const resolveUrl = (...args: string[]) => {
return !isWindows ? resolve(...args) : pathToFileURL(resolve(...args)).href;
const url = resolve(...args)
return !isWindows ? url : (isAbsolute(url) ? pathToFileURL(url).href : url);
};

export const isAbsolute = (path: string) => {
return !isWindows ? resolve(path) === path : pathToFileURL(resolve(path)).href === path;
}
9 changes: 8 additions & 1 deletion packages/dev/compiler/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,20 @@ export async function runCompiler(mode: 'dev' | 'build', projectDir: string = pr
...createEsbuildConfig(remixConfig),
metafile: true,
write: true,
color: true,
})
.then(async context => {
console.log(`Building Service Worker in ${MODE} mode`);
try {
if (mode === 'build') {
return context.dispose();
context.watch().then(() => {
ShafSpecs marked this conversation as resolved.
Show resolved Hide resolved
return context.dispose();
});
console.timeEnd(TIME_LABEL);
console.log('Service Worker built successfully!');
return;
}

await context.watch();
console.timeEnd(TIME_LABEL);
console.log('Watching for changes in the service worker file...');
Expand Down
1 change: 1 addition & 0 deletions playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"sideEffects": false,
"private": true,
"scripts": {
"build:worker": "remix-pwa build",
"dev": "run-p dev:*",
"start": "remix-serve build",
"typecheck": "tsc",
Expand Down
10 changes: 2 additions & 8 deletions playground/public/entry.worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -7392,10 +7392,7 @@ var RemixCache = class {
}
ShafSpecs marked this conversation as resolved.
Show resolved Hide resolved
if (this._ttl <= 0 || ttl && ttl <= 0)
return;
if (this.name !== "assets-cache") {
console.log("putting", request.url, "in", this.name, "-", response.clone());
}
if (response === null || response.clone().body === null || response.statusText === "No Content") {
if (response === null || response.status === 204 || response.statusText.toLowerCase() === "no content") {
await this.delete(request);
return;
}
Expand All @@ -7409,9 +7406,6 @@ var RemixCache = class {
const buffer = await response.clone().arrayBuffer();
data = B.Buffer.from(buffer).toString("base64");
}
if (this.name !== "assets-cache") {
console.log("data", data.toString().slice(0, 5), typeof data, "after");
}
if (!this.set) {
this.set = true;
const keys2 = await cache.keys();
Expand Down Expand Up @@ -14365,7 +14359,7 @@ async function workerLoader5({ context }) {
}

// assets-module:@remix-pwa/dev?assets
var assets = ["/build/root-PZGNXARZ.js", "/build/manifest-E9685489.js", "/build/entry.client-3JUGN7J7.js", "/build/__remix_entry_dev-HERBK3YF.js", "/build/routes/sync-away-FIS3FI5E.js", "/build/routes/strategies-5663L43X.js", "/build/routes/selection-H5V7RQJ2.js", "/build/routes/basic-loader-AU6DX53L.js", "/build/routes/basic-caching-VHU2A4EZ.js", "/build/routes/basic-action-7OWIMKOO.js", "/build/routes/_index-RXPHYOQ6.js", "/build/routes/_app.flights-W7S6DTGH.js", "/build/routes/_app-O66ZRZQJ.js", "/build/_assets/tailwind-JOKRYXHU.css", "/build/_shared/runtime-JC7ERE5X.js", "/build/_shared/remix_hmr-KOXB6O7Z.js", "/build/_shared/react-dom-SNQ2UIZM.js", "/build/_shared/react-XL6EHOTX.js", "/build/_shared/jsx-runtime-7KJOCM5J.js", "/build/_shared/jsx-dev-runtime-D5NCTVC4.js", "/build/_shared/esm-VCXQEZXN.js", "/build/_shared/client-LQHWDDYA.js", "/build/_shared/chunk-WBXWSE7J.js", "/build/_shared/chunk-TWSZTAQ6.js", "/build/_shared/chunk-TLBAXOHZ.js", "/build/_shared/chunk-STMUDJCL.js", "/build/_shared/chunk-PNG5AS42.js", "/build/_shared/chunk-NXSRMYPB.js", "/build/_shared/chunk-LOYKRDJM.js", "/build/_shared/chunk-G7CHZRZX.js", "/build/_shared/chunk-FXD4XYGV.js", "/build/_shared/chunk-BFGKEHN4.js", "/build/_shared/chunk-5HPIDTNV.js"];
var assets = ["/build/root-PZGNXARZ.js", "/build/manifest-E9685489.js", "/build/entry.client-3JUGN7J7.js", "/build/__remix_entry_dev-HERBK3YF.js", "/build/_shared/runtime-JC7ERE5X.js", "/build/_shared/remix_hmr-KOXB6O7Z.js", "/build/_shared/react-dom-SNQ2UIZM.js", "/build/_shared/react-XL6EHOTX.js", "/build/_shared/jsx-runtime-7KJOCM5J.js", "/build/_shared/jsx-dev-runtime-D5NCTVC4.js", "/build/_shared/esm-VCXQEZXN.js", "/build/_shared/client-LQHWDDYA.js", "/build/_shared/chunk-WBXWSE7J.js", "/build/_shared/chunk-TWSZTAQ6.js", "/build/_shared/chunk-TLBAXOHZ.js", "/build/_shared/chunk-STMUDJCL.js", "/build/_shared/chunk-PNG5AS42.js", "/build/_shared/chunk-NXSRMYPB.js", "/build/_shared/chunk-LOYKRDJM.js", "/build/_shared/chunk-G7CHZRZX.js", "/build/_shared/chunk-FXD4XYGV.js", "/build/_shared/chunk-BFGKEHN4.js", "/build/_shared/chunk-5HPIDTNV.js", "/build/routes/sync-away-FIS3FI5E.js", "/build/routes/strategies-5663L43X.js", "/build/routes/selection-H5V7RQJ2.js", "/build/routes/basic-loader-AU6DX53L.js", "/build/routes/basic-caching-VHU2A4EZ.js", "/build/routes/basic-action-7OWIMKOO.js", "/build/routes/_index-RXPHYOQ6.js", "/build/routes/_app.flights-W7S6DTGH.js", "/build/routes/_app-O66ZRZQJ.js", "/build/_assets/tailwind-JOKRYXHU.css"];

// entry-module:@remix-pwa/build/magic
var routes = {
Expand Down