@powerlines/plugin-unenv 0.1.351 → 0.1.352

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-unenv",
3
- "version": "0.1.351",
3
+ "version": "0.1.352",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to transform source code to be platform agnostic using unenv.",
6
6
  "repository": {
@@ -89,15 +89,15 @@
89
89
  "files": ["dist/**/*"],
90
90
  "keywords": ["unenv", "powerlines", "storm-software", "powerlines-plugin"],
91
91
  "dependencies": {
92
- "powerlines": "^0.42.3",
92
+ "powerlines": "^0.42.4",
93
93
  "typescript": "^5.9.3",
94
94
  "unenv": "npm:unenv-nightly@2.0.0-rc.24"
95
95
  },
96
96
  "devDependencies": {
97
- "@powerlines/plugin-plugin": "^0.12.313",
97
+ "@powerlines/plugin-plugin": "^0.12.314",
98
98
  "@types/node": "^25.5.0"
99
99
  },
100
100
  "publishConfig": { "access": "public" },
101
101
  "types": "./dist/index.d.cts",
102
- "gitHead": "c9c61ea343f037afaa4097720d77cb822eb86e63"
102
+ "gitHead": "c3243c1ec0fbacb4afd4bd3db20432f443334076"
103
103
  }
@@ -1,3 +0,0 @@
1
- import "node:module";
2
-
3
- export { };
package/dist/index.cjs DELETED
@@ -1,46 +0,0 @@
1
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
- let unenv = require("unenv");
3
-
4
- //#region src/index.ts
5
- /**
6
- * The unenv plugin for Powerlines.
7
- *
8
- * @see https://unjs.dev/packages/unenv
9
- *
10
- * @param options - The unenv plugin user configuration options.
11
- * @returns A Powerlines plugin to transform source code to be platform agnostic using unenv.
12
- */
13
- const plugin = (options = {}) => {
14
- return {
15
- name: "unenv",
16
- async config() {
17
- return { unenv: options };
18
- },
19
- configResolved() {
20
- this.unenv = (0, unenv.defineEnv)(this.config.unenv || {});
21
- this.config.resolve.alias ??= {};
22
- if (Array.isArray(this.config.resolve.alias)) this.config.resolve.alias = Object.entries(this.unenv.env.alias).reduce((aliases, [key, value]) => {
23
- if (!aliases.find((alias) => alias.find === key)) aliases.push({
24
- find: key,
25
- replacement: value
26
- });
27
- return aliases;
28
- }, this.config.resolve.alias);
29
- else this.config.resolve.alias = {
30
- ...this.unenv.env.alias,
31
- ...this.config.resolve.alias
32
- };
33
- this.config.resolve.external ??= [];
34
- this.config.resolve.external.push(...this.unenv.env.external);
35
- this.config.inject ??= {};
36
- this.config.inject = {
37
- ...this.unenv.env.inject,
38
- ...this.config.inject
39
- };
40
- }
41
- };
42
- };
43
-
44
- //#endregion
45
- exports.default = plugin;
46
- exports.plugin = plugin;
package/dist/index.d.cts DELETED
@@ -1,21 +0,0 @@
1
- import { UnenvPluginContext, UnenvPluginOptions, UnenvPluginResolvedConfig, UnenvPluginUserConfig, __ΩUnenvPluginContext, __ΩUnenvPluginOptions, __ΩUnenvPluginResolvedConfig, __ΩUnenvPluginUserConfig } from "./types/plugin.cjs";
2
- import { Plugin } from "powerlines";
3
-
4
- //#region src/index.d.ts
5
- declare module "powerlines" {
6
- interface Config {
7
- unenv?: UnenvPluginOptions;
8
- }
9
- }
10
- /**
11
- * The unenv plugin for Powerlines.
12
- *
13
- * @see https://unjs.dev/packages/unenv
14
- *
15
- * @param options - The unenv plugin user configuration options.
16
- * @returns A Powerlines plugin to transform source code to be platform agnostic using unenv.
17
- */
18
- declare const plugin: <TContext extends UnenvPluginContext = UnenvPluginContext>(options?: UnenvPluginOptions) => Plugin<TContext>;
19
- //#endregion
20
- export { UnenvPluginContext, UnenvPluginOptions, UnenvPluginResolvedConfig, UnenvPluginUserConfig, __ΩUnenvPluginContext, __ΩUnenvPluginOptions, __ΩUnenvPluginResolvedConfig, __ΩUnenvPluginUserConfig, plugin as default, plugin };
21
- //# sourceMappingURL=index.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;YAyBY,MAAA;IACR,KAAA,GAAQ,kBAAA;EAAA;AAAA;;;;;;;;AAYZ;cAAa,MAAA,oBACM,kBAAA,GAAqB,kBAAA,EAEtC,OAAA,GAAS,kBAAA,KACR,MAAA,CAAO,QAAA"}
package/dist/index.d.mts DELETED
@@ -1,21 +0,0 @@
1
- import { UnenvPluginContext, UnenvPluginOptions, UnenvPluginResolvedConfig, UnenvPluginUserConfig, __ΩUnenvPluginContext, __ΩUnenvPluginOptions, __ΩUnenvPluginResolvedConfig, __ΩUnenvPluginUserConfig } from "./types/plugin.mjs";
2
- import { Plugin } from "powerlines";
3
-
4
- //#region src/index.d.ts
5
- declare module "powerlines" {
6
- interface Config {
7
- unenv?: UnenvPluginOptions;
8
- }
9
- }
10
- /**
11
- * The unenv plugin for Powerlines.
12
- *
13
- * @see https://unjs.dev/packages/unenv
14
- *
15
- * @param options - The unenv plugin user configuration options.
16
- * @returns A Powerlines plugin to transform source code to be platform agnostic using unenv.
17
- */
18
- declare const plugin: <TContext extends UnenvPluginContext = UnenvPluginContext>(options?: UnenvPluginOptions) => Plugin<TContext>;
19
- //#endregion
20
- export { UnenvPluginContext, UnenvPluginOptions, UnenvPluginResolvedConfig, UnenvPluginUserConfig, __ΩUnenvPluginContext, __ΩUnenvPluginOptions, __ΩUnenvPluginResolvedConfig, __ΩUnenvPluginUserConfig, plugin as default, plugin };
21
- //# sourceMappingURL=index.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;YAyBY,MAAA;IACR,KAAA,GAAQ,kBAAA;EAAA;AAAA;;;;;;;;AAYZ;cAAa,MAAA,oBACM,kBAAA,GAAqB,kBAAA,EAEtC,OAAA,GAAS,kBAAA,KACR,MAAA,CAAO,QAAA"}
package/dist/index.mjs DELETED
@@ -1,45 +0,0 @@
1
- import { defineEnv } from "unenv";
2
-
3
- //#region src/index.ts
4
- /**
5
- * The unenv plugin for Powerlines.
6
- *
7
- * @see https://unjs.dev/packages/unenv
8
- *
9
- * @param options - The unenv plugin user configuration options.
10
- * @returns A Powerlines plugin to transform source code to be platform agnostic using unenv.
11
- */
12
- const plugin = (options = {}) => {
13
- return {
14
- name: "unenv",
15
- async config() {
16
- return { unenv: options };
17
- },
18
- configResolved() {
19
- this.unenv = defineEnv(this.config.unenv || {});
20
- this.config.resolve.alias ??= {};
21
- if (Array.isArray(this.config.resolve.alias)) this.config.resolve.alias = Object.entries(this.unenv.env.alias).reduce((aliases, [key, value]) => {
22
- if (!aliases.find((alias) => alias.find === key)) aliases.push({
23
- find: key,
24
- replacement: value
25
- });
26
- return aliases;
27
- }, this.config.resolve.alias);
28
- else this.config.resolve.alias = {
29
- ...this.unenv.env.alias,
30
- ...this.config.resolve.alias
31
- };
32
- this.config.resolve.external ??= [];
33
- this.config.resolve.external.push(...this.unenv.env.external);
34
- this.config.inject ??= {};
35
- this.config.inject = {
36
- ...this.unenv.env.inject,
37
- ...this.config.inject
38
- };
39
- }
40
- };
41
- };
42
-
43
- //#endregion
44
- export { plugin as default, plugin };
45
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Plugin } from \"powerlines\";\nimport { defineEnv } from \"unenv\";\nimport type { UnenvPluginContext, UnenvPluginOptions } from \"./types/plugin\";\n\nexport type * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n unenv?: UnenvPluginOptions;\n }\n}\n\n/**\n * The unenv plugin for Powerlines.\n *\n * @see https://unjs.dev/packages/unenv\n *\n * @param options - The unenv plugin user configuration options.\n * @returns A Powerlines plugin to transform source code to be platform agnostic using unenv.\n */\nexport const plugin = <\n TContext extends UnenvPluginContext = UnenvPluginContext\n>(\n options: UnenvPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"unenv\",\n async config() {\n return {\n unenv: options\n };\n },\n configResolved() {\n this.unenv = defineEnv(this.config.unenv || {});\n\n this.config.resolve.alias ??= {};\n if (Array.isArray(this.config.resolve.alias)) {\n this.config.resolve.alias = Object.entries(this.unenv.env.alias).reduce(\n (aliases, [key, value]) => {\n if (!aliases.find(alias => alias.find === key)) {\n aliases.push({ find: key, replacement: value });\n }\n\n return aliases;\n },\n this.config.resolve.alias\n );\n } else {\n this.config.resolve.alias = {\n ...this.unenv.env.alias,\n ...this.config.resolve.alias\n };\n }\n\n this.config.resolve.external ??= [];\n this.config.resolve.external.push(...this.unenv.env.external);\n\n this.config.inject ??= {};\n this.config.inject = {\n ...(this.unenv.env.inject as Record<string, string | string[]>),\n ...this.config.inject\n };\n\n // this.config.build.polyfill ??= [];\n // this.config.build.polyfill.push(...this.unenv.env.polyfill);\n }\n } as Plugin<TContext>;\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;AAsCA,MAAa,UAGX,UAA8B,EAAE,KACX;AACrB,QAAO;EACL,MAAM;EACN,MAAM,SAAS;AACb,UAAO,EACL,OAAO,SACR;;EAEH,iBAAiB;AACf,QAAK,QAAQ,UAAU,KAAK,OAAO,SAAS,EAAE,CAAC;AAE/C,QAAK,OAAO,QAAQ,UAAU,EAAE;AAChC,OAAI,MAAM,QAAQ,KAAK,OAAO,QAAQ,MAAM,CAC1C,MAAK,OAAO,QAAQ,QAAQ,OAAO,QAAQ,KAAK,MAAM,IAAI,MAAM,CAAC,QAC9D,SAAS,CAAC,KAAK,WAAW;AACzB,QAAI,CAAC,QAAQ,MAAK,UAAS,MAAM,SAAS,IAAI,CAC5C,SAAQ,KAAK;KAAE,MAAM;KAAK,aAAa;KAAO,CAAC;AAGjD,WAAO;MAET,KAAK,OAAO,QAAQ,MACrB;OAED,MAAK,OAAO,QAAQ,QAAQ;IAC1B,GAAG,KAAK,MAAM,IAAI;IAClB,GAAG,KAAK,OAAO,QAAQ;IACxB;AAGH,QAAK,OAAO,QAAQ,aAAa,EAAE;AACnC,QAAK,OAAO,QAAQ,SAAS,KAAK,GAAG,KAAK,MAAM,IAAI,SAAS;AAE7D,QAAK,OAAO,WAAW,EAAE;AACzB,QAAK,OAAO,SAAS;IACnB,GAAI,KAAK,MAAM,IAAI;IACnB,GAAG,KAAK,OAAO;IAChB;;EAKJ"}
File without changes
@@ -1,2 +0,0 @@
1
- import { UnenvPluginContext, UnenvPluginOptions, UnenvPluginResolvedConfig, UnenvPluginUserConfig, __ΩUnenvPluginContext, __ΩUnenvPluginOptions, __ΩUnenvPluginResolvedConfig, __ΩUnenvPluginUserConfig } from "./plugin.cjs";
2
- export { UnenvPluginContext, UnenvPluginOptions, UnenvPluginResolvedConfig, UnenvPluginUserConfig, __ΩUnenvPluginContext, __ΩUnenvPluginOptions, __ΩUnenvPluginResolvedConfig, __ΩUnenvPluginUserConfig };
@@ -1,2 +0,0 @@
1
- import { UnenvPluginContext, UnenvPluginOptions, UnenvPluginResolvedConfig, UnenvPluginUserConfig, __ΩUnenvPluginContext, __ΩUnenvPluginOptions, __ΩUnenvPluginResolvedConfig, __ΩUnenvPluginUserConfig } from "./plugin.mjs";
2
- export { UnenvPluginContext, UnenvPluginOptions, UnenvPluginResolvedConfig, UnenvPluginUserConfig, __ΩUnenvPluginContext, __ΩUnenvPluginOptions, __ΩUnenvPluginResolvedConfig, __ΩUnenvPluginUserConfig };
@@ -1 +0,0 @@
1
- export { };
File without changes
@@ -1,22 +0,0 @@
1
- import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
2
- import * as unenv from "unenv";
3
- import { CreateEnvOptions } from "unenv";
4
-
5
- //#region src/types/plugin.d.ts
6
- type UnenvPluginOptions = Partial<CreateEnvOptions>;
7
- interface UnenvPluginUserConfig extends UserConfig {
8
- unenv: UnenvPluginOptions;
9
- }
10
- interface UnenvPluginResolvedConfig extends ResolvedConfig {
11
- unenv: CreateEnvOptions;
12
- }
13
- type UnenvPluginContext<TResolvedConfig extends UnenvPluginResolvedConfig = UnenvPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
14
- unenv: ReturnType<typeof unenv.defineEnv>;
15
- };
16
- declare type __ΩUnenvPluginOptions = any[];
17
- declare type __ΩUnenvPluginUserConfig = any[];
18
- declare type __ΩUnenvPluginResolvedConfig = any[];
19
- declare type __ΩUnenvPluginContext = any[];
20
- //#endregion
21
- export { UnenvPluginContext, UnenvPluginOptions, UnenvPluginResolvedConfig, UnenvPluginUserConfig, __ΩUnenvPluginContext, __ΩUnenvPluginOptions, __ΩUnenvPluginResolvedConfig, __ΩUnenvPluginUserConfig };
22
- //# sourceMappingURL=plugin.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;KAqBY,kBAAA,GAAqB,OAAA,CAAQ,gBAAA;AAAA,UAExB,qBAAA,SAA8B,UAAA;EAC7C,KAAA,EAAO,kBAAA;AAAA;AAAA,UAGQ,yBAAA,SAAkC,cAAA;EACjD,KAAA,EAAO,gBAAA;AAAA;AAAA,KAGG,kBAAA,yBACc,yBAAA,GAA4B,yBAAA,IAClD,aAAA,CAAc,eAAA;EAChB,KAAA,EAAO,UAAA,QADQ,KAAA,CAC0B,SAAA;AAAA;AAAA"}
@@ -1,22 +0,0 @@
1
- import * as unenv from "unenv";
2
- import { CreateEnvOptions } from "unenv";
3
- import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
4
-
5
- //#region src/types/plugin.d.ts
6
- type UnenvPluginOptions = Partial<CreateEnvOptions>;
7
- interface UnenvPluginUserConfig extends UserConfig {
8
- unenv: UnenvPluginOptions;
9
- }
10
- interface UnenvPluginResolvedConfig extends ResolvedConfig {
11
- unenv: CreateEnvOptions;
12
- }
13
- type UnenvPluginContext<TResolvedConfig extends UnenvPluginResolvedConfig = UnenvPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
14
- unenv: ReturnType<typeof unenv.defineEnv>;
15
- };
16
- declare type __ΩUnenvPluginOptions = any[];
17
- declare type __ΩUnenvPluginUserConfig = any[];
18
- declare type __ΩUnenvPluginResolvedConfig = any[];
19
- declare type __ΩUnenvPluginContext = any[];
20
- //#endregion
21
- export { UnenvPluginContext, UnenvPluginOptions, UnenvPluginResolvedConfig, UnenvPluginUserConfig, __ΩUnenvPluginContext, __ΩUnenvPluginOptions, __ΩUnenvPluginResolvedConfig, __ΩUnenvPluginUserConfig };
22
- //# sourceMappingURL=plugin.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;KAqBY,kBAAA,GAAqB,OAAA,CAAQ,gBAAA;AAAA,UAExB,qBAAA,SAA8B,UAAA;EAC7C,KAAA,EAAO,kBAAA;AAAA;AAAA,UAGQ,yBAAA,SAAkC,cAAA;EACjD,KAAA,EAAO,gBAAA;AAAA;AAAA,KAGG,kBAAA,yBACc,yBAAA,GAA4B,yBAAA,IAClD,aAAA,CAAc,eAAA;EAChB,KAAA,EAAO,UAAA,QADQ,KAAA,CAC0B,SAAA;AAAA;AAAA"}
@@ -1 +0,0 @@
1
- export { };