@utoo/pack-shared 1.3.2-alpha.0 → 1.3.2

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/cjs/config.d.ts CHANGED
@@ -20,15 +20,7 @@ export type RustifiedEnv = {
20
20
  }[];
21
21
  export interface ExperimentalConfig {
22
22
  swcPlugins?: [string, any][];
23
- dynamicIO?: boolean;
24
- useCache?: boolean;
25
- cacheHandlers?: Record<string, string>;
26
- esmExternals?: boolean | "loose";
27
- ppr?: boolean | "incremental";
28
- taint?: boolean;
29
23
  reactCompiler?: boolean | any;
30
- viewTransition?: boolean;
31
- serverActions?: boolean | any;
32
24
  }
33
25
  export type JSONValue = string | number | boolean | JSONValue[] | {
34
26
  [k: string]: JSONValue;
@@ -69,45 +61,6 @@ export type TurbopackRuleConfigCollection = TurbopackRuleConfigItem | (Turbopack
69
61
  export interface ModuleOptions {
70
62
  rules?: Record<string, TurbopackRuleConfigCollection>;
71
63
  }
72
- /**
73
- * Path rewrite: object form applies first matching regex→replacement;
74
- * function form receives path and returns new path (sync only).
75
- */
76
- export type PathRewrite = {
77
- [regexp: string]: string;
78
- } | ((path: string) => string);
79
- /**
80
- * Proxy rule for dev server HTTP/WS proxying.
81
- * Mostly aligned with webpack-dev-server / http-proxy-middleware options.
82
- */
83
- export interface ProxyRule {
84
- /**
85
- * Path(s) to match for proxying.
86
- * When starts with `^`, will be treated as RegExp source.
87
- * Otherwise, simple prefix match is used.
88
- */
89
- context: string | string[];
90
- /** Target server URL. */
91
- target: string;
92
- /**
93
- * Path rewrite. Object: first matching regex is replaced (http-proxy-middleware style).
94
- * Function: (path) => new path.
95
- */
96
- pathRewrite?: PathRewrite;
97
- /**
98
- * Whether to change the Host header to match the target.
99
- * Defaults to true.
100
- */
101
- changeOrigin?: boolean;
102
- /**
103
- * Whether to verify the SSL certificate of the target.
104
- * Set to false to accept self-signed certificates.
105
- */
106
- secure?: boolean;
107
- }
108
- export type DevServerProxy = ProxyRule[];
109
- /** Object style proxy options without `context`. */
110
- export type ProxyOptions = Omit<ProxyRule, "context">;
111
64
  export interface ResolveOptions {
112
65
  alias?: Record<string, string | string[] | Record<string, string | string[]>>;
113
66
  extensions?: string[];
@@ -147,8 +100,6 @@ export interface DevServerConfig {
147
100
  host?: string;
148
101
  /** Use HTTPS; when true without a certificate, a self-signed cert may be generated. */
149
102
  https?: boolean;
150
- /** HTTP proxy rules for Hono dev server (HTTP only; no generic WS proxy in this layer). */
151
- proxy?: DevServerProxy;
152
103
  }
153
104
  export interface ConfigComplete {
154
105
  entry: EntryOptions[];
@@ -209,6 +160,7 @@ export interface ConfigComplete {
209
160
  styles?: {
210
161
  autoCssModules?: boolean;
211
162
  emotion?: boolean;
163
+ postcss?: JSONValue;
212
164
  less?: {
213
165
  implementation?: string;
214
166
  [key: string]: any;
package/cjs/utils.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { DevServerProxy, ProxyOptions, RustifiedEnv } from "./config";
1
+ import { RustifiedEnv } from "./config";
2
2
  import { Issue } from "./issue";
3
3
  export declare class ModuleBuildError extends Error {
4
4
  name: string;
@@ -9,19 +9,6 @@ export interface ResultWithIssues {
9
9
  export declare function processIssues(result: ResultWithIssues, throwIssue: boolean, logErrors: boolean): void;
10
10
  export declare function isWellKnownError(issue: Issue): boolean;
11
11
  export declare function rustifyEnv(env: Record<string, string>): RustifiedEnv;
12
- /**
13
- * Convert object-style proxy config into DevServerProxy array.
14
- * Object keys become context; string value → target + default changeOrigin; object value merged into ProxyRule.
15
- *
16
- * @example
17
- * proxy: [
18
- * ...proxyFromObject({
19
- * "/api": "http://localhost:3000",
20
- * "/auth": { target: "http://localhost:5000", changeOrigin: true },
21
- * }),
22
- * ];
23
- */
24
- export declare function proxyFromObject(obj: Record<string, string | ProxyOptions>): DevServerProxy;
25
12
  type AnyFunc<T> = (this: T, ...args: any) => any;
26
13
  export declare function debounce<T, F extends AnyFunc<T>>(fn: F, ms: number, maxWait?: number): (this: T, ...passedArgs: Parameters<F>) => void;
27
14
  export {};
package/cjs/utils.js CHANGED
@@ -4,7 +4,6 @@ exports.ModuleBuildError = void 0;
4
4
  exports.processIssues = processIssues;
5
5
  exports.isWellKnownError = isWellKnownError;
6
6
  exports.rustifyEnv = rustifyEnv;
7
- exports.proxyFromObject = proxyFromObject;
8
7
  exports.debounce = debounce;
9
8
  const issue_1 = require("./issue");
10
9
  const styledString_1 = require("./styledString");
@@ -56,40 +55,6 @@ function rustifyEnv(env) {
56
55
  value,
57
56
  }));
58
57
  }
59
- /**
60
- * Convert object-style proxy config into DevServerProxy array.
61
- * Object keys become context; string value → target + default changeOrigin; object value merged into ProxyRule.
62
- *
63
- * @example
64
- * proxy: [
65
- * ...proxyFromObject({
66
- * "/api": "http://localhost:3000",
67
- * "/auth": { target: "http://localhost:5000", changeOrigin: true },
68
- * }),
69
- * ];
70
- */
71
- function proxyFromObject(obj) {
72
- const rules = [];
73
- for (const [context, value] of Object.entries(obj)) {
74
- if (!value)
75
- continue;
76
- if (typeof value === "string") {
77
- rules.push({
78
- context,
79
- target: value,
80
- changeOrigin: true,
81
- });
82
- }
83
- else {
84
- rules.push({
85
- context,
86
- changeOrigin: true,
87
- ...value,
88
- });
89
- }
90
- }
91
- return rules;
92
- }
93
58
  function debounce(fn, ms, maxWait = Infinity) {
94
59
  let timeoutId;
95
60
  // The time the debouncing function was first called during this debounce queue.
package/esm/config.d.ts CHANGED
@@ -20,15 +20,7 @@ export type RustifiedEnv = {
20
20
  }[];
21
21
  export interface ExperimentalConfig {
22
22
  swcPlugins?: [string, any][];
23
- dynamicIO?: boolean;
24
- useCache?: boolean;
25
- cacheHandlers?: Record<string, string>;
26
- esmExternals?: boolean | "loose";
27
- ppr?: boolean | "incremental";
28
- taint?: boolean;
29
23
  reactCompiler?: boolean | any;
30
- viewTransition?: boolean;
31
- serverActions?: boolean | any;
32
24
  }
33
25
  export type JSONValue = string | number | boolean | JSONValue[] | {
34
26
  [k: string]: JSONValue;
@@ -69,45 +61,6 @@ export type TurbopackRuleConfigCollection = TurbopackRuleConfigItem | (Turbopack
69
61
  export interface ModuleOptions {
70
62
  rules?: Record<string, TurbopackRuleConfigCollection>;
71
63
  }
72
- /**
73
- * Path rewrite: object form applies first matching regex→replacement;
74
- * function form receives path and returns new path (sync only).
75
- */
76
- export type PathRewrite = {
77
- [regexp: string]: string;
78
- } | ((path: string) => string);
79
- /**
80
- * Proxy rule for dev server HTTP/WS proxying.
81
- * Mostly aligned with webpack-dev-server / http-proxy-middleware options.
82
- */
83
- export interface ProxyRule {
84
- /**
85
- * Path(s) to match for proxying.
86
- * When starts with `^`, will be treated as RegExp source.
87
- * Otherwise, simple prefix match is used.
88
- */
89
- context: string | string[];
90
- /** Target server URL. */
91
- target: string;
92
- /**
93
- * Path rewrite. Object: first matching regex is replaced (http-proxy-middleware style).
94
- * Function: (path) => new path.
95
- */
96
- pathRewrite?: PathRewrite;
97
- /**
98
- * Whether to change the Host header to match the target.
99
- * Defaults to true.
100
- */
101
- changeOrigin?: boolean;
102
- /**
103
- * Whether to verify the SSL certificate of the target.
104
- * Set to false to accept self-signed certificates.
105
- */
106
- secure?: boolean;
107
- }
108
- export type DevServerProxy = ProxyRule[];
109
- /** Object style proxy options without `context`. */
110
- export type ProxyOptions = Omit<ProxyRule, "context">;
111
64
  export interface ResolveOptions {
112
65
  alias?: Record<string, string | string[] | Record<string, string | string[]>>;
113
66
  extensions?: string[];
@@ -147,8 +100,6 @@ export interface DevServerConfig {
147
100
  host?: string;
148
101
  /** Use HTTPS; when true without a certificate, a self-signed cert may be generated. */
149
102
  https?: boolean;
150
- /** HTTP proxy rules for Hono dev server (HTTP only; no generic WS proxy in this layer). */
151
- proxy?: DevServerProxy;
152
103
  }
153
104
  export interface ConfigComplete {
154
105
  entry: EntryOptions[];
@@ -209,6 +160,7 @@ export interface ConfigComplete {
209
160
  styles?: {
210
161
  autoCssModules?: boolean;
211
162
  emotion?: boolean;
163
+ postcss?: JSONValue;
212
164
  less?: {
213
165
  implementation?: string;
214
166
  [key: string]: any;
package/esm/utils.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { DevServerProxy, ProxyOptions, RustifiedEnv } from "./config";
1
+ import { RustifiedEnv } from "./config";
2
2
  import { Issue } from "./issue";
3
3
  export declare class ModuleBuildError extends Error {
4
4
  name: string;
@@ -9,19 +9,6 @@ export interface ResultWithIssues {
9
9
  export declare function processIssues(result: ResultWithIssues, throwIssue: boolean, logErrors: boolean): void;
10
10
  export declare function isWellKnownError(issue: Issue): boolean;
11
11
  export declare function rustifyEnv(env: Record<string, string>): RustifiedEnv;
12
- /**
13
- * Convert object-style proxy config into DevServerProxy array.
14
- * Object keys become context; string value → target + default changeOrigin; object value merged into ProxyRule.
15
- *
16
- * @example
17
- * proxy: [
18
- * ...proxyFromObject({
19
- * "/api": "http://localhost:3000",
20
- * "/auth": { target: "http://localhost:5000", changeOrigin: true },
21
- * }),
22
- * ];
23
- */
24
- export declare function proxyFromObject(obj: Record<string, string | ProxyOptions>): DevServerProxy;
25
12
  type AnyFunc<T> = (this: T, ...args: any) => any;
26
13
  export declare function debounce<T, F extends AnyFunc<T>>(fn: F, ms: number, maxWait?: number): (this: T, ...passedArgs: Parameters<F>) => void;
27
14
  export {};
package/esm/utils.js CHANGED
@@ -47,40 +47,6 @@ export function rustifyEnv(env) {
47
47
  value,
48
48
  }));
49
49
  }
50
- /**
51
- * Convert object-style proxy config into DevServerProxy array.
52
- * Object keys become context; string value → target + default changeOrigin; object value merged into ProxyRule.
53
- *
54
- * @example
55
- * proxy: [
56
- * ...proxyFromObject({
57
- * "/api": "http://localhost:3000",
58
- * "/auth": { target: "http://localhost:5000", changeOrigin: true },
59
- * }),
60
- * ];
61
- */
62
- export function proxyFromObject(obj) {
63
- const rules = [];
64
- for (const [context, value] of Object.entries(obj)) {
65
- if (!value)
66
- continue;
67
- if (typeof value === "string") {
68
- rules.push({
69
- context,
70
- target: value,
71
- changeOrigin: true,
72
- });
73
- }
74
- else {
75
- rules.push({
76
- context,
77
- changeOrigin: true,
78
- ...value,
79
- });
80
- }
81
- }
82
- return rules;
83
- }
84
50
  export function debounce(fn, ms, maxWait = Infinity) {
85
51
  let timeoutId;
86
52
  // The time the debouncing function was first called during this debounce queue.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utoo/pack-shared",
3
- "version": "1.3.2-alpha.0",
3
+ "version": "1.3.2",
4
4
  "main": "cjs/index.js",
5
5
  "module": "esm/index.js",
6
6
  "types": "esm/index.d.ts",