@loopback/example-webpack 0.5.0 → 0.6.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.
- package/CHANGELOG.md +48 -0
- package/dist/__tests__/integration/bundle-node.integration.js +4 -4
- package/dist/__tests__/integration/bundle-node.integration.js.map +1 -1
- package/dist/__tests__/integration/bundle-web.integration.js +27 -17
- package/dist/__tests__/integration/bundle-web.integration.js.map +1 -1
- package/dist/__tests__/integration/dependency-injection.integration.js +2 -2
- package/dist/__tests__/integration/dependency-injection.integration.js.map +1 -1
- package/dist/__tests__/integration/test-helper.js +3 -3
- package/dist/__tests__/integration/test-helper.js.map +1 -1
- package/dist/bundle-node.js +1 -1
- package/dist/bundle-web.js +1 -1
- package/dist/dependency-injection.js +14 -14
- package/dist/dependency-injection.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +14 -13
- package/src/__tests__/integration/bundle-node.integration.ts +1 -1
- package/src/__tests__/integration/bundle-web.integration.ts +18 -8
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,54 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.6.1](https://github.com/loopbackio/loopback-next/compare/@loopback/example-webpack@0.6.0...@loopback/example-webpack@0.6.1) (2022-01-11)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @loopback/example-webpack
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [0.6.0](https://github.com/loopbackio/loopback-next/compare/@loopback/example-webpack@0.5.2...@loopback/example-webpack@0.6.0) (2021-11-18)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* drop support for Node.js v10 ([9bcbbb3](https://github.com/loopbackio/loopback-next/commit/9bcbbb358ec3eabc3033d4e7e1c22b524a7069b3))
|
|
20
|
+
* support Node.js v17 ([8d86c03](https://github.com/loopbackio/loopback-next/commit/8d86c03cb7047e2b1f18d05870628ef5783e71b2))
|
|
21
|
+
* upgrade to TypeScript 4.5.2 ([72ece91](https://github.com/loopbackio/loopback-next/commit/72ece91289ecfdfd8747bb9888ad75db73e8ff4b))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### BREAKING CHANGES
|
|
25
|
+
|
|
26
|
+
* drop support for Node.js v10
|
|
27
|
+
|
|
28
|
+
Co-authored-by: Francisco Buceta <frbuceta@gmail.com>
|
|
29
|
+
Signed-off-by: Rifa Achrinza <25147899+achrinza@users.noreply.github.com>
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
## [0.5.2](https://github.com/loopbackio/loopback-next/compare/@loopback/example-webpack@0.5.1...@loopback/example-webpack@0.5.2) (2021-10-18)
|
|
36
|
+
|
|
37
|
+
**Note:** Version bump only for package @loopback/example-webpack
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
## [0.5.1](https://github.com/loopbackio/loopback-next/compare/@loopback/example-webpack@0.5.0...@loopback/example-webpack@0.5.1) (2021-09-16)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### Bug Fixes
|
|
47
|
+
|
|
48
|
+
* use puppeteer for browser testing ([e354380](https://github.com/loopbackio/loopback-next/commit/e35438073e5f23c070b4e9e6c76c4b6b4b05cb7a))
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
6
54
|
# [0.5.0](https://github.com/loopbackio/loopback-next/compare/@loopback/example-webpack@0.4.1...@loopback/example-webpack@0.5.0) (2021-07-15)
|
|
7
55
|
|
|
8
56
|
|
|
@@ -11,17 +11,17 @@ describe('bundle-node.js', () => {
|
|
|
11
11
|
let bundle;
|
|
12
12
|
before('generate bundle-node.js', async function () {
|
|
13
13
|
// It may take some time to generate the bundle using webpack
|
|
14
|
-
this.timeout(
|
|
15
|
-
await test_helper_1.generateBundle('node');
|
|
14
|
+
this.timeout(50000);
|
|
15
|
+
await (0, test_helper_1.generateBundle)('node');
|
|
16
16
|
bundle = require('../../bundle-node');
|
|
17
17
|
});
|
|
18
18
|
it('invokes main function', async () => {
|
|
19
19
|
const greetings = await bundle.main();
|
|
20
|
-
test_helper_1.assertGreetings(greetings);
|
|
20
|
+
(0, test_helper_1.assertGreetings)(greetings);
|
|
21
21
|
});
|
|
22
22
|
it('has access to Context', async () => {
|
|
23
23
|
const ctx = new bundle.Context('my-ctx');
|
|
24
|
-
testlab_1.expect(ctx.name).to.eql('my-ctx');
|
|
24
|
+
(0, testlab_1.expect)(ctx.name).to.eql('my-ctx');
|
|
25
25
|
});
|
|
26
26
|
});
|
|
27
27
|
//# sourceMappingURL=bundle-node.integration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle-node.integration.js","sourceRoot":"","sources":["../../../src/__tests__/integration/bundle-node.integration.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,yCAAyC;AACzC,+CAA+C;AAC/C,gEAAgE;;AAEhE,+CAAyC;AACzC,+CAA8D;AAE9D,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,8DAA8D;IAC9D,IAAI,MAAW,CAAC;IAEhB,MAAM,CAAC,yBAAyB,EAAE,KAAK;QACrC,6DAA6D;QAC7D,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACpB,MAAM,4BAAc,
|
|
1
|
+
{"version":3,"file":"bundle-node.integration.js","sourceRoot":"","sources":["../../../src/__tests__/integration/bundle-node.integration.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,yCAAyC;AACzC,+CAA+C;AAC/C,gEAAgE;;AAEhE,+CAAyC;AACzC,+CAA8D;AAE9D,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,8DAA8D;IAC9D,IAAI,MAAW,CAAC;IAEhB,MAAM,CAAC,yBAAyB,EAAE,KAAK;QACrC,6DAA6D;QAC7D,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACpB,MAAM,IAAA,4BAAc,EAAC,MAAM,CAAC,CAAC;QAC7B,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uBAAuB,EAAE,KAAK,IAAI,EAAE;QACrC,MAAM,SAAS,GAAa,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QAChD,IAAA,6BAAe,EAAC,SAAS,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uBAAuB,EAAE,KAAK,IAAI,EAAE;QACrC,MAAM,GAAG,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACzC,IAAA,gBAAM,EAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
const tslib_1 = require("tslib");
|
|
8
8
|
const testlab_1 = require("@loopback/testlab");
|
|
9
|
-
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
10
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
11
|
-
const
|
|
9
|
+
const fs_1 = (0, tslib_1.__importDefault)(require("fs"));
|
|
10
|
+
const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
11
|
+
const puppeteer_1 = (0, tslib_1.__importDefault)(require("puppeteer"));
|
|
12
|
+
const url_1 = (0, tslib_1.__importDefault)(require("url"));
|
|
12
13
|
const test_helper_1 = require("./test-helper");
|
|
13
|
-
const Browser = require('zombie');
|
|
14
14
|
//
|
|
15
15
|
/*
|
|
16
16
|
* `zombie` fails to load the html file url with 404 on Windows
|
|
@@ -22,28 +22,38 @@ const Browser = require('zombie');
|
|
|
22
22
|
*
|
|
23
23
|
* See https://github.com/assaf/zombie/issues/915
|
|
24
24
|
*/
|
|
25
|
-
testlab_1.skipIf(process.platform === 'win32', // Skip on Windows
|
|
25
|
+
(0, testlab_1.skipIf)(process.platform === 'win32', // Skip on Windows
|
|
26
26
|
describe, 'bundle-web.js', () => {
|
|
27
|
-
const browser = new Browser();
|
|
28
27
|
before('generate bundle-web.js', async function () {
|
|
29
28
|
// It may take some time to generate the bundle using webpack
|
|
30
29
|
this.timeout(30000);
|
|
31
|
-
await test_helper_1.generateBundle('web');
|
|
32
|
-
testlab_1.expect(fs_1.default.existsSync(path_1.default.join(__dirname, '../../bundle-web.js'))).to.be.true();
|
|
30
|
+
await (0, test_helper_1.generateBundle)('web');
|
|
31
|
+
(0, testlab_1.expect)(fs_1.default.existsSync(path_1.default.join(__dirname, '../../bundle-web.js'))).to.be.true();
|
|
33
32
|
});
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
let browser;
|
|
34
|
+
let html;
|
|
35
|
+
before(async function () {
|
|
36
|
+
this.timeout(15000);
|
|
37
|
+
browser = await puppeteer_1.default.launch();
|
|
38
|
+
const page = await browser.newPage();
|
|
39
|
+
await page.goto(url_1.default
|
|
36
40
|
.pathToFileURL(path_1.default.join(__dirname, '../../../index.html'))
|
|
37
|
-
.toString());
|
|
41
|
+
.toString(), { waitUntil: 'networkidle2' });
|
|
42
|
+
html = await page.content();
|
|
43
|
+
/*
|
|
44
|
+
const bodyHandle = await page.$('body');
|
|
45
|
+
html = await page.evaluate(body => body.innerHTML, bodyHandle);
|
|
46
|
+
await bodyHandle!.dispose();
|
|
47
|
+
*/
|
|
48
|
+
await browser.close();
|
|
38
49
|
});
|
|
39
50
|
it('should see the page with greetings', () => {
|
|
40
|
-
|
|
41
|
-
let body = browser.body.innerHTML;
|
|
51
|
+
let body = html;
|
|
42
52
|
body = body.replace(/\[[^\[\]]+\] /g, '');
|
|
43
|
-
testlab_1.expect(body).to.match(/<li>\(en\) Hello, Jane!<\/li>/);
|
|
44
|
-
testlab_1.expect(body).to.match(/<li>Hello, John!<\/li>/);
|
|
45
|
-
testlab_1.expect(body).to.match(/<li>\(zh\) 你好,John!<\/li>/);
|
|
46
|
-
testlab_1.expect(body).to.match(/<li>\(en\) Hello, Jane!<\/li>/);
|
|
53
|
+
(0, testlab_1.expect)(body).to.match(/<li>\(en\) Hello, Jane!<\/li>/);
|
|
54
|
+
(0, testlab_1.expect)(body).to.match(/<li>Hello, John!<\/li>/);
|
|
55
|
+
(0, testlab_1.expect)(body).to.match(/<li>\(zh\) 你好,John!<\/li>/);
|
|
56
|
+
(0, testlab_1.expect)(body).to.match(/<li>\(en\) Hello, Jane!<\/li>/);
|
|
47
57
|
});
|
|
48
58
|
});
|
|
49
59
|
//# sourceMappingURL=bundle-web.integration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle-web.integration.js","sourceRoot":"","sources":["../../../src/__tests__/integration/bundle-web.integration.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,yCAAyC;AACzC,+CAA+C;AAC/C,gEAAgE;;;AAEhE,+CAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"bundle-web.integration.js","sourceRoot":"","sources":["../../../src/__tests__/integration/bundle-web.integration.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,yCAAyC;AACzC,+CAA+C;AAC/C,gEAAgE;;;AAEhE,+CAAiD;AACjD,yDAAoB;AAEpB,6DAAwB;AACxB,uEAA6C;AAC7C,2DAAsB;AACtB,+CAA6C;AAE7C,EAAE;AACF;;;;;;;;;GASG;AACH,IAAA,gBAAM,EACJ,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,kBAAkB;AAChD,QAAQ,EACR,eAAe,EACf,GAAG,EAAE;IACH,MAAM,CAAC,wBAAwB,EAAE,KAAK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EAAE,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;QACnD,IAAA,gBAAM,EAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC,CACF,CAAC"}
|
|
@@ -8,9 +8,9 @@ const __1 = require("../..");
|
|
|
8
8
|
const test_helper_1 = require("./test-helper");
|
|
9
9
|
describe('dependency injection', () => {
|
|
10
10
|
it('invokes main function', async () => {
|
|
11
|
-
const greetings = await __1.main();
|
|
11
|
+
const greetings = await (0, __1.main)();
|
|
12
12
|
// Trim date headers
|
|
13
|
-
test_helper_1.assertGreetings(greetings);
|
|
13
|
+
(0, test_helper_1.assertGreetings)(greetings);
|
|
14
14
|
});
|
|
15
15
|
});
|
|
16
16
|
//# sourceMappingURL=dependency-injection.integration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependency-injection.integration.js","sourceRoot":"","sources":["../../../src/__tests__/integration/dependency-injection.integration.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,yCAAyC;AACzC,+CAA+C;AAC/C,gEAAgE;;AAEhE,6BAA2B;AAC3B,+CAA8C;AAE9C,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,uBAAuB,EAAE,KAAK,IAAI,EAAE;QACrC,MAAM,SAAS,GAAa,MAAM,QAAI,
|
|
1
|
+
{"version":3,"file":"dependency-injection.integration.js","sourceRoot":"","sources":["../../../src/__tests__/integration/dependency-injection.integration.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,yCAAyC;AACzC,+CAA+C;AAC/C,gEAAgE;;AAEhE,6BAA2B;AAC3B,+CAA8C;AAE9C,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,uBAAuB,EAAE,KAAK,IAAI,EAAE;QACrC,MAAM,SAAS,GAAa,MAAM,IAAA,QAAI,GAAE,CAAC;QACzC,oBAAoB;QACpB,IAAA,6BAAe,EAAC,SAAS,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -8,11 +8,11 @@ exports.generateBundle = exports.assertGreetings = void 0;
|
|
|
8
8
|
const tslib_1 = require("tslib");
|
|
9
9
|
const testlab_1 = require("@loopback/testlab");
|
|
10
10
|
const events_1 = require("events");
|
|
11
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
11
|
+
const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
12
12
|
const runShell = require('@loopback/build').runShell;
|
|
13
13
|
function assertGreetings(greetings) {
|
|
14
14
|
greetings = greetings.map(g => g.replace(/\[[^\[\]]+\] /, ''));
|
|
15
|
-
testlab_1.expect(greetings).to.eql([
|
|
15
|
+
(0, testlab_1.expect)(greetings).to.eql([
|
|
16
16
|
'(en) Hello, Jane!',
|
|
17
17
|
'Hello, John!',
|
|
18
18
|
'(zh) 你好,John!',
|
|
@@ -25,7 +25,7 @@ function generateBundle(type) {
|
|
|
25
25
|
stdio: 'ignore',
|
|
26
26
|
cwd: path_1.default.join(__dirname, '../../..'),
|
|
27
27
|
});
|
|
28
|
-
return events_1.once(child, 'close');
|
|
28
|
+
return (0, events_1.once)(child, 'close');
|
|
29
29
|
}
|
|
30
30
|
exports.generateBundle = generateBundle;
|
|
31
31
|
//# sourceMappingURL=test-helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-helper.js","sourceRoot":"","sources":["../../../src/__tests__/integration/test-helper.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,yCAAyC;AACzC,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,+CAAyC;AACzC,mCAA4B;AAC5B,
|
|
1
|
+
{"version":3,"file":"test-helper.js","sourceRoot":"","sources":["../../../src/__tests__/integration/test-helper.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,yCAAyC;AACzC,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,+CAAyC;AACzC,mCAA4B;AAC5B,6DAAwB;AAExB,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC;AAErD,SAAgB,eAAe,CAAC,SAAmB;IACjD,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC;IAC/D,IAAA,gBAAM,EAAC,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC;QACvB,mBAAmB;QACnB,cAAc;QACd,eAAe;QACf,mBAAmB;KACpB,CAAC,CAAC;AACL,CAAC;AARD,0CAQC;AAED,SAAgB,cAAc,CAAC,IAAoB;IACjD,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,iBAAiB,IAAI,EAAE,CAAC,EAAE;QAC9D,KAAK,EAAE,QAAQ;QACf,GAAG,EAAE,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;KACtC,CAAC,CAAC;IACH,OAAO,IAAA,aAAI,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAC9B,CAAC;AAND,wCAMC"}
|