@peachy/core 0.0.10 → 0.0.12

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/dist/cli/bin.mjs CHANGED
@@ -1,10 +1,9 @@
1
1
  #!/usr/bin/env node
2
+ import { loadUserOptions } from "../load.mjs";
2
3
  import { build } from "./build.mjs";
3
4
  import { watch } from "./watch.mjs";
4
- import { loadUserOptions } from "../load.mjs";
5
- import { minArgs } from "minargs";
6
5
  import { join } from "node:path";
7
-
6
+ import { minArgs } from "minargs";
8
7
  //#region src/cli/bin.ts
9
8
  const { positionals } = minArgs();
10
9
  const config = {
@@ -44,6 +43,5 @@ Positional arguments:
44
43
  `);
45
44
  }
46
45
  process.exit(0);
47
-
48
46
  //#endregion
49
- export { };
47
+ export {};
@@ -1,7 +1,6 @@
1
1
  import { getOptions } from "../options.mjs";
2
- import { build } from "rolldown";
3
2
  import { join, resolve } from "node:path";
4
-
3
+ import { build } from "rolldown";
5
4
  //#region src/cli/build.ts
6
5
  async function build$1(config) {
7
6
  const { input, output } = getOptions(config);
@@ -12,6 +11,5 @@ async function build$1(config) {
12
11
  const firstOut = resolve(process.cwd(), join("dist", result.output[0].fileName));
13
12
  console.log(firstOut);
14
13
  }
15
-
16
14
  //#endregion
17
- export { build$1 as build };
15
+ export { build$1 as build };
@@ -1,6 +1,5 @@
1
1
  import { getOptions } from "../options.mjs";
2
2
  import { watch } from "rolldown";
3
-
4
3
  //#region src/cli/watch.ts
5
4
  function watch$1(config) {
6
5
  return new Promise((resolve) => {
@@ -17,6 +16,5 @@ function watch$1(config) {
17
16
  watcher.on("close", () => resolve());
18
17
  });
19
18
  }
20
-
21
19
  //#endregion
22
- export { watch$1 as watch };
20
+ export { watch$1 as watch };
package/dist/cli/ws.mjs CHANGED
@@ -1,5 +1,4 @@
1
1
  import { WebSocketServer } from "ws";
2
-
3
2
  //#region src/cli/ws.ts
4
3
  function createWebSocketServer() {
5
4
  const wss = new WebSocketServer({ port: 0 });
@@ -28,6 +27,5 @@ function broadcastMessage(wss, message) {
28
27
  if (client.readyState === WebSocket.OPEN) client.send(message);
29
28
  });
30
29
  }
31
-
32
30
  //#endregion
33
- export { broadcastMessage, createWebSocketServer };
31
+ export { broadcastMessage, createWebSocketServer };
package/dist/config.mjs CHANGED
@@ -2,6 +2,5 @@
2
2
  function defineConfig(options) {
3
3
  return options;
4
4
  }
5
-
6
5
  //#endregion
7
- export { defineConfig };
6
+ export { defineConfig };
@@ -1,5 +1,4 @@
1
1
  //#region src/constants.ts
2
2
  const PEACHY_ICONS_DEFAULT_PATH = "data/icons";
3
-
4
3
  //#endregion
5
- export { PEACHY_ICONS_DEFAULT_PATH };
4
+ export { PEACHY_ICONS_DEFAULT_PATH };
package/dist/index.mjs CHANGED
@@ -1,3 +1,2 @@
1
1
  import { defineConfig } from "./config.mjs";
2
-
3
- export { defineConfig };
2
+ export { defineConfig };
package/dist/load.mjs CHANGED
@@ -1,6 +1,5 @@
1
1
  import fs from "fs/promises";
2
2
  import path from "path";
3
-
4
3
  //#region src/load.ts
5
4
  const CONFIG_NAMES = [
6
5
  "peachy.config.ts",
@@ -37,6 +36,5 @@ async function loadUserOptions() {
37
36
  async function exists(path) {
38
37
  return fs.stat(path).then((info) => info.isFile()).catch(() => false);
39
38
  }
40
-
41
39
  //#endregion
42
- export { loadUserOptions };
40
+ export { loadUserOptions };
package/dist/options.mjs CHANGED
@@ -1,12 +1,12 @@
1
1
  import { broadcastMessage, createWebSocketServer } from "./cli/ws.mjs";
2
2
  import { PEACHY_ICONS_DEFAULT_PATH } from "./constants.mjs";
3
+ import { resolve } from "node:path";
4
+ import { cssPlugin } from "@peachy/plugin-css";
3
5
  import { reactHMRPlugin } from "@peachy/plugin-react";
6
+ import { resourcesPlugin } from "@peachy/plugin-resources";
4
7
  import { gjsRunner } from "@peachy/plugin-runner";
5
- import { resolve } from "node:path";
6
8
  import { replacePlugin } from "rolldown/plugins";
7
9
  import { cleandir } from "rollup-plugin-cleandir";
8
- import { resourcesPlugin } from "@peachy/plugin-resources";
9
-
10
10
  //#region src/options.ts
11
11
  function getOptions(options) {
12
12
  const { wss, port, setReloadHandler } = createWebSocketServer();
@@ -39,8 +39,10 @@ function getOptions(options) {
39
39
  setRunnerEnv(key, value) {
40
40
  options.runner.env[key] = value;
41
41
  },
42
- iconsPath: options.user.resources == true || options.user.resources?.icons === true ? PEACHY_ICONS_DEFAULT_PATH : options.user.resources?.icons == false ? false : options.user.resources?.icons ?? PEACHY_ICONS_DEFAULT_PATH
43
- }) : null
42
+ iconsPath: options.user.resources == true || options.user.resources?.icons === true ? PEACHY_ICONS_DEFAULT_PATH : options.user.resources?.icons == false ? false : options.user.resources?.icons ?? "data/icons",
43
+ bundle: typeof options.user.resources === "object" ? options.user.resources.bundle : void 0
44
+ }) : null,
45
+ cssPlugin({ prod })
44
46
  ]
45
47
  },
46
48
  output: {
@@ -53,6 +55,5 @@ function getOptions(options) {
53
55
  }
54
56
  };
55
57
  }
56
-
57
58
  //#endregion
58
- export { getOptions };
59
+ export { getOptions };
package/dist/types.d.mts CHANGED
@@ -1,3 +1,4 @@
1
+ import { BundledResource } from "@peachy/plugin-resources";
1
2
  import { RunnerOptions } from "@peachy/plugin-runner";
2
3
 
3
4
  //#region src/types.d.ts
@@ -21,6 +22,10 @@ interface UserOptions {
21
22
  * Default is true
22
23
  */
23
24
  icons?: boolean | string;
25
+ /**
26
+ * Resources to bundle automatically
27
+ */
28
+ bundle?: BundledResource[];
24
29
  };
25
30
  }
26
31
  interface InternalOptions {
package/package.json CHANGED
@@ -1,11 +1,17 @@
1
1
  {
2
2
  "name": "@peachy/core",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "description": "Base peachy CLI",
5
- "type": "module",
5
+ "license": "MIT",
6
+ "author": "Angelo Verlain <hey@vixalien.com>",
6
7
  "bin": {
7
8
  "peachy": "./dist/cli/bin.mjs"
8
9
  },
10
+ "files": [
11
+ "dist",
12
+ "tsconfig.json"
13
+ ],
14
+ "type": "module",
9
15
  "exports": {
10
16
  ".": {
11
17
  "import": "./dist/index.mjs",
@@ -13,28 +19,23 @@
13
19
  },
14
20
  "./tsconfig": "./tsconfig.json"
15
21
  },
16
- "author": "Angelo Verlain <hey@vixalien.com>",
17
- "license": "MIT",
18
- "devDependencies": {
19
- "@types/node": "^25.2.1",
20
- "@types/ws": "^8.18.1",
21
- "tsdown": "0.20.3",
22
- "tsx": "^4.21.0"
23
- },
24
22
  "dependencies": {
25
- "@peachy/types": "^2025.2.4",
23
+ "@peachy/types": "^2026.3.10",
26
24
  "minargs": "^2.1.0",
27
- "rolldown": "1.0.0-rc.3",
25
+ "rolldown": "1.0.0-rc.7",
28
26
  "rollup-plugin-cleandir": "^3.0.0",
29
27
  "ws": "^8.19.0",
30
- "@peachy/plugin-runner": "0.0.10",
31
- "@peachy/plugin-react": "0.0.10",
32
- "@peachy/plugin-resources": "0.0.10"
28
+ "@peachy/plugin-css": "0.0.12",
29
+ "@peachy/plugin-react": "0.0.12",
30
+ "@peachy/plugin-resources": "0.0.12",
31
+ "@peachy/plugin-runner": "0.0.12"
32
+ },
33
+ "devDependencies": {
34
+ "@types/node": "^25.3.5",
35
+ "@types/ws": "^8.18.1",
36
+ "tsdown": "0.21.0",
37
+ "tsx": "^4.21.0"
33
38
  },
34
- "files": [
35
- "dist",
36
- "tsconfig.json"
37
- ],
38
39
  "scripts": {
39
40
  "build": "tsdown"
40
41
  }
package/tsconfig.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "strict": true,
4
- "checkJs": true,
5
4
  "esModuleInterop": true,
6
5
  "lib": ["es2024"],
7
6
  "allowSyntheticDefaultImports": true,
@@ -10,14 +9,19 @@
10
9
  "moduleResolution": "bundler",
11
10
  "noEmit": true,
12
11
  "skipLibCheck": true,
12
+ "isolatedDeclarations": true,
13
+ "composite": true
13
14
  },
14
15
  "include": [
15
16
  // when installed locally
16
17
  "./node_modules/@peachy/types/types/index.d.ts",
17
- "./node_modules/@peachy/plugin-resources/src/types/global.d.ts",
18
+ "./node_modules/@peachy/plugin-resources/src/modules.d.ts",
19
+ "./node_modules/@peachy/plugin-css/src/modules.d.ts",
18
20
  // when installed via npm/pnpm
19
21
  "../types/types/index.d.ts",
20
- "../plugin-resources/src/types/global.d.ts",
21
- "${configDir}/src/**/*",
22
+ "../plugin-resources/src/modules.d.ts",
23
+ "../plugin-css/src/modules.d.ts",
24
+ "${configDir}/src/**/*"
22
25
  ],
26
+ "exclude": ["dist", "${configDir}/dist"]
23
27
  }