Skip to content

Commit 74f0f05

Browse files
committed
Merge branch 'master' of https://github.com/appwrite/sdk-generator into feat-warn-response-format
2 parents 4c30b8f + af7e4b5 commit 74f0f05

File tree

7 files changed

+34
-32
lines changed

7 files changed

+34
-32
lines changed

src/SDK/Language/Node.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ public function getFiles(): array
229229
],
230230
[
231231
'scope' => 'default',
232-
'destination' => 'tsup.config.js',
233-
'template' => 'node/tsup.config.js.twig',
232+
'destination' => 'tsup.config.ts',
233+
'template' => 'node/tsup.config.ts.twig',
234234
],
235235
[
236236
'scope' => 'default',

templates/node/package.json.twig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
}
3232
}
3333
},
34+
"files": [
35+
"dist"
36+
],
3437
"module": "dist/index.mjs",
3538
"types": "dist/index.d.ts",
3639
"repository": {
@@ -40,6 +43,7 @@
4043
"devDependencies": {
4144
"@types/node": "20.11.25",
4245
"tsup": "7.2.0",
46+
"esbuild-plugin-file-path-extensions": "^2.0.0",
4347
"tslib": "2.6.2",
4448
"typescript": "5.4.2"
4549
},

templates/node/tsup.config.js.twig

Lines changed: 0 additions & 19 deletions
This file was deleted.

templates/node/tsup.config.ts.twig

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { defineConfig, type Options } from "tsup";
2+
import { esbuildPluginFilePathExtensions } from "esbuild-plugin-file-path-extensions";
3+
4+
const commonConfig: Options = {
5+
sourcemap: true,
6+
clean: true,
7+
dts: true,
8+
treeshake: true,
9+
target: "node16",
10+
entry: ["src/**/*.ts"],
11+
outDir: "dist",
12+
};
13+
14+
export default defineConfig([
15+
{
16+
...commonConfig,
17+
format: "esm",
18+
esbuildPlugins: [esbuildPluginFilePathExtensions({ filter: /^\./ })],
19+
bundle: true,
20+
// Yes, bundle: true => https://github.com/favware/esbuild-plugin-file-path-extensions?tab=readme-ov-file#usage
21+
},
22+
{
23+
...commonConfig,
24+
format: "cjs",
25+
bundle: false,
26+
},
27+
]);

templates/web/package.json.twig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@
3232
"tslib": "2.4.0",
3333
"typescript": "4.7.2"
3434
},
35-
"dependencies": {
36-
"cross-fetch": "3.1.5",
37-
"isomorphic-form-data": "2.0.0"
38-
},
3935
"jsdelivr": "dist/iife/sdk.js",
4036
"unpkg": "dist/iife/sdk.js"
4137
}

templates/web/rollup.config.js.twig

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import pkg from "./package.json";
22
import typescript from "@rollup/plugin-typescript";
33

44
export default {
5-
external: Object.keys(pkg.dependencies),
5+
external: Object.keys(pkg.dependencies ?? {}),
66
input: "src/index.ts",
77
plugins: [typescript()],
88
output: [
@@ -22,10 +22,6 @@ export default {
2222
file: pkg.jsdelivr,
2323
name: "Appwrite",
2424
extend: true,
25-
globals: {
26-
"cross-fetch": "window",
27-
"FormData": "FormData",
28-
},
2925
},
3026
],
3127
};

templates/web/src/client.ts.twig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import 'isomorphic-form-data';
2-
import { fetch } from 'cross-fetch';
31
import { Models } from './models';
42
import { Service } from './service';
53

0 commit comments

Comments
 (0)