@embeddable.com/sdk-core 3.1.2 → 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/defineConfig.d.ts +6 -6
- package/lib/index.esm.js +14 -7
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +15 -8
- package/lib/index.js.map +1 -1
- package/loader/custom-esm-loader.mjs +33 -5
- package/package.json +1 -1
- package/src/defineConfig.ts +3 -3
- package/src/entryPoint.js +12 -0
- package/src/generate.ts +3 -0
- package/src/login.ts +1 -3
- package/src/provideConfig.ts +13 -4
- package/lib/entryPoint.d.ts +0 -1
- package/src/entryPoint.ts +0 -16
package/lib/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var fs$1 = require('node:fs/promises');
|
|
|
4
4
|
var path$1 = require('node:path');
|
|
5
5
|
var vite = require('vite');
|
|
6
6
|
require('node:child_process');
|
|
7
|
-
var
|
|
7
|
+
var fs$2 = require('node:fs');
|
|
8
8
|
var node = require('@stencil/core/sys/node');
|
|
9
9
|
var compiler = require('@stencil/core/compiler');
|
|
10
10
|
var YAML = require('yaml');
|
|
@@ -43,7 +43,7 @@ function _interopNamespaceDefault(e) {
|
|
|
43
43
|
var fs__namespace = /*#__PURE__*/_interopNamespaceDefault(fs$1);
|
|
44
44
|
var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path$1);
|
|
45
45
|
var vite__namespace = /*#__PURE__*/_interopNamespaceDefault(vite);
|
|
46
|
-
var
|
|
46
|
+
var fs__namespace$1 = /*#__PURE__*/_interopNamespaceDefault(fs$2);
|
|
47
47
|
var YAML__namespace = /*#__PURE__*/_interopNamespaceDefault(YAML);
|
|
48
48
|
var url__namespace = /*#__PURE__*/_interopNamespaceDefault(url$2);
|
|
49
49
|
var path__namespace$1 = /*#__PURE__*/_interopNamespaceDefault(path$2);
|
|
@@ -409,7 +409,7 @@ var prepare = async (ctx) => {
|
|
|
409
409
|
await createComponentDir(ctx.client.componentDir);
|
|
410
410
|
};
|
|
411
411
|
async function removeIfExists(ctx) {
|
|
412
|
-
if (
|
|
412
|
+
if (fs__namespace$1.existsSync(ctx.client.buildDir))
|
|
413
413
|
await fs__namespace.rm(ctx.client.buildDir, { recursive: true });
|
|
414
414
|
}
|
|
415
415
|
async function copyStencilConfigsToClient(ctx) {
|
|
@@ -448,12 +448,14 @@ async function runStencil(ctx) {
|
|
|
448
448
|
const logger = ((_a = ctx.dev) === null || _a === void 0 ? void 0 : _a.logger) || node.createNodeLogger({ process });
|
|
449
449
|
const sys = ((_b = ctx.dev) === null || _b === void 0 ? void 0 : _b.sys) || node.createNodeSys({ process });
|
|
450
450
|
const devMode = !!ctx.dev;
|
|
451
|
+
const isWindows = process.platform === "win32";
|
|
451
452
|
const validated = await compiler.loadConfig({
|
|
452
453
|
initTsConfig: true,
|
|
453
454
|
logger,
|
|
454
455
|
sys,
|
|
455
456
|
config: {
|
|
456
457
|
devMode,
|
|
458
|
+
maxConcurrentWorkers: isWindows ? 0 : 8, // workers break on windows
|
|
457
459
|
rootDir: ctx.client.buildDir,
|
|
458
460
|
configPath: path__namespace.resolve(ctx.client.buildDir, "stencil.config.ts"),
|
|
459
461
|
tsconfig: path__namespace.resolve(ctx.client.buildDir, "tsconfig.json"),
|
|
@@ -4653,12 +4655,17 @@ const securityContextSchema = z.array(z.object({
|
|
|
4653
4655
|
|
|
4654
4656
|
var provideConfig = async () => {
|
|
4655
4657
|
const configFilePath = `${process.cwd()}/embeddable.config.js`;
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
+
const tsConfigFilePath = `${process.cwd()}/embeddable.config.ts`;
|
|
4659
|
+
if (!fs__namespace$1.existsSync(configFilePath) && !fs__namespace$1.existsSync(tsConfigFilePath)) {
|
|
4660
|
+
console.log("Please create a proper `embeddable.config.js` or `embeddable.config.ts` file in the root of your project.");
|
|
4658
4661
|
process.exit(1);
|
|
4659
4662
|
}
|
|
4660
|
-
const
|
|
4661
|
-
|
|
4663
|
+
const isWindows = process.platform === "win32";
|
|
4664
|
+
const configPath = fs__namespace$1.existsSync(tsConfigFilePath)
|
|
4665
|
+
? tsConfigFilePath
|
|
4666
|
+
: configFilePath;
|
|
4667
|
+
const pathOrUrl = isWindows ? url__namespace.pathToFileURL(configPath).href : configPath;
|
|
4668
|
+
return (await import(pathOrUrl)).default;
|
|
4662
4669
|
};
|
|
4663
4670
|
|
|
4664
4671
|
function getDefaultExportFromCjs (x) {
|
|
@@ -20176,7 +20183,7 @@ async function verify(ctx) {
|
|
|
20176
20183
|
return token;
|
|
20177
20184
|
}
|
|
20178
20185
|
async function archive(ctx, yamlFiles, includeBuild = true) {
|
|
20179
|
-
const output =
|
|
20186
|
+
const output = fs__namespace$1.createWriteStream(ctx.client.archiveFile);
|
|
20180
20187
|
const _archiver = archiver__namespace.create("zip", {
|
|
20181
20188
|
zlib: { level: 9 },
|
|
20182
20189
|
});
|