unleash-server 4.11.0-beta.0 → 4.11.0-beta.1
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,29 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const fs_1 = __importDefault(require("fs"));
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
3
8
|
const rewriteHTML_1 = require("./rewriteHTML");
|
|
4
|
-
const
|
|
9
|
+
const unleash_frontend_1 = require("unleash-frontend");
|
|
10
|
+
const input = fs_1.default.readFileSync(path_1.default.join(unleash_frontend_1.publicFolder, 'index.html')).toString();
|
|
5
11
|
test('rewriteHTML substitutes meta tag with existing rewrite value', () => {
|
|
6
12
|
const result = (0, rewriteHTML_1.rewriteHTML)(input, '/hosted');
|
|
7
|
-
expect(result.includes('<meta name="baseUriPath" content="/hosted"/>')).toBe(true);
|
|
13
|
+
expect(result.includes('<meta name="baseUriPath" content="/hosted" />')).toBe(true);
|
|
8
14
|
});
|
|
9
15
|
test('rewriteHTML substitutes meta tag with empty value', () => {
|
|
10
16
|
const result = (0, rewriteHTML_1.rewriteHTML)(input, '');
|
|
11
|
-
expect(result.includes('<meta name="baseUriPath" content=""/>')).toBe(true);
|
|
17
|
+
expect(result.includes('<meta name="baseUriPath" content="" />')).toBe(true);
|
|
12
18
|
});
|
|
13
19
|
test('rewriteHTML substitutes asset paths correctly with baseUriPath', () => {
|
|
14
20
|
const result = (0, rewriteHTML_1.rewriteHTML)(input, '/hosted');
|
|
15
|
-
expect(result.includes('<script
|
|
21
|
+
expect(result.includes('<script type="module" crossorigin src="/hosted/static/index')).toBe(true);
|
|
16
22
|
});
|
|
17
23
|
test('rewriteHTML substitutes asset paths correctly without baseUriPath', () => {
|
|
18
24
|
const result = (0, rewriteHTML_1.rewriteHTML)(input, '');
|
|
19
|
-
expect(result.includes('<script
|
|
25
|
+
expect(result.includes('<script type="module" crossorigin src="/static/index')).toBe(true);
|
|
26
|
+
});
|
|
27
|
+
test('rewriteHTML substitutes asset paths correctly with cdnPrefix', () => {
|
|
28
|
+
const result = (0, rewriteHTML_1.rewriteHTML)(input, '', 'https://cdn.getunleash.io/v4.1.0');
|
|
29
|
+
expect(result.includes('<script type="module" crossorigin src="https://cdn.getunleash.io/v4.1.0/static/index')).toBe(true);
|
|
20
30
|
});
|
|
21
31
|
test('rewriteHTML swaps out faviconPath if cdnPrefix is set', () => {
|
|
22
32
|
const result = (0, rewriteHTML_1.rewriteHTML)(input, '', 'https://cdn.getunleash.io/v4.1.0');
|
|
23
|
-
expect(result.includes('<link rel="icon" href="https://cdn.getunleash.io/favicon.ico"/>')).toBe(true);
|
|
33
|
+
expect(result.includes('<link rel="icon" href="https://cdn.getunleash.io/favicon.ico" />')).toBe(true);
|
|
24
34
|
});
|
|
25
35
|
test('rewriteHTML sets favicon path to root', () => {
|
|
26
36
|
const result = (0, rewriteHTML_1.rewriteHTML)(input, '');
|
|
27
|
-
expect(result.includes('<link rel="icon" href="/favicon.ico"/>')).toBe(true);
|
|
37
|
+
expect(result.includes('<link rel="icon" href="/favicon.ico" />')).toBe(true);
|
|
28
38
|
});
|
|
29
39
|
//# sourceMappingURL=rewriteHTML.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rewriteHTML.test.js","sourceRoot":"","sources":["../../../src/lib/util/rewriteHTML.test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rewriteHTML.test.js","sourceRoot":"","sources":["../../../src/lib/util/rewriteHTML.test.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,+CAA4C;AAC5C,uDAAgD;AAEhD,MAAM,KAAK,GAAG,YAAE,CAAC,YAAY,CAAC,cAAI,C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J,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,uDAAuD,EAAE,GAAG,EAAE;IAC/D,MAAM,MAAM,GAAG,IAAA,yBAAW,EAAC,KAAK,EAAE,EAAE,EAAE,kCAAkC,CAAC,CAAC;IAC1E,MAAM,CACF,MAAM,CAAC,QAAQ,CACX,kEAAkE,CACrE,CACJ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,uCAAuC,EAAE,GAAG,EAAE;IAC/C,MAAM,MAAM,GAAG,IAAA,yBAAW,EAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACtC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,yCAAyC,CAAC,CAAC,CAAC,IAAI,CACnE,IAAI,CACP,CAAC;AACN,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unleash-server",
|
|
3
3
|
"description": "Unleash is an enterprise ready feature toggles service. It provides different strategies for handling feature toggles.",
|
|
4
|
-
"version": "4.11.0-beta.
|
|
4
|
+
"version": "4.11.0-beta.1",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"unleash",
|
|
7
7
|
"feature toggle",
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"stoppable": "^1.1.0",
|
|
117
117
|
"type-is": "^1.6.18",
|
|
118
118
|
"@unleash/express-openapi": "^0.2.0",
|
|
119
|
-
"unleash-frontend": "4.11.0-beta.
|
|
119
|
+
"unleash-frontend": "4.11.0-beta.1",
|
|
120
120
|
"uuid": "^8.3.2",
|
|
121
121
|
"semver": "^7.3.5"
|
|
122
122
|
},
|