Skip to content

Commit

Permalink
fix: bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulrahman1s committed May 28, 2022
1 parent 70a8804 commit 4d54aab
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 52 deletions.
90 changes: 45 additions & 45 deletions scripts/build_npm.ts
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
import { build, emptyDir } from 'https://deno.land/x/[email protected]/mod.ts';

if (!Deno.args[0]) {
console.log('Missing version');
Deno.exit();
console.log('Missing version');
Deno.exit();
}

await emptyDir('./npm');

await build({
packageManager: 'pnpm',
scriptModule: false,
entryPoints: ['./mod.ts'],
outDir: './npm',
shims: {
custom: [{
package: {
name: 'node-fetch',
version: '^3.2.4',
},
typesPackage: {
name: '@types/node',
version: '^16.x',
},
globalNames: [{
name: 'fetch',
exportName: 'default',
}, {
name: 'Request',
typeOnly: true,
}, {
name: 'Response',
}],
}],
packageManager: 'pnpm',
scriptModule: false,
entryPoints: ['./mod.ts'],
outDir: './npm',
shims: {
custom: [{
package: {
name: 'node-fetch',
version: '^3.2.4',
},
typesPackage: {
name: '@types/node',
version: '^16.x',
},
globalNames: [{
name: 'fetch',
exportName: 'default',
}, {
name: 'Request',
typeOnly: true,
}, {
name: 'Response',
}],
}],
},
package: {
name: '@revoltio/rest',
version: Deno.args[0],
description: 'REST module for revolt.io',
license: 'Apache-2',
repository: {
type: 'git',
url: 'git+https://github.com/revolt-io/rest.git',
},
package: {
name: '@revoltio/rest',
version: Deno.args[0],
description: 'REST module for revolt.io',
license: 'Apache-2',
repository: {
type: 'git',
url: 'git+https://github.com/revolt-io/rest.git',
},
bugs: {
url: 'https://github.com/revolt-io/rest/issues',
},
engines: {
node: ">=16.6.0"
},
files: [
"esm/*",
"types/*"
],
bugs: {
url: 'https://github.com/revolt-io/rest/issues',
},
engines: {
node: '>=16.6.0',
},
files: [
'esm/*',
'types/*',
],
},
});

Deno.copyFileSync('LICENSE', 'npm/LICENSE');
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ for (const [path, methods] of Object.entries(OpenAPI.paths!)) {
const schema = data.responses['200']?.content?.['application/json']?.schema;
const typedResponse = getType(schema);
const typedPath = path.replace(
/\{(target|id|code|role_id|member|msg|server)\}/g,
/\{(target|id|code|role_id|member|msg|server|message|username|_target)\}/g,
'${string}',
);

Expand Down
4 changes: 2 additions & 2 deletions src/errors/RateLimitError.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// TODO:
export class RateLimitError extends Error {}
// TODO:
export class RateLimitError extends Error {}
2 changes: 1 addition & 1 deletion src/errors/mod.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './HTTPError.ts';
export * from './RateLimitError.ts'
export * from './RateLimitError.ts';
6 changes: 3 additions & 3 deletions src/types/routes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ export type Routes = {
method: 'GET';
response: { users: string[]; servers: string[] };
} | {
path: `/users/{username}/friend`;
path: `/users/${string}/friend`;
method: 'PUT';
response: {
_id: string;
Expand Down Expand Up @@ -1094,7 +1094,7 @@ export type Routes = {
}[];
};
} | {
path: `/channels/${string}/ack/{message}`;
path: `/channels/${string}/ack/${string}`;
method: 'PUT';
response: undefined;
} | {
Expand Down Expand Up @@ -2125,7 +2125,7 @@ export type Routes = {
}[];
};
} | {
path: `/channels/{_target}/messages/stale`;
path: `/channels/${string}/messages/stale`;
method: 'POST';
response: undefined;
} | {
Expand Down

0 comments on commit 4d54aab

Please sign in to comment.