@michijs/dev-server 0.7.23 → 0.7.25
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/{src/actions → actions}/generateAssets.d.ts +1 -1
- package/bin/{src/actions → actions}/generateAssets.js +2 -2
- package/bin/{src/cli.js → cli.js} +2 -4
- package/bin/{src/config → config}/config.d.ts +3 -3
- package/bin/{src/config → config}/config.js +13 -11
- package/bin/utils/packageJson.d.ts +1 -0
- package/bin/utils/packageJson.js +5 -0
- package/bin/{src/utils → utils}/pngToIco.d.ts +1 -1
- package/package.json +3 -3
- package/bin/package.json +0 -65
- /package/bin/{src/actions → actions}/build.d.ts +0 -0
- /package/bin/{src/actions → actions}/build.js +0 -0
- /package/bin/{src/actions → actions}/dist.d.ts +0 -0
- /package/bin/{src/actions → actions}/dist.js +0 -0
- /package/bin/{src/actions → actions}/minifyAsset.d.ts +0 -0
- /package/bin/{src/actions → actions}/minifyAsset.js +0 -0
- /package/bin/{src/actions → actions}/start/transformers.d.ts +0 -0
- /package/bin/{src/actions → actions}/start/transformers.js +0 -0
- /package/bin/{src/actions → actions}/start.d.ts +0 -0
- /package/bin/{src/actions → actions}/start.js +0 -0
- /package/bin/{src/actions → actions}/testTsc.d.ts +0 -0
- /package/bin/{src/actions → actions}/testTsc.js +0 -0
- /package/bin/{src/classes → classes}/Timer.d.ts +0 -0
- /package/bin/{src/classes → classes}/Timer.js +0 -0
- /package/bin/{src/cli.d.ts → cli.d.ts} +0 -0
- /package/bin/{src/config → config}/getIPAddress.d.ts +0 -0
- /package/bin/{src/config → config}/getIPAddress.js +0 -0
- /package/bin/{src/config → config}/plugins/counter.d.ts +0 -0
- /package/bin/{src/config → config}/plugins/counter.js +0 -0
- /package/bin/{src/config → config}/plugins/publicFolder.d.ts +0 -0
- /package/bin/{src/config → config}/plugins/publicFolder.js +0 -0
- /package/bin/{src/config → config}/public/client.d.ts +0 -0
- /package/bin/{src/config → config}/public/client.js +0 -0
- /package/bin/{src/config → config}/tsconfig.d.ts +0 -0
- /package/bin/{src/config → config}/tsconfig.js +0 -0
- /package/bin/{src/config → config}/userConfig.d.ts +0 -0
- /package/bin/{src/config → config}/userConfig.js +0 -0
- /package/bin/{src/constants.d.ts → constants.d.ts} +0 -0
- /package/bin/{src/constants.js → constants.js} +0 -0
- /package/bin/{src/index.d.ts → index.d.ts} +0 -0
- /package/bin/{src/index.js → index.js} +0 -0
- /package/bin/{src/types.d.ts → types.d.ts} +0 -0
- /package/bin/{src/types.js → types.js} +0 -0
- /package/bin/{src/utils → utils}/coloredString.d.ts +0 -0
- /package/bin/{src/utils → utils}/coloredString.js +0 -0
- /package/bin/{src/utils → utils}/copy.d.ts +0 -0
- /package/bin/{src/utils → utils}/copy.js +0 -0
- /package/bin/{src/utils → utils}/getAllFiles.d.ts +0 -0
- /package/bin/{src/utils → utils}/getAllFiles.js +0 -0
- /package/bin/{src/utils → utils}/getCurrentCommitSha.d.ts +0 -0
- /package/bin/{src/utils → utils}/getCurrentCommitSha.js +0 -0
- /package/bin/{src/utils → utils}/getHostURL.d.ts +0 -0
- /package/bin/{src/utils → utils}/getHostURL.js +0 -0
- /package/bin/{src/utils → utils}/getLocalURL.d.ts +0 -0
- /package/bin/{src/utils → utils}/getLocalURL.js +0 -0
- /package/bin/{src/utils → utils}/getPath.d.ts +0 -0
- /package/bin/{src/utils → utils}/getPath.js +0 -0
- /package/bin/{src/utils → utils}/globToRegex.d.ts +0 -0
- /package/bin/{src/utils → utils}/globToRegex.js +0 -0
- /package/bin/{src/utils → utils}/minify.d.ts +0 -0
- /package/bin/{src/utils → utils}/minify.js +0 -0
- /package/bin/{src/utils → utils}/pngToIco.js +0 -0
- /package/bin/{src/utils → utils}/serviceWorkerTransformer.d.ts +0 -0
- /package/bin/{src/utils → utils}/serviceWorkerTransformer.js +0 -0
- /package/bin/{src/utils → utils}/syncDirs.d.ts +0 -0
- /package/bin/{src/utils → utils}/syncDirs.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare function installPlaywright(): Promise<void>;
|
|
2
2
|
export declare function generateFeatureImage(src: string): Promise<void>;
|
|
3
|
-
export declare function generateScreenshots(): Promise<Buffer[][]>;
|
|
3
|
+
export declare function generateScreenshots(): Promise<Buffer<ArrayBufferLike>[][]>;
|
|
4
4
|
export declare function generateAssets(callback: () => void, src: string): Promise<void>;
|
|
@@ -9,9 +9,9 @@ import { assetsSizes } from "../constants.js";
|
|
|
9
9
|
import { chromium } from "playwright-core";
|
|
10
10
|
import { exec } from "child_process";
|
|
11
11
|
import { getColor } from "colorthief";
|
|
12
|
-
import
|
|
12
|
+
import { packageJson } from "../utils/packageJson.js";
|
|
13
13
|
export async function installPlaywright() {
|
|
14
|
-
const playwrightVersion = `playwright@${
|
|
14
|
+
const playwrightVersion = `playwright@${packageJson.dependencies["playwright-core"]}`;
|
|
15
15
|
console.log(`Installing ${playwrightVersion}...`);
|
|
16
16
|
return new Promise((resolve, reject) => {
|
|
17
17
|
const runners = ["bunx", "npx"];
|
|
@@ -2,10 +2,8 @@ import coloredString from "./utils/coloredString.js";
|
|
|
2
2
|
import yargs from "yargs";
|
|
3
3
|
import { Timer } from "./classes/Timer.js";
|
|
4
4
|
import { hideBin } from "yargs/helpers";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { fileURLToPath } from "url";
|
|
8
|
-
const version = JSON.parse(readFileSync(resolve(dirname(fileURLToPath(import.meta.url)), "..", "package.json"), { encoding: "utf-8" })).version;
|
|
5
|
+
import { packageJson } from "./utils/packageJson.js";
|
|
6
|
+
const version = packageJson.version;
|
|
9
7
|
export async function cli() {
|
|
10
8
|
console.log(` ${coloredString(`Running dev server version ${version}.`)}`);
|
|
11
9
|
const timer = new Timer();
|
|
@@ -27,8 +27,8 @@ declare const config: {
|
|
|
27
27
|
esbuildOptions: {
|
|
28
28
|
plugins: import("esbuild").Plugin[];
|
|
29
29
|
define: {
|
|
30
|
-
|
|
31
|
-
};
|
|
30
|
+
[key: string]: string;
|
|
31
|
+
} | undefined;
|
|
32
32
|
inject: string[];
|
|
33
33
|
bundle: boolean;
|
|
34
34
|
splitting: boolean;
|
|
@@ -90,7 +90,7 @@ declare const config: {
|
|
|
90
90
|
minifySyntax: boolean;
|
|
91
91
|
lineLimit?: number;
|
|
92
92
|
charset?: import("esbuild").Charset;
|
|
93
|
-
treeShaking
|
|
93
|
+
treeShaking: boolean;
|
|
94
94
|
ignoreAnnotations?: boolean;
|
|
95
95
|
jsx?: "transform" | "preserve" | "automatic";
|
|
96
96
|
jsxFactory?: string;
|
|
@@ -56,6 +56,7 @@ const config = {
|
|
|
56
56
|
minifyWhitespace: minify,
|
|
57
57
|
sourcemap: process.env.NODE_ENV === "DEVELOPMENT",
|
|
58
58
|
splitting: true,
|
|
59
|
+
treeShaking: true,
|
|
59
60
|
bundle: process.env.NODE_ENV !== "DISTRIBUTION",
|
|
60
61
|
keepNames: minify,
|
|
61
62
|
entryPoints: [defaultEntryPoint],
|
|
@@ -90,21 +91,22 @@ const config = {
|
|
|
90
91
|
publicFolderPlugin,
|
|
91
92
|
counterPlugin,
|
|
92
93
|
],
|
|
93
|
-
define: {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
94
|
+
define: "define" in (userConfig.esbuildOptions ?? {})
|
|
95
|
+
? userConfig.esbuildOptions.define
|
|
96
|
+
: {
|
|
97
|
+
// Intentionally added before process
|
|
98
|
+
michiProcess: JSON.stringify({
|
|
99
|
+
env: {
|
|
100
|
+
NODE_ENV: process.env.NODE_ENV,
|
|
101
|
+
COMMIT_SHA: commitSha,
|
|
102
|
+
...(userConfig.env ?? {}),
|
|
103
|
+
},
|
|
104
|
+
}),
|
|
105
|
+
},
|
|
103
106
|
inject: [
|
|
104
107
|
...devServerListener,
|
|
105
108
|
...(userConfig.esbuildOptions?.inject ?? []),
|
|
106
109
|
],
|
|
107
|
-
...(userConfig.esbuildOptions?.define ?? {}),
|
|
108
110
|
},
|
|
109
111
|
};
|
|
110
112
|
function findSymbolickLinkRealPath(packagePath) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const packageJson: any;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { readFileSync } from "fs";
|
|
2
|
+
import { dirname, resolve } from "path";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
|
+
// Intentionally not using import because typescript generates a src folder inside bin
|
|
5
|
+
export const packageJson = JSON.parse(readFileSync(resolve(dirname(fileURLToPath(import.meta.url)), "../..", "package.json"), { encoding: "utf-8" }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function pngToIco(files: Buffer[], iconSizes: number[]): Promise<Buffer
|
|
1
|
+
export declare function pngToIco(files: Buffer[], iconSizes: number[]): Promise<Buffer<ArrayBuffer>>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@michijs/dev-server",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.25",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/michijs/dev-server.git"
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@michijs/tsconfig": "0.0.4",
|
|
33
|
-
"@types/node": "22.9.
|
|
33
|
+
"@types/node": "22.9.3",
|
|
34
34
|
"@types/yargs": "17.0.33",
|
|
35
|
-
"typescript": "5.
|
|
35
|
+
"typescript": "5.7.2"
|
|
36
36
|
},
|
|
37
37
|
"keywords": [
|
|
38
38
|
"react",
|
package/bin/package.json
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@michijs/dev-server",
|
|
3
|
-
"license": "MIT",
|
|
4
|
-
"version": "0.7.23",
|
|
5
|
-
"repository": {
|
|
6
|
-
"type": "git",
|
|
7
|
-
"url": "https://github.com/michijs/dev-server.git"
|
|
8
|
-
},
|
|
9
|
-
"main": "bin/index",
|
|
10
|
-
"exports": {
|
|
11
|
-
"types": "./bin/index.d.ts",
|
|
12
|
-
"default": "./bin/index.js",
|
|
13
|
-
"constants": "./bin/constants.js"
|
|
14
|
-
},
|
|
15
|
-
"bin": {
|
|
16
|
-
"michi-server": "bin/index.js"
|
|
17
|
-
},
|
|
18
|
-
"description": "Development server based on esbuild",
|
|
19
|
-
"files": [
|
|
20
|
-
"bin/",
|
|
21
|
-
"feature-image-template.svg"
|
|
22
|
-
],
|
|
23
|
-
"type": "module",
|
|
24
|
-
"baseUrl": "./src",
|
|
25
|
-
"scripts": {
|
|
26
|
-
"dist": "tsc",
|
|
27
|
-
"dist-w": "tsc -w",
|
|
28
|
-
"bun-link": "bun link --force",
|
|
29
|
-
"link": "bunx concurrently bun:dist-w bun:bun-link"
|
|
30
|
-
},
|
|
31
|
-
"devDependencies": {
|
|
32
|
-
"@michijs/tsconfig": "0.0.4",
|
|
33
|
-
"@types/node": "22.9.0",
|
|
34
|
-
"@types/yargs": "17.0.33",
|
|
35
|
-
"typescript": "5.6.3"
|
|
36
|
-
},
|
|
37
|
-
"keywords": [
|
|
38
|
-
"react",
|
|
39
|
-
"javascript",
|
|
40
|
-
"css",
|
|
41
|
-
"bundler",
|
|
42
|
-
"typescript",
|
|
43
|
-
"compiler",
|
|
44
|
-
"jsx",
|
|
45
|
-
"commonjs",
|
|
46
|
-
"minifier",
|
|
47
|
-
"tsx",
|
|
48
|
-
"esm",
|
|
49
|
-
"server",
|
|
50
|
-
"development"
|
|
51
|
-
],
|
|
52
|
-
"engines": {
|
|
53
|
-
"node": ">=14.16"
|
|
54
|
-
},
|
|
55
|
-
"dependencies": {
|
|
56
|
-
"colorthief": "2.6.0",
|
|
57
|
-
"@types/web-app-manifest": "1.0.8",
|
|
58
|
-
"esbuild": "0.24.0",
|
|
59
|
-
"node-watch": "0.7.4",
|
|
60
|
-
"open": "10.1.0",
|
|
61
|
-
"playwright-core": "1.49.0",
|
|
62
|
-
"sharp": "0.33.5",
|
|
63
|
-
"yargs": "17.7.2"
|
|
64
|
-
}
|
|
65
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|