@eggjs/static 4.0.0-beta.15 → 4.0.0-beta.18

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,4 +1,4 @@
1
- import { StaticConfig } from "../../types.js";
1
+ import { StaticConfig } from "../../config/config.default.js";
2
2
  import { Application, Context } from "egg";
3
3
  import compose from "koa-compose";
4
4
 
@@ -1,6 +1,56 @@
1
1
  import * as egg0 from "egg";
2
+ import { Options } from "@eggjs/koa-static-cache";
2
3
 
3
4
  //#region src/config/config.default.d.ts
5
+ interface StaticDirOptions extends Omit<Options, 'dir'> {
6
+ /**
7
+ * static files store dir
8
+ */
9
+ dir: string;
10
+ /**
11
+ * static files prefix
12
+ * Default to `'/public/'`
13
+ */
14
+ prefix: string;
15
+ /**
16
+ * cache max age in `seconds`
17
+ * Default to `0` on development, `31536000` on production
18
+ */
19
+ maxAge: number;
20
+ /**
21
+ * dynamic load file which not cached on initialization
22
+ * Default to `true`
23
+ */
24
+ dynamic: boolean;
25
+ /**
26
+ * caches the assets on initialization or not,
27
+ * always work together with `options.dynamic`
28
+ * Default to `false`
29
+ */
30
+ preload: boolean;
31
+ /**
32
+ * buffer the file content or not
33
+ * Default to `false` on development, `true` on production
34
+ */
35
+ buffer: boolean;
36
+ /**
37
+ * max files count in store
38
+ * Default to `1000`
39
+ */
40
+ maxFiles: number;
41
+ }
42
+ interface StaticConfig extends Omit<StaticDirOptions, 'dir'> {
43
+ /**
44
+ * static files store dir
45
+ * Default to `${baseDir}/app/public`
46
+ */
47
+ dir: string | Array<string | StaticDirOptions>;
48
+ /**
49
+ * static files store dirs
50
+ * @deprecated use `dir` instead
51
+ */
52
+ dirs?: Array<string | StaticDirOptions>;
53
+ }
4
54
  declare const _default: egg0.EggConfigFactory;
5
55
  //#endregion
6
- export { _default as default };
56
+ export { StaticConfig, StaticDirOptions, _default as default };
package/dist/types.d.ts CHANGED
@@ -1,64 +1,13 @@
1
- import { Options } from "@eggjs/koa-static-cache";
1
+ import { StaticConfig } from "./config/config.default.js";
2
2
 
3
3
  //#region src/types.d.ts
4
- interface StaticDirOptions extends Omit<Options, 'dir'> {
5
- /**
6
- * static files store dir
7
- */
8
- dir: string;
9
- /**
10
- * static files prefix
11
- * Default to `'/public/'`
12
- */
13
- prefix: string;
14
- /**
15
- * cache max age in `seconds`
16
- * Default to `0` on development, `31536000` on production
17
- */
18
- maxAge: number;
19
- /**
20
- * dynamic load file which not cached on initialization
21
- * Default to `true`
22
- */
23
- dynamic: boolean;
24
- /**
25
- * caches the assets on initialization or not,
26
- * always work together with `options.dynamic`
27
- * Default to `false`
28
- */
29
- preload: boolean;
30
- /**
31
- * buffer the file content or not
32
- * Default to `false` on development, `true` on production
33
- */
34
- buffer: boolean;
35
- /**
36
- * max files count in store
37
- * Default to `1000`
38
- */
39
- maxFiles: number;
40
- }
41
- /**
42
- * Static file serve
43
- * @member Config#static
44
- * @see https://github.com/eggjs/egg/tree/next/packages/koa-static-cache
45
- */
46
- interface StaticConfig extends Omit<StaticDirOptions, 'dir'> {
47
- /**
48
- * static files store dir
49
- * Default to `${baseDir}/app/public`
50
- */
51
- dir: string | Array<string | StaticDirOptions>;
4
+ declare module 'egg' {
52
5
  /**
53
- * static files store dirs
54
- * @deprecated use `dir` instead
6
+ * Static file serve
7
+ * @member Config#static
8
+ * @see https://github.com/eggjs/egg/tree/next/packages/koa-static-cache
55
9
  */
56
- dirs?: Array<string | StaticDirOptions>;
57
- }
58
- declare module 'egg' {
59
10
  interface EggAppConfig {
60
11
  static: StaticConfig;
61
12
  }
62
- }
63
- //#endregion
64
- export { StaticConfig, StaticDirOptions };
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eggjs/static",
3
- "version": "4.0.0-beta.15",
3
+ "version": "4.0.0-beta.18",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -32,20 +32,20 @@
32
32
  "koa-compose": "^4.1.0",
33
33
  "koa-range": "^0.3.0",
34
34
  "ylru": "^2.0.0",
35
- "@eggjs/koa-static-cache": "7.0.0-beta.15"
35
+ "@eggjs/koa-static-cache": "7.0.0-beta.18"
36
36
  },
37
37
  "peerDependencies": {
38
- "egg": "4.1.0-beta.15"
38
+ "egg": "4.1.0-beta.18"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/koa-compose": "^3.2.8",
42
42
  "@types/koa-range": "^0.3.5",
43
- "oxlint": "^1.18.0",
43
+ "oxlint": "^1.19.0",
44
44
  "tsdown": "^0.15.4",
45
45
  "typescript": "5.9.2",
46
46
  "vitest": "4.0.0-beta.13",
47
- "@eggjs/tsconfig": "3.1.0-beta.15",
48
- "@eggjs/mock": "7.0.0-beta.15"
47
+ "@eggjs/tsconfig": "3.1.0-beta.18",
48
+ "@eggjs/mock": "7.0.0-beta.18"
49
49
  },
50
50
  "type": "module",
51
51
  "exports": {