@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/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 fsSync = require('node:fs');
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 fsSync__namespace = /*#__PURE__*/_interopNamespaceDefault(fsSync);
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 (fsSync__namespace.existsSync(ctx.client.buildDir))
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
- if (!fsSync__namespace.existsSync(configFilePath)) {
4657
- console.log("Please create a proper `embeddable.config.js` file first.");
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 configFileUrl = url__namespace.pathToFileURL(configFilePath).href;
4661
- return (await import(configFileUrl)).default;
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 = fsSync__namespace.createWriteStream(ctx.client.archiveFile);
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
  });