@powerlines/engine 0.15.0 → 0.43.26

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/dist/api.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_chunk = require('./chunk-C0xms8kb.cjs');
3
- const require_execution_context = require('./execution-context-BgGV4xyW.cjs');
3
+ const require_execution_context = require('./execution-context-DiR9f4Pj.cjs');
4
4
  const require_tsconfig = require('./tsconfig-DeyWQC2N.cjs');
5
5
  const require_ts_morph = require('./ts-morph-BaLPVAdB.cjs');
6
6
  let _stryke_fs_resolve = require("@stryke/fs/resolve");
package/dist/api.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as mergeConfigs, i as callHook, s as writeMetaFile, t as PowerlinesExecutionContext } from "./execution-context-D_CXpe9I.mjs";
1
+ import { a as mergeConfigs, i as callHook, s as writeMetaFile, t as PowerlinesExecutionContext } from "./execution-context-DyQewevZ.mjs";
2
2
  import { a as isIncludeMatchFound, i as getTsconfigFilePath, r as getParsedTypeScriptConfig } from "./tsconfig-Cstsoprg.mjs";
3
3
  import { n as createProgram } from "./ts-morph-D0CaA37w.mjs";
4
4
  import { resolvePackage } from "@stryke/fs/resolve";
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_base_context = require('../base-context-CFvO2N9I.cjs');
3
3
  const require_engine_context = require('../engine-context-NO6enYev.cjs');
4
- const require_execution_context = require('../execution-context-BgGV4xyW.cjs');
4
+ const require_execution_context = require('../execution-context-DiR9f4Pj.cjs');
5
5
 
6
6
  exports.PowerlinesBaseContext = require_base_context.PowerlinesBaseContext;
7
7
  exports.PowerlinesContext = require_execution_context.PowerlinesContext;
@@ -1,5 +1,5 @@
1
1
  import { t as PowerlinesBaseContext } from "../base-context-BUnL_9z8.mjs";
2
2
  import { t as PowerlinesEngineContext } from "../engine-context-BuD9AGfd.mjs";
3
- import { n as PowerlinesEnvironmentContext, o as PowerlinesContext, r as createPluginContext, t as PowerlinesExecutionContext } from "../execution-context-D_CXpe9I.mjs";
3
+ import { n as PowerlinesEnvironmentContext, o as PowerlinesContext, r as createPluginContext, t as PowerlinesExecutionContext } from "../execution-context-DyQewevZ.mjs";
4
4
 
5
5
  export { PowerlinesBaseContext, PowerlinesContext, PowerlinesEngineContext, PowerlinesEnvironmentContext, PowerlinesExecutionContext, createPluginContext };
@@ -1965,8 +1965,28 @@ var PowerlinesContext = class PowerlinesContext extends require_base_context.Pow
1965
1965
  */
1966
1966
  async innerSetup() {
1967
1967
  this.resolvedConfig.compatibilityDate = (0, compatx.resolveCompatibilityDates)(this.config.inlineConfig.compatibilityDate ?? this.config.userConfig.compatibilityDate ?? this.config.pluginConfig.compatibilityDate, "latest");
1968
+ this.logger = {
1969
+ log: this.createLog(this.config.name),
1970
+ level: (0, _stryke_type_checks_is_null.isNull)(this.logLevel) ? "silent" : this.logLevel
1971
+ };
1972
+ this.config.input = (0, _powerlines_core_lib_entry.getUniqueInputs)(this.config.input);
1973
+ if (this.config.name?.startsWith("@") && this.config.name.split("/").filter(Boolean).length > 1) this.config.name = this.config.name.split("/").filter(Boolean)[1];
1974
+ this.config.title ??= (0, _stryke_string_format_title_case.titleCase)(this.config.name);
1975
+ if (this.config.userConfig.resolve?.external) this.config.userConfig.resolve.external = (0, _stryke_helpers_get_unique.getUnique)(this.config.userConfig.resolve.external);
1976
+ if (this.config.userConfig.resolve?.noExternal) this.config.userConfig.resolve.noExternal = (0, _stryke_helpers_get_unique.getUnique)(this.config.userConfig.resolve.noExternal);
1977
+ if (this.config.resolve.external) this.config.resolve.external = (0, _stryke_helpers_get_unique.getUnique)(this.config.resolve.external);
1978
+ if (this.config.resolve.noExternal) this.config.resolve.noExternal = (0, _stryke_helpers_get_unique.getUnique)(this.config.resolve.noExternal);
1979
+ this.config.plugins = (this.config.plugins ?? []).filter(Boolean).reduce((ret, plugin) => {
1980
+ if ((0, _powerlines_core_plugin_utils.isPlugin)(plugin) && (0, _powerlines_core_plugin_utils.isDuplicate)(plugin, ret.filter((p) => (0, _powerlines_core_plugin_utils.isPlugin)(p)))) return ret;
1981
+ ret.push(plugin);
1982
+ return ret;
1983
+ }, []);
1984
+ if (!this.config.userConfig?.logLevel && !this.config.inlineConfig?.logLevel) if (this.config.mode === "development") this.config.logLevel = "debug";
1985
+ else this.config.logLevel = "info";
1986
+ if (!this.config.userConfig?.tsconfig && !this.config.inlineConfig?.tsconfig) this.config.tsconfig = require_tsconfig.getTsconfigFilePath(this.options.cwd, this.options.root);
1987
+ else if (this.config.tsconfig) this.config.tsconfig = (0, _stryke_path_replace.replacePath)((0, _powerlines_core_plugin_utils.replacePathTokens)(this, this.config.tsconfig), this.config.cwd);
1968
1988
  this.resolvedConfig.output = (0, defu.default)(this.resolvedConfig.output ?? {}, {
1969
- path: (0, _stryke_path_append.appendPath)((0, _stryke_path_join.joinPaths)(this.config.root, "dist"), this.config.cwd),
1989
+ path: (0, _stryke_path_join.joinPaths)(this.config.root, "dist"),
1970
1990
  copy: { assets: [
1971
1991
  { glob: "LICENSE" },
1972
1992
  {
@@ -1979,32 +1999,15 @@ var PowerlinesContext = class PowerlinesContext extends require_base_context.Pow
1979
1999
  }
1980
2000
  ] },
1981
2001
  artifactsPath: `.${this.config.framework ?? "powerlines"}`,
1982
- dts: true,
1983
- types: (0, _stryke_path_join.joinPaths)(this.config.root, `${this.config.framework ?? "powerlines"}.d.ts`)
2002
+ dts: true
1984
2003
  });
1985
- this.logger = {
1986
- log: this.createLog(this.config.name),
1987
- level: (0, _stryke_type_checks_is_null.isNull)(this.logLevel) ? "silent" : this.logLevel
1988
- };
1989
- if (this.config.output?.format) this.config.output.format = (0, _stryke_helpers_get_unique.getUnique)((0, _stryke_convert_to_array.toArray)(this.config.output?.format));
1990
- this.config.plugins = (this.config.plugins ?? []).filter(Boolean).reduce((ret, plugin) => {
1991
- if ((0, _powerlines_core_plugin_utils.isPlugin)(plugin) && (0, _powerlines_core_plugin_utils.isDuplicate)(plugin, ret.filter((p) => (0, _powerlines_core_plugin_utils.isPlugin)(p)))) return ret;
1992
- ret.push(plugin);
1993
- return ret;
1994
- }, []);
1995
- this.config.input = (0, _powerlines_core_lib_entry.getUniqueInputs)(this.config.input);
1996
- if (this.config.name?.startsWith("@") && this.config.name.split("/").filter(Boolean).length > 1) this.config.name = this.config.name.split("/").filter(Boolean)[1];
1997
- this.config.title ??= (0, _stryke_string_format_title_case.titleCase)(this.config.name);
1998
- if (this.config.userConfig.resolve?.external) this.config.userConfig.resolve.external = (0, _stryke_helpers_get_unique.getUnique)(this.config.userConfig.resolve.external);
1999
- if (this.config.userConfig.resolve?.noExternal) this.config.userConfig.resolve.noExternal = (0, _stryke_helpers_get_unique.getUnique)(this.config.userConfig.resolve.noExternal);
2000
- if (this.config.resolve.external) this.config.resolve.external = (0, _stryke_helpers_get_unique.getUnique)(this.config.resolve.external);
2001
- if (this.config.resolve.noExternal) this.config.resolve.noExternal = (0, _stryke_helpers_get_unique.getUnique)(this.config.resolve.noExternal);
2002
2004
  this.config.output.format = (0, _stryke_helpers_get_unique.getUnique)((0, _stryke_convert_to_array.toArray)(this.config.output?.format ?? (this.config.projectType === "library" ? ["cjs", "esm"] : ["esm"])));
2003
- if (this.config.output.dts !== false && !this.config.output.types) this.config.output.types = `${this.config.root ? `${this.config.root}/` : ""}${this.config.framework ?? "powerlines"}.d.ts`;
2004
- if (this.config.root && this.config.output.copy !== false) this.config.output.copy = {
2005
- path: (0, _stryke_path_join.joinPaths)(this.config.cwd, "dist", (0, _stryke_path_replace.replacePath)(this.config.root, this.config.cwd)),
2006
- ...this.config.output.copy || {}
2007
- };
2005
+ if (this.config.output.path) this.config.output.path = (0, _stryke_path_append.appendPath)((0, _powerlines_core_plugin_utils.replacePathTokens)(this, this.config.output.path), this.config.cwd);
2006
+ if (this.config.output.copy !== false) {
2007
+ this.config.output.copy ??= {};
2008
+ this.config.output.copy.path = (0, _stryke_path_append.appendPath)((0, _powerlines_core_plugin_utils.replacePathTokens)(this, this.config.output.copy.path || (0, _stryke_path_join.joinPaths)("dist", this.config.root)), this.config.cwd);
2009
+ }
2010
+ if (this.config.output.dts !== false && this.config.output.types !== false) this.config.output.types = (0, _stryke_path_append.appendPath)((0, _powerlines_core_plugin_utils.replacePathTokens)(this, this.config.output.types || (0, _stryke_path_join.joinPaths)(this.config.root, `${this.config.framework ?? "powerlines"}.d.ts`)), this.config.cwd);
2008
2011
  if (this.config.output.copy && this.config.output.copy.path && this.config.output.copy.assets && Array.isArray(this.config.output.copy.assets)) this.config.output.copy.assets = (0, _stryke_helpers_get_unique.getUniqueBy)(this.config.output.copy.assets.map((asset) => {
2009
2012
  return {
2010
2013
  glob: (0, _stryke_type_checks_is_set_object.isSetObject)(asset) ? asset.glob : asset,
@@ -2013,21 +2016,10 @@ var PowerlinesContext = class PowerlinesContext extends require_base_context.Pow
2013
2016
  ignore: (0, _stryke_type_checks_is_set_object.isSetObject)(asset) && asset.ignore ? (0, _stryke_convert_to_array.toArray)(asset.ignore) : void 0
2014
2017
  };
2015
2018
  }), (a) => `${a.input}-${a.glob}-${a.output}`);
2016
- this.config.plugins = (this.config.plugins ?? []).filter(Boolean).reduce((ret, plugin) => {
2017
- if ((0, _powerlines_core_plugin_utils.isPlugin)(plugin) && (0, _powerlines_core_plugin_utils.isDuplicate)(plugin, ret.filter((p) => (0, _powerlines_core_plugin_utils.isPlugin)(p)))) return ret;
2018
- ret.push(plugin);
2019
- return ret;
2020
- }, []);
2021
- if (this.config.output.types) if ((0, _stryke_type_checks_is_set_string.isSetString)(this.config.output.types)) this.config.output.types = (0, _powerlines_core_plugin_utils.replacePathTokens)(this, this.config.output.types);
2022
- else this.config.output.types = (0, _stryke_path_join.joinPaths)(this.config.root, `${this.config.framework ?? "powerlines"}.d.ts`);
2023
- if (!this.config.userConfig?.logLevel && !this.config.inlineConfig?.logLevel) if (this.config.mode === "development") this.config.logLevel = "debug";
2024
- else this.config.logLevel = "info";
2025
2019
  if (!this.config.userConfig?.output?.sourceMap && !this.config.inlineConfig?.output?.sourceMap) if (this.config.mode === "development") this.config.output.sourceMap = true;
2026
2020
  else this.config.output.sourceMap = false;
2027
2021
  if (!this.config.userConfig?.output?.minify && !this.config.inlineConfig?.output?.minify) if (this.config.mode === "production") this.config.output.minify = true;
2028
2022
  else this.config.output.minify = false;
2029
- if (!this.config.userConfig?.tsconfig && !this.config.inlineConfig?.tsconfig) this.config.tsconfig = require_tsconfig.getTsconfigFilePath(this.options.cwd, this.options.root);
2030
- else if (this.config.tsconfig) this.config.tsconfig = (0, _stryke_path_replace.replacePath)((0, _powerlines_core_plugin_utils.replacePathTokens)(this, this.config.tsconfig), this.config.cwd);
2031
2023
  if (this.config.output.copy && this.config.output.copy.assets) this.config.output.copy.assets = this.config.output.copy.assets.map((asset) => ({
2032
2024
  ...asset,
2033
2025
  glob: (0, _powerlines_core_plugin_utils.replacePathTokens)(this, asset.glob),
@@ -1961,8 +1961,28 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
1961
1961
  */
1962
1962
  async innerSetup() {
1963
1963
  this.resolvedConfig.compatibilityDate = resolveCompatibilityDates(this.config.inlineConfig.compatibilityDate ?? this.config.userConfig.compatibilityDate ?? this.config.pluginConfig.compatibilityDate, "latest");
1964
+ this.logger = {
1965
+ log: this.createLog(this.config.name),
1966
+ level: isNull(this.logLevel) ? "silent" : this.logLevel
1967
+ };
1968
+ this.config.input = getUniqueInputs(this.config.input);
1969
+ if (this.config.name?.startsWith("@") && this.config.name.split("/").filter(Boolean).length > 1) this.config.name = this.config.name.split("/").filter(Boolean)[1];
1970
+ this.config.title ??= titleCase(this.config.name);
1971
+ if (this.config.userConfig.resolve?.external) this.config.userConfig.resolve.external = getUnique(this.config.userConfig.resolve.external);
1972
+ if (this.config.userConfig.resolve?.noExternal) this.config.userConfig.resolve.noExternal = getUnique(this.config.userConfig.resolve.noExternal);
1973
+ if (this.config.resolve.external) this.config.resolve.external = getUnique(this.config.resolve.external);
1974
+ if (this.config.resolve.noExternal) this.config.resolve.noExternal = getUnique(this.config.resolve.noExternal);
1975
+ this.config.plugins = (this.config.plugins ?? []).filter(Boolean).reduce((ret, plugin) => {
1976
+ if (isPlugin(plugin) && isDuplicate(plugin, ret.filter((p) => isPlugin(p)))) return ret;
1977
+ ret.push(plugin);
1978
+ return ret;
1979
+ }, []);
1980
+ if (!this.config.userConfig?.logLevel && !this.config.inlineConfig?.logLevel) if (this.config.mode === "development") this.config.logLevel = "debug";
1981
+ else this.config.logLevel = "info";
1982
+ if (!this.config.userConfig?.tsconfig && !this.config.inlineConfig?.tsconfig) this.config.tsconfig = getTsconfigFilePath(this.options.cwd, this.options.root);
1983
+ else if (this.config.tsconfig) this.config.tsconfig = replacePath(replacePathTokens(this, this.config.tsconfig), this.config.cwd);
1964
1984
  this.resolvedConfig.output = defu(this.resolvedConfig.output ?? {}, {
1965
- path: appendPath(joinPaths(this.config.root, "dist"), this.config.cwd),
1985
+ path: joinPaths(this.config.root, "dist"),
1966
1986
  copy: { assets: [
1967
1987
  { glob: "LICENSE" },
1968
1988
  {
@@ -1975,32 +1995,15 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
1975
1995
  }
1976
1996
  ] },
1977
1997
  artifactsPath: `.${this.config.framework ?? "powerlines"}`,
1978
- dts: true,
1979
- types: joinPaths(this.config.root, `${this.config.framework ?? "powerlines"}.d.ts`)
1998
+ dts: true
1980
1999
  });
1981
- this.logger = {
1982
- log: this.createLog(this.config.name),
1983
- level: isNull(this.logLevel) ? "silent" : this.logLevel
1984
- };
1985
- if (this.config.output?.format) this.config.output.format = getUnique(toArray(this.config.output?.format));
1986
- this.config.plugins = (this.config.plugins ?? []).filter(Boolean).reduce((ret, plugin) => {
1987
- if (isPlugin(plugin) && isDuplicate(plugin, ret.filter((p) => isPlugin(p)))) return ret;
1988
- ret.push(plugin);
1989
- return ret;
1990
- }, []);
1991
- this.config.input = getUniqueInputs(this.config.input);
1992
- if (this.config.name?.startsWith("@") && this.config.name.split("/").filter(Boolean).length > 1) this.config.name = this.config.name.split("/").filter(Boolean)[1];
1993
- this.config.title ??= titleCase(this.config.name);
1994
- if (this.config.userConfig.resolve?.external) this.config.userConfig.resolve.external = getUnique(this.config.userConfig.resolve.external);
1995
- if (this.config.userConfig.resolve?.noExternal) this.config.userConfig.resolve.noExternal = getUnique(this.config.userConfig.resolve.noExternal);
1996
- if (this.config.resolve.external) this.config.resolve.external = getUnique(this.config.resolve.external);
1997
- if (this.config.resolve.noExternal) this.config.resolve.noExternal = getUnique(this.config.resolve.noExternal);
1998
2000
  this.config.output.format = getUnique(toArray(this.config.output?.format ?? (this.config.projectType === "library" ? ["cjs", "esm"] : ["esm"])));
1999
- if (this.config.output.dts !== false && !this.config.output.types) this.config.output.types = `${this.config.root ? `${this.config.root}/` : ""}${this.config.framework ?? "powerlines"}.d.ts`;
2000
- if (this.config.root && this.config.output.copy !== false) this.config.output.copy = {
2001
- path: joinPaths(this.config.cwd, "dist", replacePath(this.config.root, this.config.cwd)),
2002
- ...this.config.output.copy || {}
2003
- };
2001
+ if (this.config.output.path) this.config.output.path = appendPath(replacePathTokens(this, this.config.output.path), this.config.cwd);
2002
+ if (this.config.output.copy !== false) {
2003
+ this.config.output.copy ??= {};
2004
+ this.config.output.copy.path = appendPath(replacePathTokens(this, this.config.output.copy.path || joinPaths("dist", this.config.root)), this.config.cwd);
2005
+ }
2006
+ if (this.config.output.dts !== false && this.config.output.types !== false) this.config.output.types = appendPath(replacePathTokens(this, this.config.output.types || joinPaths(this.config.root, `${this.config.framework ?? "powerlines"}.d.ts`)), this.config.cwd);
2004
2007
  if (this.config.output.copy && this.config.output.copy.path && this.config.output.copy.assets && Array.isArray(this.config.output.copy.assets)) this.config.output.copy.assets = getUniqueBy(this.config.output.copy.assets.map((asset) => {
2005
2008
  return {
2006
2009
  glob: isSetObject(asset) ? asset.glob : asset,
@@ -2009,21 +2012,10 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
2009
2012
  ignore: isSetObject(asset) && asset.ignore ? toArray(asset.ignore) : void 0
2010
2013
  };
2011
2014
  }), (a) => `${a.input}-${a.glob}-${a.output}`);
2012
- this.config.plugins = (this.config.plugins ?? []).filter(Boolean).reduce((ret, plugin) => {
2013
- if (isPlugin(plugin) && isDuplicate(plugin, ret.filter((p) => isPlugin(p)))) return ret;
2014
- ret.push(plugin);
2015
- return ret;
2016
- }, []);
2017
- if (this.config.output.types) if (isSetString(this.config.output.types)) this.config.output.types = replacePathTokens(this, this.config.output.types);
2018
- else this.config.output.types = joinPaths(this.config.root, `${this.config.framework ?? "powerlines"}.d.ts`);
2019
- if (!this.config.userConfig?.logLevel && !this.config.inlineConfig?.logLevel) if (this.config.mode === "development") this.config.logLevel = "debug";
2020
- else this.config.logLevel = "info";
2021
2015
  if (!this.config.userConfig?.output?.sourceMap && !this.config.inlineConfig?.output?.sourceMap) if (this.config.mode === "development") this.config.output.sourceMap = true;
2022
2016
  else this.config.output.sourceMap = false;
2023
2017
  if (!this.config.userConfig?.output?.minify && !this.config.inlineConfig?.output?.minify) if (this.config.mode === "production") this.config.output.minify = true;
2024
2018
  else this.config.output.minify = false;
2025
- if (!this.config.userConfig?.tsconfig && !this.config.inlineConfig?.tsconfig) this.config.tsconfig = getTsconfigFilePath(this.options.cwd, this.options.root);
2026
- else if (this.config.tsconfig) this.config.tsconfig = replacePath(replacePathTokens(this, this.config.tsconfig), this.config.cwd);
2027
2019
  if (this.config.output.copy && this.config.output.copy.assets) this.config.output.copy.assets = this.config.output.copy.assets.map((asset) => ({
2028
2020
  ...asset,
2029
2021
  glob: replacePathTokens(this, asset.glob),
@@ -2567,4 +2559,4 @@ var PowerlinesExecutionContext = class PowerlinesExecutionContext extends Powerl
2567
2559
 
2568
2560
  //#endregion
2569
2561
  export { mergeConfigs as a, callHook as i, PowerlinesEnvironmentContext as n, PowerlinesContext as o, createPluginContext as r, writeMetaFile as s, PowerlinesExecutionContext as t };
2570
- //# sourceMappingURL=execution-context-D_CXpe9I.mjs.map
2562
+ //# sourceMappingURL=execution-context-DyQewevZ.mjs.map