Skip to content

Commit

Permalink
chore: update schema-record to stable, add better release log for error
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Jan 15, 2025
1 parent 0a6b7e0 commit 417ba49
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/schema-record/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@warp-drive/schema-record",
"version": "0.0.0-alpha.113",
"version": "5.4.0-alpha.127",
"description": "Schema Driven Resource Presentation for WarpDrive and EmberData",
"keywords": [
"ember-addon"
Expand Down
2 changes: 1 addition & 1 deletion release/strategy.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"mirrorPublish": false
},
"@warp-drive/schema-record": {
"stage": "alpha",
"stage": "stable",
"types": "alpha",
"typesPublish": false,
"mirrorPublish": true
Expand Down
9 changes: 7 additions & 2 deletions release/utils/json-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,15 @@ export class JSONFile<T extends object = Record<string, unknown>> {
this.contents = null;
}

async read(): Promise<T> {
async read(logRaw: boolean = false): Promise<T> {
if (this.contents === null) {
const fileHandle = await this.#getHandle();
const data = await fileHandle.json<T>();
const data = await fileHandle.json<T>().catch(async (e) => {
console.log(e);
const strData = await fileHandle.text();
console.log(strData);
throw e;
});
this.contents = data;
this.#lastKnown = JSON.stringify(data, null, 2);
}
Expand Down
2 changes: 1 addition & 1 deletion release/utils/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class Package {

async refresh() {
await this.file.invalidate();
this.pkgData = await this.file.read();
this.pkgData = await this.file.read(true);
}
}

Expand Down

0 comments on commit 417ba49

Please sign in to comment.