@embeddable.com/sdk-core 3.1.3 → 3.1.4
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/bin/embeddable +15 -3
- package/configs/tsconfig.json +4 -11
- package/lib/index.esm.js +6 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +7 -1
- package/lib/index.js.map +1 -1
- package/loader/custom-esm-loader.mjs +33 -5
- package/package.json +1 -1
- package/src/entryPoint.js +12 -0
- package/src/generate.ts +3 -0
- package/src/login.ts +1 -3
- package/src/provideConfig.ts +4 -1
- package/lib/entryPoint.d.ts +0 -1
- package/src/entryPoint.ts +0 -16
package/bin/embeddable
CHANGED
|
@@ -1,26 +1,38 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
+
const { pathToFileURL } = require("url");
|
|
5
|
+
|
|
4
6
|
const { spawn } = require("child_process");
|
|
5
7
|
const path = require("path");
|
|
6
8
|
|
|
7
9
|
// Check if the loader is already applied to avoid infinite spawning
|
|
8
10
|
if (!process.env.LOADER_APPLIED) {
|
|
9
11
|
const env = { ...process.env, LOADER_APPLIED: "1" };
|
|
10
|
-
const entryPointPath = path.join(__dirname, "../src/entryPoint.
|
|
12
|
+
const entryPointPath = path.join(__dirname, "../src/entryPoint.js");
|
|
11
13
|
const customLoaderPath = path.join(
|
|
12
14
|
__dirname,
|
|
13
15
|
"../loader/custom-esm-loader.mjs",
|
|
14
16
|
);
|
|
15
17
|
|
|
18
|
+
const isWindows = process.platform === "win32";
|
|
19
|
+
|
|
20
|
+
const entryPointPathOrUrl = isWindows
|
|
21
|
+
? pathToFileURL(entryPointPath).href
|
|
22
|
+
: entryPointPath;
|
|
23
|
+
|
|
24
|
+
const customLoaderPathOrUrl = isWindows
|
|
25
|
+
? pathToFileURL(customLoaderPath).href
|
|
26
|
+
: customLoaderPath;
|
|
27
|
+
|
|
16
28
|
const child = spawn(
|
|
17
29
|
process.execPath,
|
|
18
30
|
[
|
|
19
31
|
"--loader",
|
|
20
|
-
|
|
32
|
+
customLoaderPathOrUrl,
|
|
21
33
|
"--no-warnings=ExperimentalWarning",
|
|
22
34
|
"--enable-source-maps",
|
|
23
|
-
|
|
35
|
+
entryPointPathOrUrl,
|
|
24
36
|
...process.argv.slice(2),
|
|
25
37
|
],
|
|
26
38
|
{ stdio: ["inherit", "pipe", "inherit"], env },
|
package/configs/tsconfig.json
CHANGED
|
@@ -4,10 +4,7 @@
|
|
|
4
4
|
"allowUnreachableCode": false,
|
|
5
5
|
"declaration": false,
|
|
6
6
|
"experimentalDecorators": true,
|
|
7
|
-
"lib": [
|
|
8
|
-
"dom",
|
|
9
|
-
"es2017"
|
|
10
|
-
],
|
|
7
|
+
"lib": ["dom", "es2017"],
|
|
11
8
|
"moduleResolution": "node",
|
|
12
9
|
"module": "esnext",
|
|
13
10
|
"target": "es2017",
|
|
@@ -16,10 +13,6 @@
|
|
|
16
13
|
"jsx": "react",
|
|
17
14
|
"jsxFactory": "h"
|
|
18
15
|
},
|
|
19
|
-
"include": [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"exclude": [
|
|
23
|
-
"node_modules"
|
|
24
|
-
]
|
|
25
|
-
}
|
|
16
|
+
"include": ["component"],
|
|
17
|
+
"exclude": ["node_modules"]
|
|
18
|
+
}
|
package/lib/index.esm.js
CHANGED
|
@@ -8,6 +8,7 @@ import * as fs$2 from 'node:fs';
|
|
|
8
8
|
import { createNodeLogger, createNodeSys } from '@stencil/core/sys/node';
|
|
9
9
|
import { loadConfig, createCompiler } from '@stencil/core/compiler';
|
|
10
10
|
import * as YAML from 'yaml';
|
|
11
|
+
import * as url$2 from 'node:url';
|
|
11
12
|
import * as path$2 from 'path';
|
|
12
13
|
import path__default, { basename } from 'path';
|
|
13
14
|
import require$$4$1 from 'util';
|
|
@@ -420,12 +421,14 @@ async function runStencil(ctx) {
|
|
|
420
421
|
const logger = ((_a = ctx.dev) === null || _a === void 0 ? void 0 : _a.logger) || createNodeLogger({ process });
|
|
421
422
|
const sys = ((_b = ctx.dev) === null || _b === void 0 ? void 0 : _b.sys) || createNodeSys({ process });
|
|
422
423
|
const devMode = !!ctx.dev;
|
|
424
|
+
const isWindows = process.platform === "win32";
|
|
423
425
|
const validated = await loadConfig({
|
|
424
426
|
initTsConfig: true,
|
|
425
427
|
logger,
|
|
426
428
|
sys,
|
|
427
429
|
config: {
|
|
428
430
|
devMode,
|
|
431
|
+
maxConcurrentWorkers: isWindows ? 0 : 8, // workers break on windows
|
|
429
432
|
rootDir: ctx.client.buildDir,
|
|
430
433
|
configPath: path$1.resolve(ctx.client.buildDir, "stencil.config.ts"),
|
|
431
434
|
tsconfig: path$1.resolve(ctx.client.buildDir, "tsconfig.json"),
|
|
@@ -4630,10 +4633,12 @@ var provideConfig = async () => {
|
|
|
4630
4633
|
console.log("Please create a proper `embeddable.config.js` or `embeddable.config.ts` file in the root of your project.");
|
|
4631
4634
|
process.exit(1);
|
|
4632
4635
|
}
|
|
4636
|
+
const isWindows = process.platform === "win32";
|
|
4633
4637
|
const configPath = fs$2.existsSync(tsConfigFilePath)
|
|
4634
4638
|
? tsConfigFilePath
|
|
4635
4639
|
: configFilePath;
|
|
4636
|
-
|
|
4640
|
+
const pathOrUrl = isWindows ? url$2.pathToFileURL(configPath).href : configPath;
|
|
4641
|
+
return (await import(pathOrUrl)).default;
|
|
4637
4642
|
};
|
|
4638
4643
|
|
|
4639
4644
|
function getDefaultExportFromCjs (x) {
|