@shuvi/shared 1.0.54 → 1.0.56

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.
@@ -1,5 +1,5 @@
1
1
  export declare const NAME = "shuvi";
2
- export declare const DEV_ONLY_URL_PREFIX: string;
2
+ export declare const DEV_ONLY_URL_PREFIX = "/_shuvi";
3
3
  export declare const ROUTE_RESOURCE_QUERYSTRING = "shuvi-route";
4
4
  export declare const LOADER_RESOURCE_QUERYSTRING = "shuvi-page-loader";
5
5
  export declare const PUBLIC_ENV_PREFIX = "SHUVI_PUBLIC_";
@@ -7,10 +7,10 @@ export declare const CLIENT_CONTAINER_ID = "__APP";
7
7
  export declare const CLIENT_APPDATA_ID = "__APP_DATA";
8
8
  export declare const DEV_STYLE_ANCHOR_ID = "__shuvi_style_anchor";
9
9
  export declare const DEV_STYLE_HIDE_FOUC = "data-shuvi-hide-fouc";
10
- export declare const DEV_HOT_MIDDLEWARE_PATH: string;
11
- export declare const DEV_HOT_LAUNCH_EDITOR_ENDPOINT: string;
12
- export declare const DEV_ORIGINAL_STACK_FRAME_ENDPOINT: string;
13
- export declare const DEV_READY_ENDPOINT: string;
10
+ export declare const DEV_HOT_MIDDLEWARE_PATH = "/_shuvi/webpack-hmr";
11
+ export declare const DEV_HOT_LAUNCH_EDITOR_ENDPOINT = "/_shuvi/development/open-stack-frame-in-editor";
12
+ export declare const DEV_ORIGINAL_STACK_FRAME_ENDPOINT = "/_shuvi/development/original-stack-frame";
13
+ export declare const DEV_READY_ENDPOINT = "/_shuvi/development/ready";
14
14
  export declare const DEV_SOCKET_TIMEOUT_MS = 5000;
15
15
  export declare const ROUTE_NOT_FOUND_NAME = "404";
16
16
  export declare const SHUVI_ERROR: {
@@ -30,7 +30,7 @@ export declare const SHUVI_ERROR: {
30
30
  message: string;
31
31
  };
32
32
  };
33
- export declare const BUNDLER_TARGET_CLIENT: string;
34
- export declare const BUNDLER_TARGET_SERVER: string;
33
+ export declare const BUNDLER_TARGET_CLIENT = "shuvi/client";
34
+ export declare const BUNDLER_TARGET_SERVER = "shuvi/server";
35
35
  export declare const CLIENT_OUTPUT_DIR = "client";
36
36
  export declare const SERVER_OUTPUT_DIR = "server";
package/esm/plugins.d.ts CHANGED
@@ -2,7 +2,7 @@ import { HookMap, Setup, IPluginHandlers, PluginOptions as _PluginOptions, IPlug
2
2
  export declare const GROUP_BEFORE_USER = -1;
3
3
  export declare const GROUP_USER = 0;
4
4
  export declare const GROUP_AFTER_USER = 1;
5
- export declare type PluginOptions = {
5
+ export type PluginOptions = {
6
6
  name?: _PluginOptions['name'];
7
7
  before?: _PluginOptions['before'];
8
8
  after?: _PluginOptions['after'];
package/esm/reporter.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export declare type SpanId = number;
2
- export declare type traceData = {
1
+ export type SpanId = number;
2
+ export type traceData = {
3
3
  timestamp: number;
4
4
  name: string;
5
5
  duration: number;
@@ -9,4 +9,4 @@ export declare type traceData = {
9
9
  parentId?: SpanId;
10
10
  attrs?: Object;
11
11
  };
12
- export declare type Reporter = (data: traceData) => void;
12
+ export type Reporter = (data: traceData) => void;
@@ -1,5 +1,4 @@
1
- /// <reference lib="dom" />
2
- export declare type Store = Record<string, any>;
1
+ export type Store = Record<string, any>;
3
2
  export declare class Telestore {
4
3
  private _store;
5
4
  constructor(store: Store);
package/esm/telestore.js CHANGED
@@ -1,3 +1,4 @@
1
+ /// <reference lib="dom" />
1
2
  const hasOwnProperty = Object.prototype.hasOwnProperty;
2
3
  const isServer = typeof window === 'undefined';
3
4
  // set on server, get from client
@@ -1,5 +1,5 @@
1
1
  export declare const NAME = "shuvi";
2
- export declare const DEV_ONLY_URL_PREFIX: string;
2
+ export declare const DEV_ONLY_URL_PREFIX = "/_shuvi";
3
3
  export declare const ROUTE_RESOURCE_QUERYSTRING = "shuvi-route";
4
4
  export declare const LOADER_RESOURCE_QUERYSTRING = "shuvi-page-loader";
5
5
  export declare const PUBLIC_ENV_PREFIX = "SHUVI_PUBLIC_";
@@ -7,10 +7,10 @@ export declare const CLIENT_CONTAINER_ID = "__APP";
7
7
  export declare const CLIENT_APPDATA_ID = "__APP_DATA";
8
8
  export declare const DEV_STYLE_ANCHOR_ID = "__shuvi_style_anchor";
9
9
  export declare const DEV_STYLE_HIDE_FOUC = "data-shuvi-hide-fouc";
10
- export declare const DEV_HOT_MIDDLEWARE_PATH: string;
11
- export declare const DEV_HOT_LAUNCH_EDITOR_ENDPOINT: string;
12
- export declare const DEV_ORIGINAL_STACK_FRAME_ENDPOINT: string;
13
- export declare const DEV_READY_ENDPOINT: string;
10
+ export declare const DEV_HOT_MIDDLEWARE_PATH = "/_shuvi/webpack-hmr";
11
+ export declare const DEV_HOT_LAUNCH_EDITOR_ENDPOINT = "/_shuvi/development/open-stack-frame-in-editor";
12
+ export declare const DEV_ORIGINAL_STACK_FRAME_ENDPOINT = "/_shuvi/development/original-stack-frame";
13
+ export declare const DEV_READY_ENDPOINT = "/_shuvi/development/ready";
14
14
  export declare const DEV_SOCKET_TIMEOUT_MS = 5000;
15
15
  export declare const ROUTE_NOT_FOUND_NAME = "404";
16
16
  export declare const SHUVI_ERROR: {
@@ -30,7 +30,7 @@ export declare const SHUVI_ERROR: {
30
30
  message: string;
31
31
  };
32
32
  };
33
- export declare const BUNDLER_TARGET_CLIENT: string;
34
- export declare const BUNDLER_TARGET_SERVER: string;
33
+ export declare const BUNDLER_TARGET_CLIENT = "shuvi/client";
34
+ export declare const BUNDLER_TARGET_SERVER = "shuvi/server";
35
35
  export declare const CLIENT_OUTPUT_DIR = "client";
36
36
  export declare const SERVER_OUTPUT_DIR = "server";
package/lib/plugins.d.ts CHANGED
@@ -2,7 +2,7 @@ import { HookMap, Setup, IPluginHandlers, PluginOptions as _PluginOptions, IPlug
2
2
  export declare const GROUP_BEFORE_USER = -1;
3
3
  export declare const GROUP_USER = 0;
4
4
  export declare const GROUP_AFTER_USER = 1;
5
- export declare type PluginOptions = {
5
+ export type PluginOptions = {
6
6
  name?: _PluginOptions['name'];
7
7
  before?: _PluginOptions['before'];
8
8
  after?: _PluginOptions['after'];
package/lib/plugins.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createPluginCreator = exports.GROUP_AFTER_USER = exports.GROUP_USER = exports.GROUP_BEFORE_USER = void 0;
3
+ exports.GROUP_AFTER_USER = exports.GROUP_USER = exports.GROUP_BEFORE_USER = void 0;
4
+ exports.createPluginCreator = createPluginCreator;
4
5
  const hook_1 = require("@shuvi/hook");
5
6
  exports.GROUP_BEFORE_USER = -1;
6
7
  exports.GROUP_USER = 0;
@@ -41,4 +42,3 @@ function createPluginCreator() {
41
42
  }
42
43
  };
43
44
  }
44
- exports.createPluginCreator = createPluginCreator;
package/lib/reporter.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export declare type SpanId = number;
2
- export declare type traceData = {
1
+ export type SpanId = number;
2
+ export type traceData = {
3
3
  timestamp: number;
4
4
  name: string;
5
5
  duration: number;
@@ -9,4 +9,4 @@ export declare type traceData = {
9
9
  parentId?: SpanId;
10
10
  attrs?: Object;
11
11
  };
12
- export declare type Reporter = (data: traceData) => void;
12
+ export type Reporter = (data: traceData) => void;
@@ -1,5 +1,4 @@
1
- /// <reference lib="dom" />
2
- export declare type Store = Record<string, any>;
1
+ export type Store = Record<string, any>;
3
2
  export declare class Telestore {
4
3
  private _store;
5
4
  constructor(store: Store);
package/lib/telestore.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Telestore = void 0;
4
+ /// <reference lib="dom" />
4
5
  const hasOwnProperty = Object.prototype.hasOwnProperty;
5
6
  const isServer = typeof window === 'undefined';
6
7
  // set on server, get from client
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shuvi/shared",
3
- "version": "1.0.54",
3
+ "version": "1.0.56",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/shuvijs/shuvi.git",
@@ -26,17 +26,17 @@
26
26
  },
27
27
  "scripts": {
28
28
  "dev": "run-p watch:*",
29
- "watch:esm": "tsc -p tsconfig.build.json -m esnext --outDir esm -w",
30
- "watch:cjs": "tsc -p tsconfig.build.json -m commonjs --outDir lib -w",
29
+ "watch:esm": "tsc -p tsconfig.build.esm.json -w",
30
+ "watch:cjs": "tsc -p tsconfig.build.cjs.json -w",
31
31
  "prebuild": "rimraf lib esm",
32
32
  "build": "run-p build:*",
33
- "build:esm": "tsc -p tsconfig.build.json -m esnext --outDir esm",
34
- "build:cjs": "tsc -p tsconfig.build.json -m commonjs --outDir lib"
33
+ "build:esm": "tsc -p tsconfig.build.esm.json",
34
+ "build:cjs": "tsc -p tsconfig.build.cjs.json"
35
35
  },
36
36
  "engines": {
37
37
  "node": ">= 16.0.0"
38
38
  },
39
39
  "dependencies": {
40
- "@shuvi/hook": "1.0.54"
40
+ "@shuvi/hook": "1.0.56"
41
41
  }
42
42
  }