@open-pioneer/vite-plugin-pioneer 7.1.2 → 7.2.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog @open-pioneer/vite-plugin-pioneer
2
2
 
3
+ ## 7.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - fe47866: Support public assets of Trails packages.
8
+
9
+ A package lists its public asset directories under `publicAssets` in its `build.config.mjs`.
10
+
11
+ The development server serves these files on request, and the Vite build copies them into the output directory.
12
+
13
+ The new module `open-pioneer:assets` exports `publicAssetsUrl`, the root URL of the package's public assets, and `getPublicAssetUrl()`, which returns the URL of a specific asset.
14
+
15
+ ```js
16
+ import { getPublicAssetUrl } from "open-pioneer:assets";
17
+
18
+ const assetUrl = getPublicAssetUrl("icons/my-icon.png");
19
+ ```
20
+
21
+ The plugin also supports published packages with the package format version 1.2, which may define public assets of their own.
22
+
23
+ ### Patch Changes
24
+
25
+ - fe47866: Replace `oxc-resolver` for the Trails package lookup on dev server start with a simpler algorithm from `vitefu`.
26
+ - Updated dependencies [fe47866]
27
+ - @open-pioneer/build-common@5.2.0
28
+
3
29
  ## 7.1.2
4
30
 
5
31
  ### Patch Changes
package/client.d.ts CHANGED
@@ -124,6 +124,50 @@ declare module "open-pioneer:deployment" {
124
124
  export const baseUrl: string;
125
125
  }
126
126
 
127
+ /**
128
+ * Provides access to the current package's public asset files.
129
+ *
130
+ * Public assets are declared in the package's `build.config.mjs`.
131
+ * The build system ensures that public assets are copied over when building the application.
132
+ *
133
+ * This module computes the URLs to those assets at runtime, so they can be `fetch()`-ed or downloaded.
134
+ */
135
+ declare module "open-pioneer:assets" {
136
+ /**
137
+ * The URL of the root directory of this package's public assets.
138
+ *
139
+ * The URL always ends with a `/`.
140
+ * For example, in an app deployed at `https://example.com/`, the value might be
141
+ * `https://example.com/packages/<packageName>/`.
142
+ *
143
+ * The specific location in the final build output is an implementation detail.
144
+ * Always use this constant or {@link getPublicAssetUrl} to resolve public assets.
145
+ */
146
+ export const publicAssetsUrl: string;
147
+
148
+ /**
149
+ * Returns the fully resolved URL to the specified public asset file.
150
+ *
151
+ * For example:
152
+ *
153
+ * ```ts
154
+ * // in my-package/my-file.ts
155
+ * import { getPublicAssetUrl } from "open-pioneer:assets";
156
+ *
157
+ * // Public asset path local to this package. Should match the public asset declarations in `build.config.mjs`.
158
+ * const localPath = "icons/my-icon.png";
159
+ *
160
+ * // The fully resolved absolute URL to the asset. Can be used at development time and in production.
161
+ * const fileUrl = getPublicAssetUrl(localPath);
162
+ * console.log(fileUrl); // E.g. https://example.com/packages/my-package/icons/my-icon.png
163
+ * ```
164
+ *
165
+ * The specific location in the final build output is an implementation detail.
166
+ * Always use this function or {@link publicAssetsUrl} to resolve public assets.
167
+ */
168
+ export function getPublicAssetUrl(localAssetPath: string): string;
169
+ }
170
+
127
171
  /**
128
172
  * Provides test support helpers for the importing package, such as the actual i18n messages that would be used when running in a trails app.
129
173
  *