@powerlines/engine 0.43.25 → 0.43.27

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.
@@ -3084,8 +3084,28 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
3084
3084
  */
3085
3085
  async innerSetup() {
3086
3086
  this.resolvedConfig.compatibilityDate = (0, compatx.resolveCompatibilityDates)(this.config.inlineConfig.compatibilityDate ?? this.config.userConfig.compatibilityDate ?? this.config.pluginConfig.compatibilityDate, "latest");
3087
+ this.logger = {
3088
+ log: this.createLog(this.config.name),
3089
+ level: (0, _stryke_type_checks_is_null.isNull)(this.logLevel) ? "silent" : this.logLevel
3090
+ };
3091
+ this.config.input = (0, _powerlines_core_lib_entry.getUniqueInputs)(this.config.input);
3092
+ if (this.config.name?.startsWith("@") && this.config.name.split("/").filter(Boolean).length > 1) this.config.name = this.config.name.split("/").filter(Boolean)[1];
3093
+ this.config.title ??= (0, _stryke_string_format_title_case.titleCase)(this.config.name);
3094
+ if (this.config.userConfig.resolve?.external) this.config.userConfig.resolve.external = (0, _stryke_helpers_get_unique.getUnique)(this.config.userConfig.resolve.external);
3095
+ if (this.config.userConfig.resolve?.noExternal) this.config.userConfig.resolve.noExternal = (0, _stryke_helpers_get_unique.getUnique)(this.config.userConfig.resolve.noExternal);
3096
+ if (this.config.resolve.external) this.config.resolve.external = (0, _stryke_helpers_get_unique.getUnique)(this.config.resolve.external);
3097
+ if (this.config.resolve.noExternal) this.config.resolve.noExternal = (0, _stryke_helpers_get_unique.getUnique)(this.config.resolve.noExternal);
3098
+ this.config.plugins = (this.config.plugins ?? []).filter(Boolean).reduce((ret, plugin) => {
3099
+ 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;
3100
+ ret.push(plugin);
3101
+ return ret;
3102
+ }, []);
3103
+ if (!this.config.userConfig?.logLevel && !this.config.inlineConfig?.logLevel) if (this.config.mode === "development") this.config.logLevel = "debug";
3104
+ else this.config.logLevel = "info";
3105
+ if (!this.config.userConfig?.tsconfig && !this.config.inlineConfig?.tsconfig) this.config.tsconfig = getTsconfigFilePath(this.options.cwd, this.options.root);
3106
+ 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);
3087
3107
  this.resolvedConfig.output = (0, defu.default)(this.resolvedConfig.output ?? {}, {
3088
- path: (0, _stryke_path_append.appendPath)((0, _stryke_path_join.joinPaths)(this.config.root, "dist"), this.config.cwd),
3108
+ path: (0, _stryke_path_join.joinPaths)(this.config.root, "dist"),
3089
3109
  copy: { assets: [
3090
3110
  { glob: "LICENSE" },
3091
3111
  {
@@ -3098,32 +3118,15 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
3098
3118
  }
3099
3119
  ] },
3100
3120
  artifactsPath: `.${this.config.framework ?? "powerlines"}`,
3101
- dts: true,
3102
- types: (0, _stryke_path_join.joinPaths)(this.config.root, `${this.config.framework ?? "powerlines"}.d.ts`)
3121
+ dts: true
3103
3122
  });
3104
- this.logger = {
3105
- log: this.createLog(this.config.name),
3106
- level: (0, _stryke_type_checks_is_null.isNull)(this.logLevel) ? "silent" : this.logLevel
3107
- };
3108
- 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));
3109
- this.config.plugins = (this.config.plugins ?? []).filter(Boolean).reduce((ret, plugin) => {
3110
- 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;
3111
- ret.push(plugin);
3112
- return ret;
3113
- }, []);
3114
- this.config.input = (0, _powerlines_core_lib_entry.getUniqueInputs)(this.config.input);
3115
- if (this.config.name?.startsWith("@") && this.config.name.split("/").filter(Boolean).length > 1) this.config.name = this.config.name.split("/").filter(Boolean)[1];
3116
- this.config.title ??= (0, _stryke_string_format_title_case.titleCase)(this.config.name);
3117
- if (this.config.userConfig.resolve?.external) this.config.userConfig.resolve.external = (0, _stryke_helpers_get_unique.getUnique)(this.config.userConfig.resolve.external);
3118
- if (this.config.userConfig.resolve?.noExternal) this.config.userConfig.resolve.noExternal = (0, _stryke_helpers_get_unique.getUnique)(this.config.userConfig.resolve.noExternal);
3119
- if (this.config.resolve.external) this.config.resolve.external = (0, _stryke_helpers_get_unique.getUnique)(this.config.resolve.external);
3120
- if (this.config.resolve.noExternal) this.config.resolve.noExternal = (0, _stryke_helpers_get_unique.getUnique)(this.config.resolve.noExternal);
3121
3123
  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"])));
3122
- 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`;
3123
- if (this.config.root && this.config.output.copy !== false) this.config.output.copy = {
3124
- path: (0, _stryke_path_join.joinPaths)(this.config.cwd, "dist", (0, _stryke_path_replace.replacePath)(this.config.root, this.config.cwd)),
3125
- ...this.config.output.copy || {}
3126
- };
3124
+ 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);
3125
+ if (this.config.output.copy !== false) {
3126
+ this.config.output.copy ??= {};
3127
+ 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);
3128
+ }
3129
+ 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);
3127
3130
  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) => {
3128
3131
  return {
3129
3132
  glob: (0, _stryke_type_checks_is_set_object.isSetObject)(asset) ? asset.glob : asset,
@@ -3132,21 +3135,10 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
3132
3135
  ignore: (0, _stryke_type_checks_is_set_object.isSetObject)(asset) && asset.ignore ? (0, _stryke_convert_to_array.toArray)(asset.ignore) : void 0
3133
3136
  };
3134
3137
  }), (a) => `${a.input}-${a.glob}-${a.output}`);
3135
- this.config.plugins = (this.config.plugins ?? []).filter(Boolean).reduce((ret, plugin) => {
3136
- 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;
3137
- ret.push(plugin);
3138
- return ret;
3139
- }, []);
3140
- 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);
3141
- else this.config.output.types = (0, _stryke_path_join.joinPaths)(this.config.root, `${this.config.framework ?? "powerlines"}.d.ts`);
3142
- if (!this.config.userConfig?.logLevel && !this.config.inlineConfig?.logLevel) if (this.config.mode === "development") this.config.logLevel = "debug";
3143
- else this.config.logLevel = "info";
3144
3138
  if (!this.config.userConfig?.output?.sourceMap && !this.config.inlineConfig?.output?.sourceMap) if (this.config.mode === "development") this.config.output.sourceMap = true;
3145
3139
  else this.config.output.sourceMap = false;
3146
3140
  if (!this.config.userConfig?.output?.minify && !this.config.inlineConfig?.output?.minify) if (this.config.mode === "production") this.config.output.minify = true;
3147
3141
  else this.config.output.minify = false;
3148
- if (!this.config.userConfig?.tsconfig && !this.config.inlineConfig?.tsconfig) this.config.tsconfig = getTsconfigFilePath(this.options.cwd, this.options.root);
3149
- 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);
3150
3142
  if (this.config.output.copy && this.config.output.copy.assets) this.config.output.copy.assets = this.config.output.copy.assets.map((asset) => ({
3151
3143
  ...asset,
3152
3144
  glob: (0, _powerlines_core_plugin_utils.replacePathTokens)(this, asset.glob),
@@ -3051,8 +3051,28 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
3051
3051
  */
3052
3052
  async innerSetup() {
3053
3053
  this.resolvedConfig.compatibilityDate = resolveCompatibilityDates(this.config.inlineConfig.compatibilityDate ?? this.config.userConfig.compatibilityDate ?? this.config.pluginConfig.compatibilityDate, "latest");
3054
+ this.logger = {
3055
+ log: this.createLog(this.config.name),
3056
+ level: isNull(this.logLevel) ? "silent" : this.logLevel
3057
+ };
3058
+ this.config.input = getUniqueInputs(this.config.input);
3059
+ if (this.config.name?.startsWith("@") && this.config.name.split("/").filter(Boolean).length > 1) this.config.name = this.config.name.split("/").filter(Boolean)[1];
3060
+ this.config.title ??= titleCase(this.config.name);
3061
+ if (this.config.userConfig.resolve?.external) this.config.userConfig.resolve.external = getUnique(this.config.userConfig.resolve.external);
3062
+ if (this.config.userConfig.resolve?.noExternal) this.config.userConfig.resolve.noExternal = getUnique(this.config.userConfig.resolve.noExternal);
3063
+ if (this.config.resolve.external) this.config.resolve.external = getUnique(this.config.resolve.external);
3064
+ if (this.config.resolve.noExternal) this.config.resolve.noExternal = getUnique(this.config.resolve.noExternal);
3065
+ this.config.plugins = (this.config.plugins ?? []).filter(Boolean).reduce((ret, plugin) => {
3066
+ if (isPlugin(plugin) && isDuplicate(plugin, ret.filter((p) => isPlugin(p)))) return ret;
3067
+ ret.push(plugin);
3068
+ return ret;
3069
+ }, []);
3070
+ if (!this.config.userConfig?.logLevel && !this.config.inlineConfig?.logLevel) if (this.config.mode === "development") this.config.logLevel = "debug";
3071
+ else this.config.logLevel = "info";
3072
+ if (!this.config.userConfig?.tsconfig && !this.config.inlineConfig?.tsconfig) this.config.tsconfig = getTsconfigFilePath(this.options.cwd, this.options.root);
3073
+ else if (this.config.tsconfig) this.config.tsconfig = replacePath(replacePathTokens(this, this.config.tsconfig), this.config.cwd);
3054
3074
  this.resolvedConfig.output = defu(this.resolvedConfig.output ?? {}, {
3055
- path: appendPath(joinPaths$1(this.config.root, "dist"), this.config.cwd),
3075
+ path: joinPaths$1(this.config.root, "dist"),
3056
3076
  copy: { assets: [
3057
3077
  { glob: "LICENSE" },
3058
3078
  {
@@ -3065,32 +3085,15 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
3065
3085
  }
3066
3086
  ] },
3067
3087
  artifactsPath: `.${this.config.framework ?? "powerlines"}`,
3068
- dts: true,
3069
- types: joinPaths$1(this.config.root, `${this.config.framework ?? "powerlines"}.d.ts`)
3088
+ dts: true
3070
3089
  });
3071
- this.logger = {
3072
- log: this.createLog(this.config.name),
3073
- level: isNull(this.logLevel) ? "silent" : this.logLevel
3074
- };
3075
- if (this.config.output?.format) this.config.output.format = getUnique(toArray(this.config.output?.format));
3076
- this.config.plugins = (this.config.plugins ?? []).filter(Boolean).reduce((ret, plugin) => {
3077
- if (isPlugin(plugin) && isDuplicate(plugin, ret.filter((p) => isPlugin(p)))) return ret;
3078
- ret.push(plugin);
3079
- return ret;
3080
- }, []);
3081
- this.config.input = getUniqueInputs(this.config.input);
3082
- if (this.config.name?.startsWith("@") && this.config.name.split("/").filter(Boolean).length > 1) this.config.name = this.config.name.split("/").filter(Boolean)[1];
3083
- this.config.title ??= titleCase(this.config.name);
3084
- if (this.config.userConfig.resolve?.external) this.config.userConfig.resolve.external = getUnique(this.config.userConfig.resolve.external);
3085
- if (this.config.userConfig.resolve?.noExternal) this.config.userConfig.resolve.noExternal = getUnique(this.config.userConfig.resolve.noExternal);
3086
- if (this.config.resolve.external) this.config.resolve.external = getUnique(this.config.resolve.external);
3087
- if (this.config.resolve.noExternal) this.config.resolve.noExternal = getUnique(this.config.resolve.noExternal);
3088
3090
  this.config.output.format = getUnique(toArray(this.config.output?.format ?? (this.config.projectType === "library" ? ["cjs", "esm"] : ["esm"])));
3089
- 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`;
3090
- if (this.config.root && this.config.output.copy !== false) this.config.output.copy = {
3091
- path: joinPaths$1(this.config.cwd, "dist", replacePath(this.config.root, this.config.cwd)),
3092
- ...this.config.output.copy || {}
3093
- };
3091
+ if (this.config.output.path) this.config.output.path = appendPath(replacePathTokens(this, this.config.output.path), this.config.cwd);
3092
+ if (this.config.output.copy !== false) {
3093
+ this.config.output.copy ??= {};
3094
+ this.config.output.copy.path = appendPath(replacePathTokens(this, this.config.output.copy.path || joinPaths$1("dist", this.config.root)), this.config.cwd);
3095
+ }
3096
+ if (this.config.output.dts !== false && this.config.output.types !== false) this.config.output.types = appendPath(replacePathTokens(this, this.config.output.types || joinPaths$1(this.config.root, `${this.config.framework ?? "powerlines"}.d.ts`)), this.config.cwd);
3094
3097
  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) => {
3095
3098
  return {
3096
3099
  glob: isSetObject(asset) ? asset.glob : asset,
@@ -3099,21 +3102,10 @@ var PowerlinesContext = class PowerlinesContext extends PowerlinesBaseContext {
3099
3102
  ignore: isSetObject(asset) && asset.ignore ? toArray(asset.ignore) : void 0
3100
3103
  };
3101
3104
  }), (a) => `${a.input}-${a.glob}-${a.output}`);
3102
- this.config.plugins = (this.config.plugins ?? []).filter(Boolean).reduce((ret, plugin) => {
3103
- if (isPlugin(plugin) && isDuplicate(plugin, ret.filter((p) => isPlugin(p)))) return ret;
3104
- ret.push(plugin);
3105
- return ret;
3106
- }, []);
3107
- if (this.config.output.types) if (isSetString(this.config.output.types)) this.config.output.types = replacePathTokens(this, this.config.output.types);
3108
- else this.config.output.types = joinPaths$1(this.config.root, `${this.config.framework ?? "powerlines"}.d.ts`);
3109
- if (!this.config.userConfig?.logLevel && !this.config.inlineConfig?.logLevel) if (this.config.mode === "development") this.config.logLevel = "debug";
3110
- else this.config.logLevel = "info";
3111
3105
  if (!this.config.userConfig?.output?.sourceMap && !this.config.inlineConfig?.output?.sourceMap) if (this.config.mode === "development") this.config.output.sourceMap = true;
3112
3106
  else this.config.output.sourceMap = false;
3113
3107
  if (!this.config.userConfig?.output?.minify && !this.config.inlineConfig?.output?.minify) if (this.config.mode === "production") this.config.output.minify = true;
3114
3108
  else this.config.output.minify = false;
3115
- if (!this.config.userConfig?.tsconfig && !this.config.inlineConfig?.tsconfig) this.config.tsconfig = getTsconfigFilePath(this.options.cwd, this.options.root);
3116
- else if (this.config.tsconfig) this.config.tsconfig = replacePath(replacePathTokens(this, this.config.tsconfig), this.config.cwd);
3117
3109
  if (this.config.output.copy && this.config.output.copy.assets) this.config.output.copy.assets = this.config.output.copy.assets.map((asset) => ({
3118
3110
  ...asset,
3119
3111
  glob: replacePathTokens(this, asset.glob),