@michijs/dev-server 0.8.3 → 0.8.4
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/utils/copy.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type Transformer = {
|
|
2
2
|
fileRegex: RegExp;
|
|
3
|
-
transformer: (fileContent: string, path?: string) => Buffer | string;
|
|
3
|
+
transformer: (fileContent: string, path?: string) => Promise<Buffer | string> | Buffer | string;
|
|
4
4
|
pathTransformer?: (destPath: string) => string;
|
|
5
5
|
};
|
|
6
6
|
export declare function copyFile(src: string, fileName: string, dest: string, transformers: Transformer[], omit?: RegExp[]): void;
|
package/bin/utils/copy.js
CHANGED
|
@@ -16,7 +16,7 @@ export function copyFile(src, fileName, dest, transformers, omit) {
|
|
|
16
16
|
});
|
|
17
17
|
const finalDestPath = x.pathTransformer?.(destPath) ?? destPath;
|
|
18
18
|
try {
|
|
19
|
-
const transformedFile = x.transformer(srcFileContent, srcPath);
|
|
19
|
+
const transformedFile = await x.transformer(srcFileContent, srcPath);
|
|
20
20
|
fs.writeFileSync(finalDestPath, transformedFile);
|
|
21
21
|
}
|
|
22
22
|
catch { }
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { config } from "../config/config.js";
|
|
2
2
|
import { getAllFiles } from "./getAllFiles.js";
|
|
3
|
-
import {
|
|
3
|
+
import { build as esbuild } from "esbuild";
|
|
4
4
|
import { getCurrentCommitSha } from "./getCurrentCommitSha.js";
|
|
5
5
|
const commitSha = getCurrentCommitSha();
|
|
6
|
-
export const workerTransformer = (_serviceWorkerCode, srcPath) => {
|
|
6
|
+
export const workerTransformer = async (_serviceWorkerCode, srcPath) => {
|
|
7
7
|
const { outdir, define } = config.esbuildOptions;
|
|
8
8
|
try {
|
|
9
9
|
const allFiles = getAllFiles(outdir, ".");
|
|
10
|
-
const result = esbuild({
|
|
10
|
+
const result = await esbuild({
|
|
11
11
|
...config.esbuildOptions,
|
|
12
12
|
splitting: false,
|
|
13
13
|
outdir: undefined,
|
|
@@ -17,6 +17,8 @@ export const workerTransformer = (_serviceWorkerCode, srcPath) => {
|
|
|
17
17
|
entryPoints: [srcPath],
|
|
18
18
|
legalComments: "inline",
|
|
19
19
|
define: {
|
|
20
|
+
// For compatibility with some modules - should be fixed eventually
|
|
21
|
+
"import.meta.url": `""`,
|
|
20
22
|
"michiProcess.env.BUILD_FILES": `${JSON.stringify(allFiles)}`,
|
|
21
23
|
// Time at GMT+0
|
|
22
24
|
"michiProcess.env.CACHE_NAME": commitSha !== ""
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@michijs/dev-server",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.4",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/michijs/dev-server.git"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@michijs/tsconfig": "0.0.4",
|
|
33
|
-
"@types/node": "22.13.
|
|
33
|
+
"@types/node": "22.13.10",
|
|
34
34
|
"@types/yargs": "17.0.33",
|
|
35
35
|
"typescript": "5.8.2"
|
|
36
36
|
},
|
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"colorthief": "2.6.0",
|
|
57
57
|
"@types/web-app-manifest": "1.0.9",
|
|
58
|
-
"esbuild": "0.25.
|
|
58
|
+
"esbuild": "0.25.1",
|
|
59
59
|
"node-watch": "0.7.4",
|
|
60
60
|
"open": "10.1.0",
|
|
61
|
-
"playwright-core": "1.
|
|
61
|
+
"playwright-core": "1.51.0",
|
|
62
62
|
"sharp": "0.33.5",
|
|
63
63
|
"yargs": "17.7.2"
|
|
64
64
|
}
|