Skip to content

Commit e031dfd

Browse files
committed
Fixed build bugs. Moved uuid to dependency. Fixed entry points that were messed up. Improved error handling for documents endpoint
1 parent 2cf0b95 commit e031dfd

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ $ npm install -g codify
1818
$ codify COMMAND
1919
running command...
2020
$ codify (--version)
21-
codify/0.9.0 darwin-arm64 node-v20.15.1
21+
codify/0.9.0 darwin-arm64 node-v20.19.5
2222
$ codify --help [COMMAND]
2323
USAGE
2424
$ codify COMMAND

esbuild.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { build } from 'esbuild';
22

33
const result = await build({
4-
entryPoints: ['src/handlers/**/router.ts', 'src/handlers/*.ts', 'src/router.ts'],
4+
entryPoints: ['src/commands/**/index.ts', 'src/commands/*.ts', 'src/index.ts'],
55
bundle: true,
66
minify: true,
77
splitting: true,

package-lock.json

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
"semver": "^7.5.4",
4343
"socket.io": "^4.8.1",
4444
"supports-color": "^9.4.0",
45-
"ws": "^8.18.3"
45+
"ws": "^8.18.3",
46+
"uuid": "^10.0.0"
4647
},
4748
"description": "Codify allows users to configure settings, install new packages, and automate their systems using code instead of the GUI. Get set up on a new laptop in one click, maintain a Codify file within your project so anyone can get started and never lose your cool apps or favourite settings again.",
4849
"devDependencies": {
@@ -79,7 +80,6 @@
7980
"strip-ansi": "^7.1.0",
8081
"tsx": "^4.7.3",
8182
"typescript": "5.3.3",
82-
"uuid": "^10.0.0",
8383
"vitest": "^2.1.6"
8484
},
8585
"overrides": {

src/api/dashboard/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ export const DashboardApiClient = {
1515
{ method: 'GET', headers: { 'Content-Type': 'application/json', 'authorization': login.accessToken } },
1616
);
1717

18-
const json = await res.json();
1918
if (!res.ok) {
20-
throw new Error(JSON.stringify(json, null, 2));
19+
throw new Error(`Error fetching document: ${res.statusText}`);
2120
}
2221

22+
const json = await res.json();
23+
2324
return json;
2425
},
2526

src/connect/http-routes/handlers/create-command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,4 @@ export function createCommandHandler(command: ConnectCommand): Router {
101101
});
102102

103103
return router;
104-
}
104+
}

src/parser/reader/cloud-reader.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import { FileType, InMemoryFile } from '../entities.js';
33
import { Reader } from './index.js';
44

55
export class CloudReader implements Reader {
6-
async read(filePath: string): Promise<InMemoryFile> {
7-
const document = await DashboardApiClient.getDocument(filePath);
6+
async read(filePath: string): Promise<InMemoryFile> {
7+
const document = await DashboardApiClient.getDocument(filePath);
88

9-
return {
10-
contents: JSON.stringify(document.contents),
11-
filePath,
12-
fileType: FileType.CLOUD,
13-
}
9+
return {
10+
contents: JSON.stringify(document.contents),
11+
filePath,
12+
fileType: FileType.CLOUD,
1413
}
14+
}
1515

1616
}

0 commit comments

Comments
 (0)