@riebeckite/plugin-deploy 0.0.16 → 0.0.18

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/README.md CHANGED
@@ -23,7 +23,6 @@ export default defineConfig({
23
23
  plugins: [
24
24
  deployPlugin({
25
25
  provider: ["cloudflare-pages", "github-pages"],
26
- baseUrl: "https://example.com",
27
26
  cname: "example.com",
28
27
  headers: { "X-Frame-Options": "DENY" },
29
28
  }),
@@ -65,5 +64,5 @@ skipped because the root cannot be stubbed.
65
64
 
66
65
  ## See also
67
66
 
68
- - [Plugin guide](../../../docs/en/docs/reference/plugin-api.md)
67
+ - [Plugin guide](../../../docs/docs/reference/plugin-api.en.md)
69
68
 
package/README_ja.md CHANGED
@@ -22,7 +22,6 @@ export default defineConfig({
22
22
  plugins: [
23
23
  deployPlugin({
24
24
  provider: ["cloudflare-pages", "github-pages"],
25
- baseUrl: "https://example.com",
26
25
  cname: "example.com",
27
26
  headers: { "X-Frame-Options": "DENY" },
28
27
  }),
@@ -64,4 +63,4 @@ GitHub Pages には `_redirects` 構文がないため、各リダイレクト
64
63
 
65
64
  ## 関連リンク
66
65
 
67
- - [プラグイン API](../../../docs/ja/docs/reference/plugin-api.md)
66
+ - [プラグイン API](../../../docs/docs/reference/plugin-api.md)
package/dist/index.js CHANGED
@@ -167,7 +167,7 @@ function planDeployOutputs(args) {
167
167
  for (const redirect of redirects) {
168
168
  const path = redirectStubPath(redirect.from);
169
169
  if (path === null) continue;
170
- add(path, renderRedirectStubFor(redirect, options?.baseUrl));
170
+ add(path, renderRedirectStubFor(redirect, args.baseUrl));
171
171
  }
172
172
  break;
173
173
  }
@@ -222,7 +222,7 @@ function deployPlugin(options) {
222
222
  return definePlugin({
223
223
  name: PLUGIN_NAME,
224
224
  options,
225
- onBuildEnd(context) {
225
+ buildEnd(context) {
226
226
  const redirects = resolvePublicRedirects(
227
227
  context.manifest,
228
228
  context.diagnostics
@@ -230,7 +230,12 @@ function deployPlugin(options) {
230
230
  const providers = Array.isArray(options.provider) ? options.provider : [options.provider];
231
231
  const outputs = mergePlannedOutputs(
232
232
  providers.map(
233
- (provider) => planDeployOutputs({ provider, redirects, options })
233
+ (provider) => planDeployOutputs({
234
+ provider,
235
+ redirects,
236
+ options,
237
+ baseUrl: context.config?.site.baseUrl
238
+ })
234
239
  )
235
240
  );
236
241
  for (const entry of outputs) {
@@ -22,6 +22,7 @@ export declare function planDeployOutputs(args: {
22
22
  provider: DeployProvider;
23
23
  redirects: readonly PublicRedirect[];
24
24
  options?: DeployOptions;
25
+ baseUrl?: string;
25
26
  }): DeployOutput[];
26
27
  /**
27
28
  * Merges the planned outputs of several providers. Identical files collapse to
@@ -17,8 +17,6 @@ export type PublicRedirect = {
17
17
  export type DeployOptions = {
18
18
  /** One or more deploy targets to prepare files for. */
19
19
  provider: DeployProvider | DeployProvider[];
20
- /** Absolute site origin used when an absolute canonical URL is required. */
21
- baseUrl?: string;
22
20
  /** Vercel `trailingSlash` preference. */
23
21
  trailingSlash?: "always" | "never";
24
22
  /** Additional hosting headers, rendered per provider when supported. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riebeckite/plugin-deploy",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -14,7 +14,7 @@
14
14
  }
15
15
  },
16
16
  "dependencies": {
17
- "@riebeckite/core": "0.0.16"
17
+ "@riebeckite/core": "0.0.18"
18
18
  },
19
19
  "devDependencies": {
20
20
  "tsx": "^4.22.4"