@unframework.dev/unplugin 0.1.2 → 0.1.3

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/assemble.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { composeJoinedMap, withLineStarts } from "@unframework.dev/codegen";
2
2
  import { parseModule } from "@unframework.dev/parser";
3
3
  import { Bundle, MagicString } from "magic-string";
4
- //#region src/assemble.ts
4
+ // src/assemble.ts
5
5
  const SCRIPT = /^\.tsx?$/;
6
6
  /**
7
7
  * The code for a module id: the one emitted file with the id's extension, or several script
@@ -129,5 +129,4 @@ function exportedNames(statement) {
129
129
  function moduleExportName(name) {
130
130
  return name.type === "Literal" ? name.value : name.name;
131
131
  }
132
- //#endregion
133
132
  export { assembleModule, joinModules };
package/dist/astro.d.ts CHANGED
@@ -1,11 +1,9 @@
1
1
  import { UnframeworkOptions } from "./plugin.js";
2
2
  import { AstroIntegration } from "astro";
3
- //#region src/astro.d.ts
4
3
  /** Options of the Astro integration: the plugin's, without the target, which it sets to Astro. */
5
4
  export type UnframeworkAstroOptions = Omit<UnframeworkOptions, "target">;
6
5
  /**
7
6
  * The unframework Astro integration: adds the Vite plugin with the Astro target, so an import of a
8
7
  * `.uf.tsx` file loads as an `.astro` component, which Astro's own plugin compiles.
9
8
  */
10
- export default function unframework(options?: UnframeworkAstroOptions): AstroIntegration;
11
- //#endregion
9
+ export default function unframework(options?: UnframeworkAstroOptions): AstroIntegration;
package/dist/astro.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import unframework$1 from "./vite.js";
2
2
  import { createDiagnostic, formatDiagnostic } from "@unframework.dev/diagnostics";
3
- //#region src/astro.ts
3
+ // src/astro.ts
4
4
  /**
5
5
  * The unframework Astro integration: adds the Vite plugin with the Astro target, so an import of a
6
6
  * `.uf.tsx` file loads as an `.astro` component, which Astro's own plugin compiles.
@@ -34,5 +34,4 @@ function unframework(options = {}) {
34
34
  }
35
35
  };
36
36
  }
37
- //#endregion
38
37
  export { unframework as default };
package/dist/bun.js CHANGED
@@ -1,2 +1 @@
1
- import { bun } from "./plugin.js";
2
- export { bun as default };
1
+ export { bun as default } from "./plugin.js";
package/dist/chain.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { chainMap } from "@unframework.dev/codegen";
2
- //#region src/chain.ts
2
+ // src/chain.ts
3
3
  /** Vite's name for the Svelte plugin's compile step. */
4
4
  const SVELTE_COMPILE = "vite-plugin-svelte:compile";
5
5
  /**
@@ -46,5 +46,4 @@ function chainQwikSegments(plugins, mapOf) {
46
46
  if (typeof hook === "function") qwik.load = load;
47
47
  else hook.handler = load;
48
48
  }
49
- //#endregion
50
49
  export { chainQwikSegments, chainSvelteOnce };
package/dist/detect.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { readFileSync, realpathSync, statSync } from "node:fs";
2
2
  import { createDiagnostic, formatDiagnostic } from "@unframework.dev/diagnostics";
3
- //#region src/detect.ts
3
+ // src/detect.ts
4
4
  /** The name plugin-vue registers. */
5
5
  const VUE_PLUGIN = "vite:vue";
6
6
  /** Whether a plugin of this name belongs to each framework a built-in target compiles to. */
@@ -113,5 +113,4 @@ function fillVueScriptFs(plugins) {
113
113
  }
114
114
  };
115
115
  }
116
- //#endregion
117
116
  export { NODE_SCRIPT_FS, detectTarget, fillVueScriptFs, hostOptionWarning };
package/dist/esbuild.js CHANGED
@@ -1,2 +1 @@
1
- import { esbuild } from "./plugin.js";
2
- export { esbuild as default };
1
+ export { esbuild as default } from "./plugin.js";
package/dist/farm.js CHANGED
@@ -1,2 +1 @@
1
- import { farm } from "./plugin.js";
2
- export { farm as default };
1
+ export { farm as default } from "./plugin.js";
package/dist/ids.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { TargetName } from "@unframework.dev/compiler";
2
2
  import { Target } from "@unframework.dev/codegen";
3
- //#region src/ids.d.ts
4
3
  /** The extension of an authored component file. */
5
4
  export declare const SOURCE_EXTENSION = ".uf.tsx";
6
5
  /**
@@ -59,5 +58,4 @@ export interface ModuleRequest {
59
58
  * The query is not part of the match, so `X.uf.tsx.vue?vue&type=style&index=0&lang.css` is
60
59
  * recognised; whether a query belongs to the plugin is the caller's decision.
61
60
  */
62
- export declare function parseModuleId(id: string, suffix: string): ModuleRequest | undefined;
63
- //#endregion
61
+ export declare function parseModuleId(id: string, suffix: string): ModuleRequest | undefined;
package/dist/ids.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { posix } from "node:path";
2
2
  import { TARGET_NAMES, builtinTargets } from "@unframework.dev/compiler";
3
- //#region src/ids.ts
3
+ // src/ids.ts
4
4
  /** The extension of an authored component file. */
5
5
  const SOURCE_EXTENSION = ".uf.tsx";
6
6
  const escapeRegExp = (text) => text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
@@ -176,5 +176,4 @@ function parseComponentId(id) {
176
176
  query: index === -1 ? "" : id.slice(index)
177
177
  };
178
178
  }
179
- //#endregion
180
179
  export { COMPONENT_ID_FILTER, COMPOSABLE_EXTENSION, COMPOSABLE_ID_SUFFIXES, ID_SUFFIXES, SCAN_ID_PREFIX, SOURCE_EXTENSION, componentId, composableFilter, composableId, composableIdSuffix, idSuffix, moduleId, moduleIdCandidates, moduleIdFilter, parseComponentId, parseComposableId, parseModuleId, specifierFilter };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { CompileEvent, PLUGIN_NAME, UnframeworkApi, UnframeworkOptions, unframeworkUnplugin } from "./plugin.js";
2
1
  import { COMPOSABLE_ID_SUFFIXES, ID_SUFFIXES, ModuleRequest, SCAN_ID_PREFIX, SOURCE_EXTENSION, composableId, composableIdSuffix, idSuffix, moduleId, parseComposableId, parseModuleId } from "./ids.js";
2
+ import { CompileEvent, PLUGIN_NAME, UnframeworkApi, UnframeworkOptions, unframeworkUnplugin } from "./plugin.js";
3
3
  export { COMPOSABLE_ID_SUFFIXES, type CompileEvent, ID_SUFFIXES, type ModuleRequest, PLUGIN_NAME, SCAN_ID_PREFIX, SOURCE_EXTENSION, type UnframeworkApi, type UnframeworkOptions, composableId, composableIdSuffix, idSuffix, moduleId, parseComposableId, parseModuleId, unframeworkUnplugin };
package/dist/plugin.d.ts CHANGED
@@ -2,7 +2,6 @@ import { CompilerPlugin, TargetName, UfModule } from "@unframework.dev/compiler"
2
2
  import { Diagnostic } from "@unframework.dev/diagnostics";
3
3
  import { UnpluginInstance } from "unplugin";
4
4
  import { OutputFile, Target } from "@unframework.dev/codegen";
5
- //#region src/plugin.d.ts
6
5
  /** What {@link UnframeworkOptions.onCompile} receives for every module it loads. */
7
6
  export interface CompileEvent {
8
7
  /** The module id, such as `/abs/Hello.uf.tsx.vue`. */
@@ -84,4 +83,4 @@ export declare const rsbuild: Instance["rsbuild"];
84
83
  export declare const rspack: Instance["rspack"];
85
84
  export declare const unloader: Instance["unloader"];
86
85
  export declare const webpack: Instance["webpack"];
87
- //#endregion
86
+ export {};
package/dist/plugin.js CHANGED
@@ -1,14 +1,14 @@
1
- import { COMPONENT_ID_FILTER, COMPOSABLE_EXTENSION, COMPOSABLE_ID_SUFFIXES, ID_SUFFIXES, SCAN_ID_PREFIX, SOURCE_EXTENSION, componentId, composableFilter, composableId, composableIdSuffix, idSuffix, moduleId, moduleIdCandidates, moduleIdFilter, parseComponentId, parseComposableId, parseModuleId, specifierFilter } from "./ids.js";
2
1
  import { assembleModule } from "./assemble.js";
3
2
  import { chainQwikSegments, chainSvelteOnce } from "./chain.js";
4
3
  import { detectTarget, fillVueScriptFs, hostOptionWarning } from "./detect.js";
4
+ import { COMPONENT_ID_FILTER, COMPOSABLE_EXTENSION, COMPOSABLE_ID_SUFFIXES, ID_SUFFIXES, SCAN_ID_PREFIX, SOURCE_EXTENSION, componentId, composableFilter, composableId, composableIdSuffix, idSuffix, moduleId, moduleIdCandidates, moduleIdFilter, parseComponentId, parseComposableId, parseModuleId, specifierFilter } from "./ids.js";
5
5
  import { basename, extname, isAbsolute, posix, relative, sep } from "node:path";
6
6
  import { checkPassThrough, createProject, createSyntacticOracle, resolveTarget } from "@unframework.dev/compiler";
7
7
  import { existsSync, readFileSync } from "node:fs";
8
8
  import { readFile } from "node:fs/promises";
9
9
  import { formatDiagnostic, formatDiagnostics } from "@unframework.dev/diagnostics";
10
10
  import { createUnplugin } from "unplugin";
11
- //#region src/plugin.ts
11
+ // src/plugin.ts
12
12
  /** A Qwik optimizer segment of a module: `<module id>_<symbol>.js`, its symbol a name. */
13
13
  const SEGMENT = /^(.+\.uf\.tsx(?:\.[^/_]+)?)_[\w$]+\.js$/;
14
14
  /** The name of the pre plugin, by which other plugins find its {@link UnframeworkApi}. */
@@ -854,5 +854,4 @@ const rsbuild = unframeworkUnplugin.rsbuild;
854
854
  const rspack = unframeworkUnplugin.rspack;
855
855
  const unloader = unframeworkUnplugin.unloader;
856
856
  const webpack = unframeworkUnplugin.webpack;
857
- //#endregion
858
857
  export { PLUGIN_NAME, bun, esbuild, farm, rolldown, rollup, rsbuild, rspack, unframeworkUnplugin, unloader, webpack };
package/dist/rolldown.js CHANGED
@@ -1,2 +1 @@
1
- import { rolldown } from "./plugin.js";
2
- export { rolldown as default };
1
+ export { rolldown as default } from "./plugin.js";
package/dist/rollup.js CHANGED
@@ -1,2 +1 @@
1
- import { rollup } from "./plugin.js";
2
- export { rollup as default };
1
+ export { rollup as default } from "./plugin.js";
package/dist/rsbuild.js CHANGED
@@ -1,2 +1 @@
1
- import { rsbuild } from "./plugin.js";
2
- export { rsbuild as default };
1
+ export { rsbuild as default } from "./plugin.js";
package/dist/rspack.js CHANGED
@@ -1,2 +1 @@
1
- import { rspack } from "./plugin.js";
2
- export { rspack as default };
1
+ export { rspack as default } from "./plugin.js";
package/dist/unloader.js CHANGED
@@ -1,2 +1 @@
1
- import { unloader } from "./plugin.js";
2
- export { unloader as default };
1
+ export { unloader as default } from "./plugin.js";
package/dist/vite.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { CompileEvent, UnframeworkApi, UnframeworkOptions } from "./plugin.js";
2
2
  import { Plugin } from "vite";
3
- //#region src/vite.d.ts
4
3
  /**
5
4
  * The unframework Vite plugin: imports of `.uf.tsx` files load as the target's source, under ids
6
5
  * that the framework's own plugin claims. Returns `[pre, post]`: `pre` resolves and compiles;
@@ -8,5 +7,4 @@ import { Plugin } from "vite";
8
7
  * the framework's plugins. With no `target`, the framework's plugin decides it (ADR-0075).
9
8
  */
10
9
  export default function unframework(options?: UnframeworkOptions): Plugin[];
11
- //#endregion
12
10
  export type { CompileEvent, UnframeworkApi, UnframeworkOptions };
package/dist/vite.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { unframeworkUnplugin } from "./plugin.js";
2
- //#region src/vite.ts
2
+ // src/vite.ts
3
3
  /**
4
4
  * The unframework Vite plugin: imports of `.uf.tsx` files load as the target's source, under ids
5
5
  * that the framework's own plugin claims. Returns `[pre, post]`: `pre` resolves and compiles;
@@ -9,5 +9,4 @@ import { unframeworkUnplugin } from "./plugin.js";
9
9
  function unframework(options) {
10
10
  return unframeworkUnplugin.vite(options);
11
11
  }
12
- //#endregion
13
12
  export { unframework as default };
package/dist/webpack.js CHANGED
@@ -1,2 +1 @@
1
- import { webpack } from "./plugin.js";
2
- export { webpack as default };
1
+ export { webpack as default } from "./plugin.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unframework.dev/unplugin",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "The Unframework bundler plugin: imports of .uf.tsx files compile to the selected framework, and that framework's own plugin finishes the job.",
5
5
  "keywords": [
6
6
  "astro",
@@ -11,7 +11,7 @@
11
11
  "vite",
12
12
  "webpack"
13
13
  ],
14
- "homepage": "https://github.com/uxfront-com/unframework/tree/main/packages/unplugin#readme",
14
+ "homepage": "https://unframework.dev",
15
15
  "bugs": "https://github.com/uxfront-com/unframework/issues",
16
16
  "license": "MIT",
17
17
  "repository": {
@@ -79,29 +79,29 @@
79
79
  "access": "public"
80
80
  },
81
81
  "dependencies": {
82
- "@unframework.dev/codegen": "0.1.1",
83
- "@unframework.dev/compiler": "0.2.1",
84
- "@unframework.dev/diagnostics": "0.1.0",
85
- "@unframework.dev/parser": "0.1.0",
82
+ "@unframework.dev/codegen": "0.1.2",
83
+ "@unframework.dev/compiler": "0.2.2",
84
+ "@unframework.dev/diagnostics": "0.1.1",
85
+ "@unframework.dev/parser": "0.1.1",
86
86
  "magic-string": "^1.4.2",
87
87
  "unplugin": "^3.4.0"
88
88
  },
89
89
  "devDependencies": {
90
90
  "@qwik.dev/core": "2.0.0-beta.47",
91
91
  "@types/node": "^24.19.0",
92
- "@unframework.dev/target-angular": "0.1.1",
93
- "@unframework.dev/target-qwik": "0.1.1",
94
- "@unframework.dev/target-react": "0.1.1",
95
- "@unframework.dev/target-solid": "0.1.1",
96
- "@unframework.dev/target-svelte": "0.1.1",
97
- "@unframework.dev/target-vue": "0.1.1",
92
+ "@unframework.dev/target-angular": "0.1.2",
93
+ "@unframework.dev/target-qwik": "0.1.2",
94
+ "@unframework.dev/target-react": "0.1.2",
95
+ "@unframework.dev/target-solid": "0.1.2",
96
+ "@unframework.dev/target-svelte": "0.1.2",
97
+ "@unframework.dev/target-vue": "0.1.2",
98
98
  "@uxfront/typescript-config": "^0.1.0",
99
99
  "astro": "7.3.5",
100
100
  "react": "19.3.0",
101
101
  "react-dom": "19.3.0",
102
102
  "solid-js": "1.9.15",
103
103
  "svelte": "5.57.1",
104
- "tsdown": "^0.23.0",
104
+ "tsdown": "^0.23.7",
105
105
  "vite": "8.3.1",
106
106
  "vite-plugin-solid": "2.11.14",
107
107
  "vitest": "5.0.3",