@flink-app/static-files-plugin 2.0.0-alpha.83 → 2.0.0-alpha.84
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/CHANGELOG.md +7 -0
- package/dist/index.js +2 -3
- package/package.json +4 -3
- package/src/index.ts +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @flink-app/static-files-plugin
|
|
2
2
|
|
|
3
|
+
## 2.0.0-alpha.84
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fix express.static is not a function by importing express module directly instead of using expressApp.constructor
|
|
8
|
+
- @flink-app/flink@2.0.0-alpha.84
|
|
9
|
+
|
|
3
10
|
## 2.0.0-alpha.83
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.staticFilesPlugin = void 0;
|
|
7
|
+
var express_1 = __importDefault(require("express"));
|
|
7
8
|
var node_color_log_1 = __importDefault(require("node-color-log"));
|
|
8
9
|
var staticFilesPlugin = function (options) {
|
|
9
10
|
return {
|
|
@@ -18,7 +19,5 @@ function init(app, options) {
|
|
|
18
19
|
throw new Error("Express app not initialized");
|
|
19
20
|
}
|
|
20
21
|
node_color_log_1.default.info("Registered static file route ".concat(options.path));
|
|
21
|
-
|
|
22
|
-
var express = expressApp.constructor;
|
|
23
|
-
expressApp.use(options.path, express.static(options.folder));
|
|
22
|
+
expressApp.use(options.path, express_1.default.static(options.folder));
|
|
24
23
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flink-app/static-files-plugin",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.84",
|
|
4
4
|
"description": "Flink plugin that make flink serve static files",
|
|
5
5
|
"author": "johan@frost.se",
|
|
6
6
|
"publishConfig": {
|
|
@@ -11,14 +11,15 @@
|
|
|
11
11
|
"main": "dist/index.js",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"node-color-log": "^5.3.1",
|
|
14
|
-
"@flink-app/flink": "2.0.0-alpha.
|
|
14
|
+
"@flink-app/flink": "2.0.0-alpha.84"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
+
"@types/express": "^4.17.13",
|
|
17
18
|
"@types/node": "22.13.10"
|
|
18
19
|
},
|
|
19
20
|
"gitHead": "4243e3b3cd6d4e1ca001a61baa8436bf2bbe4113",
|
|
20
21
|
"peerDependencies": {
|
|
21
|
-
"@flink-app/flink": ">=2.0.0-alpha.
|
|
22
|
+
"@flink-app/flink": ">=2.0.0-alpha.84"
|
|
22
23
|
},
|
|
23
24
|
"scripts": {
|
|
24
25
|
"test": "echo \"Error: no test specified\"",
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FlinkApp, FlinkPlugin } from "@flink-app/flink";
|
|
2
|
+
import express from "express";
|
|
2
3
|
import log from "node-color-log";
|
|
3
4
|
|
|
4
5
|
export type StaticOptions = {
|
|
@@ -29,7 +30,5 @@ function init(app: FlinkApp<any>, options: StaticOptions) {
|
|
|
29
30
|
|
|
30
31
|
log.info(`Registered static file route ${options.path}`);
|
|
31
32
|
|
|
32
|
-
// Access express.static through the Express constructor
|
|
33
|
-
const express = (expressApp as any).constructor;
|
|
34
33
|
expressApp.use(options.path, express.static(options.folder));
|
|
35
34
|
}
|