@mastra/deployer-netlify 0.1.0-alpha.53 → 0.1.0-alpha.55

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,23 @@
1
1
  # @mastra/deployer-netlify
2
2
 
3
+ ## 0.1.0-alpha.55
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [a9345f9]
8
+ - @mastra/core@0.2.0-alpha.102
9
+ - @mastra/deployer@0.1.0-alpha.52
10
+
11
+ ## 0.1.0-alpha.54
12
+
13
+ ### Patch Changes
14
+
15
+ - 4f1d1a1: Enforce types ann cleanup package.json
16
+ - Updated dependencies [66a03ec]
17
+ - Updated dependencies [4f1d1a1]
18
+ - @mastra/core@0.2.0-alpha.101
19
+ - @mastra/deployer@0.1.0-alpha.51
20
+
3
21
  ## 0.1.0-alpha.53
4
22
 
5
23
  ### Patch Changes
@@ -0,0 +1,38 @@
1
+ import { Deployer } from '@mastra/deployer';
2
+
3
+ export declare function getOrCreateSite({ token, name, scope }: {
4
+ token: string;
5
+ name: string;
6
+ scope: string;
7
+ }): Promise<{
8
+ id: string | undefined;
9
+ name: string | undefined;
10
+ url: string | undefined;
11
+ adminUrl: string | undefined;
12
+ } | {
13
+ id: string;
14
+ name: string;
15
+ ssl_url: string;
16
+ url: string;
17
+ admin_url: string;
18
+ }>;
19
+
20
+ export declare class NetlifyDeployer extends Deployer {
21
+ protected scope: string;
22
+ protected projectName: string;
23
+ protected token: string;
24
+ constructor({ scope, projectName, token }: {
25
+ scope: string;
26
+ projectName: string;
27
+ token: string;
28
+ });
29
+ writeFiles({ dir }: {
30
+ dir: string;
31
+ }): void;
32
+ deploy(outputDirectory: string): Promise<void>;
33
+ prepare(outputDirectory: string): Promise<void>;
34
+ bundle(entryFile: string, outputDirectory: string): Promise<void>;
35
+ private getEntry;
36
+ }
37
+
38
+ export { }
package/dist/index.d.ts CHANGED
@@ -1,21 +1 @@
1
- import { Deployer } from '@mastra/deployer';
2
-
3
- declare class NetlifyDeployer extends Deployer {
4
- protected scope: string;
5
- protected projectName: string;
6
- protected token: string;
7
- constructor({ scope, projectName, token }: {
8
- scope: string;
9
- projectName: string;
10
- token: string;
11
- });
12
- writeFiles({ dir }: {
13
- dir: string;
14
- }): void;
15
- deploy(outputDirectory: string): Promise<void>;
16
- prepare(outputDirectory: string): Promise<void>;
17
- bundle(entryFile: string, outputDirectory: string): Promise<void>;
18
- private getEntry;
19
- }
20
-
21
- export { NetlifyDeployer };
1
+ export { NetlifyDeployer } from './_tsup-dts-rollup.js';
package/dist/index.js CHANGED
@@ -41,7 +41,7 @@ async function findNetlifySite({ token, name, scope }) {
41
41
  }
42
42
  });
43
43
  const data = await response.json();
44
- if (!response.ok) {
44
+ if (!response.ok || !Array.isArray(data)) {
45
45
  throw new Error(`Failed to search sites: ${data.message || "Unknown error"}`);
46
46
  }
47
47
  return data.find((site) => site.name === name);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/deployer-netlify",
3
- "version": "0.1.0-alpha.53",
3
+ "version": "0.1.0-alpha.55",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -18,23 +18,20 @@
18
18
  "dependencies": {
19
19
  "@rollup/plugin-virtual": "^3.0.2",
20
20
  "date-fns": "^4.1.0",
21
- "dotenv": "^16.3.1",
22
21
  "execa": "^9.3.1",
23
22
  "netlify-cli": "^18.0.1",
24
23
  "zod": "^3.24.1",
25
- "@mastra/core": "^0.2.0-alpha.100",
26
- "@mastra/deployer": "^0.1.0-alpha.50"
24
+ "@mastra/core": "^0.2.0-alpha.102",
25
+ "@mastra/deployer": "^0.1.0-alpha.52"
27
26
  },
28
27
  "devDependencies": {
29
- "@babel/preset-env": "^7.26.0",
30
- "@babel/preset-typescript": "^7.26.0",
31
- "@tsconfig/recommended": "^1.0.7",
32
- "@types/node": "^22.9.0",
28
+ "@microsoft/api-extractor": "^7.49.2",
29
+ "@types/node": "^22.13.1",
33
30
  "tsup": "^8.0.1",
34
31
  "vitest": "^3.0.4"
35
32
  },
36
33
  "scripts": {
37
- "build": "tsup src/index.ts --format esm --dts --clean --treeshake",
34
+ "build": "tsup src/index.ts --format esm --experimental-dts --clean --treeshake",
38
35
  "build:watch": "pnpm build --watch",
39
36
  "test": "vitest run"
40
37
  }
package/src/helpers.ts CHANGED
@@ -12,7 +12,16 @@ async function createNetlifySite({ token, name, scope }: { token: string; name:
12
12
  }),
13
13
  });
14
14
 
15
- const data = await response.json();
15
+ const data = (await response.json()) as
16
+ | {
17
+ id: string;
18
+ name: string;
19
+ ssl_url: string;
20
+ url: string;
21
+ admin_url: string;
22
+ message?: never;
23
+ }
24
+ | { message: string; id?: never; name?: never; ssl_url?: never; url?: never; admin_url?: never };
16
25
 
17
26
  if (!response.ok) {
18
27
  console.error(JSON.stringify(data));
@@ -35,14 +44,22 @@ async function findNetlifySite({ token, name, scope }: { token: string; name: st
35
44
  },
36
45
  });
37
46
 
38
- const data = await response.json();
47
+ const data = (await response.json()) as
48
+ | {
49
+ id: string;
50
+ name: string;
51
+ ssl_url: string;
52
+ url: string;
53
+ admin_url: string;
54
+ }[]
55
+ | { message: string };
39
56
 
40
- if (!response.ok) {
41
- throw new Error(`Failed to search sites: ${data.message || 'Unknown error'}`);
57
+ if (!response.ok || !Array.isArray(data)) {
58
+ throw new Error(`Failed to search sites: ${(data as { message: string }).message || 'Unknown error'}`);
42
59
  }
43
60
 
44
61
  // Find exact match (filter can return partial matches)
45
- return data.find((site: any) => site.name === name);
62
+ return data.find(site => site.name === name);
46
63
  }
47
64
 
48
65
  export async function getOrCreateSite({ token, name, scope }: { token: string; name: string; scope: string }) {
package/src/index.ts CHANGED
@@ -42,6 +42,7 @@ to = "/.netlify/functions/api/:splat"
42
42
  async deploy(outputDirectory: string): Promise<void> {
43
43
  const site = await getOrCreateSite({ token: this.token, name: this.projectName || `mastra`, scope: this.scope });
44
44
 
45
+ // @ts-expect-error - seems to be fine
45
46
  const p2 = execa(
46
47
  'npx',
47
48
  [