@embroider/test-setup 4.0.0 → 4.0.1-unstable.ccbf41f
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/package.json +10 -9
- package/src/index.js +22 -5
- package/LICENSE +0 -21
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@embroider/test-setup",
|
3
|
-
"version": "4.0.
|
3
|
+
"version": "4.0.1-unstable.ccbf41f",
|
4
4
|
"repository": {
|
5
5
|
"type": "git",
|
6
6
|
"url": "https://github.com/embroider-build/embroider.git",
|
@@ -12,19 +12,20 @@
|
|
12
12
|
"src/index.js"
|
13
13
|
],
|
14
14
|
"dependencies": {
|
15
|
+
"broccoli-plugin": "^4.0.7",
|
15
16
|
"lodash": "^4.17.21",
|
16
17
|
"resolve": "^1.20.0"
|
17
18
|
},
|
18
19
|
"devDependencies": {
|
19
|
-
"@
|
20
|
-
"@embroider/
|
21
|
-
"@embroider/
|
22
|
-
"@
|
20
|
+
"@embroider/compat": "3.4.9-unstable.ccbf41f",
|
21
|
+
"@embroider/core": "3.4.9-unstable.ccbf41f",
|
22
|
+
"@embroider/webpack": "4.0.1-unstable.ccbf41f",
|
23
|
+
"@types/lodash": "^4.14.170"
|
23
24
|
},
|
24
25
|
"peerDependencies": {
|
25
|
-
"@embroider/
|
26
|
-
"@embroider/
|
27
|
-
"@embroider/webpack": "
|
26
|
+
"@embroider/compat": "3.4.9-unstable.ccbf41f",
|
27
|
+
"@embroider/core": "3.4.9-unstable.ccbf41f",
|
28
|
+
"@embroider/webpack": "4.0.1-unstable.ccbf41f"
|
28
29
|
},
|
29
30
|
"peerDependenciesMeta": {
|
30
31
|
"@embroider/compat": {
|
@@ -40,4 +41,4 @@
|
|
40
41
|
"engines": {
|
41
42
|
"node": "12.* || 14.* || >= 16"
|
42
43
|
}
|
43
|
-
}
|
44
|
+
}
|
package/src/index.js
CHANGED
@@ -1,6 +1,11 @@
|
|
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 });
|
3
6
|
exports.embroiderOptimized = exports.embroiderSafe = exports.maybeEmbroider = void 0;
|
7
|
+
const broccoli_plugin_1 = __importDefault(require("broccoli-plugin"));
|
8
|
+
const child_process_1 = require("child_process");
|
4
9
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
5
10
|
const ourPeerDeps = require('../package.json').peerDependencies;
|
6
11
|
const embroiderDevDeps = {
|
@@ -24,10 +29,6 @@ function maybeEmbroider(app, opts = {}) {
|
|
24
29
|
// - we don't want to load any of these things until they're actually needed;
|
25
30
|
// - we can't use `await import()` because this function needs to be synchronous to go inside ember-cli-build.js
|
26
31
|
/* eslint-disable @typescript-eslint/no-require-imports */
|
27
|
-
let { Webpack } = require(require.resolve('@embroider/webpack', {
|
28
|
-
paths: [app.project.root],
|
29
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
30
|
-
}));
|
31
32
|
let Compat = require(require.resolve('@embroider/compat', {
|
32
33
|
paths: [app.project.root],
|
33
34
|
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
@@ -45,9 +46,25 @@ function maybeEmbroider(app, opts = {}) {
|
|
45
46
|
throw new Error(`No such scenario EMBROIDER_TEST_SETUP_OPTIONS=${process.env.EMBROIDER_TEST_SETUP_OPTIONS}`);
|
46
47
|
}
|
47
48
|
}
|
48
|
-
|
49
|
+
if (process.env.EMBROIDER_PREBUILD) {
|
50
|
+
return Compat.prebuild(app, opts);
|
51
|
+
}
|
52
|
+
return new BuildWithVite([]);
|
49
53
|
}
|
50
54
|
exports.maybeEmbroider = maybeEmbroider;
|
55
|
+
class BuildWithVite extends broccoli_plugin_1.default {
|
56
|
+
build() {
|
57
|
+
return new Promise((resolve, reject) => {
|
58
|
+
const child = (0, child_process_1.spawn)(`npx vite build --outDir ${this.outputPath}`, {
|
59
|
+
cwd: process.cwd(),
|
60
|
+
shell: true,
|
61
|
+
stdio: 'inherit',
|
62
|
+
env: { ...process.env },
|
63
|
+
});
|
64
|
+
child.on('exit', code => (code === 0 ? resolve() : reject(new Error('vite build failed'))));
|
65
|
+
});
|
66
|
+
}
|
67
|
+
}
|
51
68
|
function embroiderSafe(extension) {
|
52
69
|
return extendScenario({
|
53
70
|
name: 'embroider-safe',
|
package/LICENSE
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2018 Edward Faulkner
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|