Skip to content

Commit

Permalink
Fix demo CSV paths
Browse files Browse the repository at this point in the history
Fix pastec status endpoints
Update TypeScript from 5.3 to to 5.4
  • Loading branch information
bperel committed Mar 9, 2024
1 parent 8938bd6 commit d2be04b
Show file tree
Hide file tree
Showing 14 changed files with 283 additions and 258 deletions.
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"histoire": "^0.17.9",
"prettier": "^3.2.5",
"sass": "^1.71.1",
"typescript": "^5.3.3",
"typescript": "^5.4.2",
"typescript-eslint": "^7.1.0",
"unplugin-auto-import": "^0.17.5",
"unplugin-icons": "^0.18.5",
Expand Down
204 changes: 102 additions & 102 deletions apps/web/pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/whattheduck-ionic
Submodule whattheduck-ionic updated 57 files
+4 −2 .env
+1 −0 .nvmrc
+1 −1 android/app/build.gradle
+0 −1 android/app/capacitor.build.gradle
+1 −1 android/app/src/main/java/net/ducksmanager/whattheduck/MainActivity.java
+1 −1 android/build.gradle
+10 −13 android/capacitor.settings.gradle
+2 −1 android/gradle/wrapper/gradle-wrapper.properties
+7 −7 android/variables.gradle
+0 −15 capacitor.config.json
+1 −1 ionic.config.json
+4 −2 ios/App/App.xcodeproj/project.pbxproj
+12 −13 ios/App/Podfile
+43 −64 ios/App/Podfile.lock
+35 −45 package.json
+1,035 −1,214 pnpm-lock.yaml
+0 −5 public/assets/databases/databases.json
+ public/assets/sql-wasm.wasm
+41 −45 src/App.vue
+7 −0 src/components/Country.vue
+41 −37 src/components/List.vue
+1 −1 src/components/NavigationDrawer.vue
+3 −3 src/components/OwnedIssueCopy.vue
+2 −2 src/components/PurchaseGraph.vue
+27 −0 src/composables/usePersistedData.ts
+4 −52 src/main.ts
+0 −50 src/persistence/data-sources/db.ts
+0 −5 src/persistence/database.ts
+0 −12 src/persistence/models/coa/InducksCountryname.ts
+0 −17 src/persistence/models/coa/InducksIssueWithCoverUrl.ts
+0 −17 src/persistence/models/coa/InducksIssuequotation.ts
+0 −11 src/persistence/models/coa/InducksPerson.ts
+0 −11 src/persistence/models/coa/InducksPublication.ts
+0 −17 src/persistence/models/coa/InducksStory.ts
+0 −20 src/persistence/models/composite/SuggestedIssueSimple.ts
+0 −11 src/persistence/models/dm/AuthorUser.ts
+0 −12 src/persistence/models/dm/ContributionTotalPoints.ts
+0 −35 src/persistence/models/dm/Issue.ts
+0 −17 src/persistence/models/dm/IssuePopularity.ts
+0 −8 src/persistence/models/dm/NotificationCountry.ts
+0 −14 src/persistence/models/dm/Purchase.ts
+0 −11 src/persistence/models/dm/User.ts
+0 −10 src/persistence/models/internal/HttpCache.ts
+0 −10 src/persistence/models/internal/Sync.ts
+0 −6 src/router/index.ts
+26 −12 src/stores/app.ts
+27 −11 src/stores/wtdcollection.ts
+22 −22 src/views/AddFromCamera.vue
+2 −1 src/views/Authors.vue
+0 −6 src/views/CountryList.vue
+0 −1 src/views/IssueList.vue
+5 −7 src/views/Login.vue
+4 −3 src/views/Logout.vue
+0 −183 src/views/RecentIssueList.vue
+3 −2 src/views/Search.vue
+1 −5 src/views/Signup.vue
+1 −1 vite.config.ts
4 changes: 2 additions & 2 deletions packages/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ const httpServer = createServer(async (req, res) => {
data = await getDbStatus()
break;
case '/status/pastecsearch':
data = await getPastecStatus()
data = await getPastecSearchStatus()
break;
case '/status/pastec':
data = await getPastecSearchStatus()
data = await getPastecStatus()
default:
res.writeHead(404);
res.end();
Expand Down
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"ts-node": "^10.9.2",
"tsc-alias": "^1.8.8",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.3.3",
"typescript": "^5.4.2",
"typescript-eslint": "^7.1.0"
}
}
66 changes: 33 additions & 33 deletions packages/api/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions packages/api/services/collection/issues/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { parse } from "csv-parse/sync";
import { readFileSync } from "fs";
import { existsSync, readFileSync } from "fs";
import { cwd } from "process";
import { Socket } from "socket.io";

import { TransactionResults } from "~dm-types/TransactionResults";
Expand Down Expand Up @@ -272,6 +273,8 @@ export const resetDemo = async () => {
return;
}

const csvPath = existsSync("/app/services/demo_issues.csv") ? "/app/services/": cwd() + "/services/";

demo.lastReset = new Date();
await prismaDm.demo.update({
data: demo,
Expand All @@ -293,8 +296,11 @@ export const resetDemo = async () => {
issuenumber: string;
}

const currentDir = process.cwd();
console.log(currentDir)

const csvIssues: CsvIssue[] = parse(
readFileSync("/app/routes/demo/demo_issues.csv"),
readFileSync(`${csvPath}demo_issues.csv`),
{ columns: true }
);
await prismaDm.$transaction(
Expand All @@ -320,7 +326,7 @@ export const resetDemo = async () => {
}

const csvPurchases: CsvPurchase[] = parse(
readFileSync("/app/routes/demo/demo_purchases.csv"),
readFileSync(`${csvPath}demo_purchases.csv`),
{ columns: true }
);
await prismaDm.$transaction(
Expand Down
Loading

0 comments on commit d2be04b

Please sign in to comment.