diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest b/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest
index e9b129701a..ecf07831c5 100644
--- a/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest
+++ b/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest
@@ -5,13 +5,13 @@ waspBuild/.wasp/build/db/schema.prisma
waspBuild/.wasp/build/installedFullStackNpmDependencies.json
waspBuild/.wasp/build/server/.npmrc
waspBuild/.wasp/build/server/README.md
+waspBuild/.wasp/build/server/nodemon.json
waspBuild/.wasp/build/server/package.json
waspBuild/.wasp/build/server/src/app.js
waspBuild/.wasp/build/server/src/config.js
waspBuild/.wasp/build/server/src/core/AuthError.js
waspBuild/.wasp/build/server/src/core/HttpError.js
waspBuild/.wasp/build/server/src/dbClient.js
-waspBuild/.wasp/build/server/src/ext-src/jsconfig.json
waspBuild/.wasp/build/server/src/jobs/core/Job.js
waspBuild/.wasp/build/server/src/jobs/core/SubmittedJob.js
waspBuild/.wasp/build/server/src/jobs/core/allJobs.js
@@ -20,9 +20,9 @@ waspBuild/.wasp/build/server/src/jobs/core/pgBoss/pgBossJob.js
waspBuild/.wasp/build/server/src/jobs/core/simpleJob.js
waspBuild/.wasp/build/server/src/routes/index.js
waspBuild/.wasp/build/server/src/routes/operations/index.js
-waspBuild/.wasp/build/server/src/server.js
-waspBuild/.wasp/build/server/src/shared/jsconfig.json
+waspBuild/.wasp/build/server/src/server.ts
waspBuild/.wasp/build/server/src/utils.js
+waspBuild/.wasp/build/server/tsconfig.json
waspBuild/.wasp/build/web-app/.npmrc
waspBuild/.wasp/build/web-app/README.md
waspBuild/.wasp/build/web-app/netlify.toml
@@ -30,32 +30,36 @@ waspBuild/.wasp/build/web-app/package.json
waspBuild/.wasp/build/web-app/public/favicon.ico
waspBuild/.wasp/build/web-app/public/index.html
waspBuild/.wasp/build/web-app/public/manifest.json
+waspBuild/.wasp/build/web-app/src/actions/core.d.ts
waspBuild/.wasp/build/web-app/src/actions/core.js
-waspBuild/.wasp/build/web-app/src/actions/index.js
+waspBuild/.wasp/build/web-app/src/actions/index.ts
waspBuild/.wasp/build/web-app/src/api.js
waspBuild/.wasp/build/web-app/src/config.js
waspBuild/.wasp/build/web-app/src/ext-src/Main.css
-waspBuild/.wasp/build/web-app/src/ext-src/MainPage.js
-waspBuild/.wasp/build/web-app/src/ext-src/jsconfig.json
+waspBuild/.wasp/build/web-app/src/ext-src/MainPage.tsx
+waspBuild/.wasp/build/web-app/src/ext-src/react-app-env.d.ts
waspBuild/.wasp/build/web-app/src/ext-src/waspLogo.png
waspBuild/.wasp/build/web-app/src/index.js
waspBuild/.wasp/build/web-app/src/logo.png
waspBuild/.wasp/build/web-app/src/operations/index.js
waspBuild/.wasp/build/web-app/src/operations/resources.js
waspBuild/.wasp/build/web-app/src/operations/updateHandlersMap.js
+waspBuild/.wasp/build/web-app/src/queries/core.d.ts
waspBuild/.wasp/build/web-app/src/queries/core.js
+waspBuild/.wasp/build/web-app/src/queries/index.d.ts
waspBuild/.wasp/build/web-app/src/queries/index.js
waspBuild/.wasp/build/web-app/src/queryClient.js
waspBuild/.wasp/build/web-app/src/router.js
waspBuild/.wasp/build/web-app/src/serviceWorker.js
-waspBuild/.wasp/build/web-app/src/shared/jsconfig.json
waspBuild/.wasp/build/web-app/src/utils.js
+waspBuild/.wasp/build/web-app/tsconfig.json
waspBuild/.wasproot
waspBuild/main.wasp
waspBuild/src/.waspignore
waspBuild/src/client/Main.css
-waspBuild/src/client/MainPage.js
-waspBuild/src/client/jsconfig.json
+waspBuild/src/client/MainPage.tsx
+waspBuild/src/client/react-app-env.d.ts
+waspBuild/src/client/tsconfig.json
waspBuild/src/client/waspLogo.png
-waspBuild/src/server/jsconfig.json
-waspBuild/src/shared/jsconfig.json
+waspBuild/src/server/tsconfig.json
+waspBuild/src/shared/tsconfig.json
diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/.waspchecksums b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/.waspchecksums
index d12f5aa1d3..1a1e0387ff 100644
--- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/.waspchecksums
+++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/.waspchecksums
@@ -41,12 +41,19 @@
],
"e14514b8b152dd2160a217d8fc66a710c8607c4ed1441a2148a0770701818249"
],
+ [
+ [
+ "file",
+ "server/nodemon.json"
+ ],
+ "5d0e1103bbe7c29a7b3137a57345f8eeb4ccd8a2128d636cc1b2bd81cf348a86"
+ ],
[
[
"file",
"server/package.json"
],
- "15dfb8bf4e0dd58b9964cbcab2f02b0c977a802c88c4140861755f969d5697f9"
+ "597461e990d47093b89e2cdd239c6e9bc6bedef29b9cdf51b357ff3ee5217de2"
],
[
[
@@ -83,13 +90,6 @@
],
"20c67ca197da3de2d37528ceaff2e40af910be8177f346c6d5c2b2f983810c43"
],
- [
- [
- "file",
- "server/src/ext-src/jsconfig.json"
- ],
- "4130060d02d39d5fdc11bdb288cfe08d36dc89be29ade017b16db6477e63c47a"
- ],
[
[
"file",
@@ -123,7 +123,7 @@
"file",
"server/src/jobs/core/pgBoss/pgBossJob.js"
],
- "532ed0f34a2011cff2a9c43b712a513ba505e77d896455d6c7f36add6f88741d"
+ "ff6040d051c916eb080a2f2c37fd5135f588782387faeae51115d1a7abd1ad8b"
],
[
[
@@ -149,23 +149,23 @@
[
[
"file",
- "server/src/server.js"
+ "server/src/server.ts"
],
- "e19bdae598265cbe2457ff1e2d8524aa821666482cb7d21644e290a68daf94a5"
+ "c6114654819216004f0ef4a8771a0c1213c655cfd41760fbd835077c53a6b6ba"
],
[
[
"file",
- "server/src/shared/jsconfig.json"
+ "server/src/utils.js"
],
- "6972bc64315755788fd02be62c44ea8ffb60dd874b863fca2878f6160ab4b0e2"
+ "68a5794f55e24b303d81456a1181a3a2cd70773f6ebc4e7a63dac064834aa8e9"
],
[
[
"file",
- "server/src/utils.js"
+ "server/tsconfig.json"
],
- "68a5794f55e24b303d81456a1181a3a2cd70773f6ebc4e7a63dac064834aa8e9"
+ "3038f152754646d2c46de78e099e9e6129bfb2541e4dccd37a05a5632ab4d838"
],
[
[
@@ -200,7 +200,7 @@
"file",
"web-app/package.json"
],
- "228080234154d37b357013646aff651c65a415e3870054929f2fd2cc66af0f8c"
+ "26c45eb78e59df9f2c9e1779106e8b444087a4ab7865c8a1d0209d0e4023f030"
],
[
[
@@ -223,6 +223,13 @@
],
"696886c4dd2bb66df380e2a9ebf07d54fe39b25af968aeea090ed6fb528d402e"
],
+ [
+ [
+ "file",
+ "web-app/src/actions/core.d.ts"
+ ],
+ "c18e166c8f43bd3a6a8d78f8fc2f51fe82e956cd71b3464c59076f8dec660b24"
+ ],
[
[
"file",
@@ -233,9 +240,9 @@
[
[
"file",
- "web-app/src/actions/index.js"
+ "web-app/src/actions/index.ts"
],
- "7da2524a6920c46aada7e60e29fbe24d0e45e4bfcf7bf3044d16d11ab89a965e"
+ "bc520b1d83577c6640472dd5c110228a3617b050d3a4d091495ec065c57011bc"
],
[
[
@@ -261,16 +268,16 @@
[
[
"file",
- "web-app/src/ext-src/MainPage.js"
+ "web-app/src/ext-src/MainPage.tsx"
],
"c9ed9b5271f648715373095f43d60a2ab3e47f159c6dd6f3337ed22e5b73e80c"
],
[
[
"file",
- "web-app/src/ext-src/jsconfig.json"
+ "web-app/src/ext-src/react-app-env.d.ts"
],
- "06804c81fa3b227c1b3a04e950f8db9ed85bf41d042b90e8e8332856016e113f"
+ "c9e89cb25e83121c0c451125de7a0b0569161e2bf18f83bc5f69836403910744"
],
[
[
@@ -314,6 +321,13 @@
],
"07a9933a771853585fd2fc49c3dcb9f1cad947acb2168580c835fae25620fa9f"
],
+ [
+ [
+ "file",
+ "web-app/src/queries/core.d.ts"
+ ],
+ "f0b289140e92738451be386ca73a2fd1c84e9951eb2f1b9c6c09dfa3079d0c74"
+ ],
[
[
"file",
@@ -321,6 +335,13 @@
],
"2daf5b414722204281d65e954ce862a6fc586e8907b202800694909d23957c5e"
],
+ [
+ [
+ "file",
+ "web-app/src/queries/index.d.ts"
+ ],
+ "3eb32c063fc77fa5aa3f3b3a12c51ca8a52fc3cd0de21f4e9463a56cc374003c"
+ ],
[
[
"file",
@@ -340,7 +361,7 @@
"file",
"web-app/src/router.js"
],
- "dd6f5f5c6981df1935c02437d7a6ae343841300c3f7e99b0ad6ca62e95071421"
+ "65a91308a13f2c8444e3ad7372c1fca85a194b85e8f8f7d11613f78fcfe7af6f"
],
[
[
@@ -352,15 +373,15 @@
[
[
"file",
- "web-app/src/shared/jsconfig.json"
+ "web-app/src/utils.js"
],
- "6972bc64315755788fd02be62c44ea8ffb60dd874b863fca2878f6160ab4b0e2"
+ "0ae6e53a050dbc6b7166aedfd5b076c2cab524c4d6aff884dc6902b178148815"
],
[
[
"file",
- "web-app/src/utils.js"
+ "web-app/tsconfig.json"
],
- "0ae6e53a050dbc6b7166aedfd5b076c2cab524c4d6aff884dc6902b178148815"
+ "0612639442958ae18a96d651a6c385fba1a682f04d09e293efd380006fc4df99"
]
]
\ No newline at end of file
diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/installedFullStackNpmDependencies.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/installedFullStackNpmDependencies.json
index 0da1a29518..69a7a39ba5 100644
--- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/installedFullStackNpmDependencies.json
+++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/installedFullStackNpmDependencies.json
@@ -1 +1 @@
-{"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"express","version":"~4.18.1"},{"name":"morgan","version":"~1.10.0"},{"name":"@prisma/client","version":"4.5.0"},{"name":"jsonwebtoken","version":"^8.5.1"},{"name":"secure-password","version":"^4.0.0"},{"name":"dotenv","version":"16.0.2"},{"name":"helmet","version":"^6.0.0"},{"name":"patch-package","version":"^6.4.7"},{"name":"uuid","version":"^9.0.0"},{"name":"lodash","version":"^4.17.21"}],"devDependencies":[{"name":"nodemon","version":"^2.0.19"},{"name":"standard","version":"^17.0.0"},{"name":"prisma","version":"4.5.0"}]},"npmDepsForWebApp":{"dependencies":[{"name":"axios","version":"^0.27.2"},{"name":"react","version":"^17.0.2"},{"name":"react-dom","version":"^17.0.2"},{"name":"@tanstack/react-query","version":"^4.13.0"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"react-scripts","version":"5.0.1"}],"devDependencies":[]}}
\ No newline at end of file
+{"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"express","version":"~4.18.1"},{"name":"morgan","version":"~1.10.0"},{"name":"@prisma/client","version":"4.5.0"},{"name":"jsonwebtoken","version":"^8.5.1"},{"name":"secure-password","version":"^4.0.0"},{"name":"dotenv","version":"16.0.2"},{"name":"helmet","version":"^6.0.0"},{"name":"patch-package","version":"^6.4.7"},{"name":"uuid","version":"^9.0.0"},{"name":"lodash","version":"^4.17.21"}],"devDependencies":[{"name":"nodemon","version":"^2.0.19"},{"name":"standard","version":"^17.0.0"},{"name":"prisma","version":"4.5.0"},{"name":"typescript","version":"^4.8.4"},{"name":"@types/node","version":"^18.11.9"}]},"npmDepsForWebApp":{"dependencies":[{"name":"axios","version":"^0.27.2"},{"name":"react","version":"^17.0.2"},{"name":"react-dom","version":"^17.0.2"},{"name":"@tanstack/react-query","version":"^4.13.0"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"react-scripts","version":"5.0.1"}],"devDependencies":[{"name":"typescript","version":"^4.8.4"},{"name":"@types/react","version":"^18.0.25"},{"name":"@types/react-dom","version":"^18.0.8"},{"name":"@types/react-router-dom","version":"^5.3.3"}]}}
\ No newline at end of file
diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/nodemon.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/nodemon.json
new file mode 100644
index 0000000000..92d00152d9
--- /dev/null
+++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/nodemon.json
@@ -0,0 +1,9 @@
+{
+ "env": {
+ "NODE_ENV": "development"
+ },
+ "watch": [
+ "src/"
+ ],
+ "ext": "ts,mts,js,mjs,json"
+}
diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/package.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/package.json
index 9b25d4cb40..e37ba66de1 100644
--- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/package.json
+++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/package.json
@@ -14,9 +14,11 @@
"uuid": "^9.0.0"
},
"devDependencies": {
+ "@types/node": "^18.11.9",
"nodemon": "^2.0.19",
"prisma": "4.5.0",
- "standard": "^17.0.0"
+ "standard": "^17.0.0",
+ "typescript": "^4.8.4"
},
"engineStrict": true,
"engines": {
@@ -34,13 +36,15 @@
},
"private": true,
"scripts": {
+ "build": "npx tsc",
+ "build-and-start": "npm run build && npm run start",
"db-migrate-dev": "prisma migrate dev --schema=../db/schema.prisma",
"db-migrate-prod": "prisma migrate deploy --schema=../db/schema.prisma",
"postinstall": "patch-package",
"standard": "standard",
- "start": "nodemon -r dotenv/config ./src/server.js",
- "start-production": "NODE_ENV=production node ./src/server.js"
+ "start": "NODE_PATH=dist node dist/server.js",
+ "start-production": "NODE_ENV=production npm run start",
+ "watch": "nodemon -r dotenv/config --exec 'npm run build-and-start || exit 1'"
},
- "type": "module",
"version": "0.0.0"
}
diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/ext-src/jsconfig.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/ext-src/jsconfig.json
deleted file mode 100644
index 9e996fc5df..0000000000
--- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/ext-src/jsconfig.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "compilerOptions": {
- // The following settings enable IDE support in user-provided source files.
- // Editing them might break features like import autocompletion and
- // definition lookup. Don't change them unless you know what you're doing.
- //
- // The relative path to the generated web app's root directory. This must be
- // set to define the "paths" option.
- "baseUrl": "../../.wasp/out/server/",
- "paths": {
- // Resolve all "@wasp" imports to the generated source code.
- "@wasp/*": [
- "src/*"
- ],
- // Resolve all non-relative imports to the correct node module. Source:
- // https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping
- "*": [
- // Start by looking for the definiton inside the node modules root
- // directory...
- "node_modules/*",
- // ... If that fails, Try to find it inside definitely-typed type
- // definitions.
- "node_modules/@types/*"
- ]
- }
- }
-}
diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/jobs/core/pgBoss/pgBossJob.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/jobs/core/pgBoss/pgBossJob.js
index a9ac57c367..b9267c967a 100644
--- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/jobs/core/pgBoss/pgBossJob.js
+++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/jobs/core/pgBoss/pgBossJob.js
@@ -55,7 +55,7 @@ class PgBossJob extends Job {
* @param {object} jobArgs - The job arguments supplied by the user for their perform callback.
* @param {object} jobOptions - pg-boss specific options for `boss.send()`, which can override their defaultJobOptions.
*/
- async submit(jobArgs, jobOptions) {
+ async submit(jobArgs, jobOptions = {}) {
const boss = await pgBossStarted
const jobId = await boss.send(this.jobName, jobArgs,
{ ...this.#defaultJobOptions, ...(this.#startAfter && { startAfter: this.#startAfter }), ...jobOptions })
diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/server.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/server.ts
similarity index 95%
rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/server.js
rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/server.ts
index 747b00a051..e4b32230de 100644
--- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/server.js
+++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/server.ts
@@ -15,7 +15,7 @@ const startServer = async () => {
server.listen(port)
- server.on('error', (error) => {
+ server.on('error', (error: NodeJS.ErrnoException) => {
if (error.syscall !== 'listen') throw error
const bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port
// handle specific listen errors with friendly messages
diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/tsconfig.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/tsconfig.json
new file mode 100644
index 0000000000..97afa9c21e
--- /dev/null
+++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/tsconfig.json
@@ -0,0 +1,12 @@
+{
+ "compilerOptions": {
+ // Enable default imports in TypeScript.
+ "esModuleInterop": true,
+ "module": "commonjs",
+ "moduleResolution": "node",
+ "outDir": "dist",
+ "allowJs": true,
+ // Enable source map for debugging
+ "sourceMap": true
+ }
+}
diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/package.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/package.json
index 13db738e73..98c5dcbdd7 100644
--- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/package.json
+++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/package.json
@@ -19,7 +19,12 @@
"react-router-dom": "^5.3.3",
"react-scripts": "5.0.1"
},
- "devDependencies": {},
+ "devDependencies": {
+ "@types/react": "^18.0.25",
+ "@types/react-dom": "^18.0.8",
+ "@types/react-router-dom": "^5.3.3",
+ "typescript": "^4.8.4"
+ },
"engineStrict": true,
"engines": {
"node": "^18.12.0",
diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/actions/core.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/actions/core.d.ts
new file mode 100644
index 0000000000..1171c7e1b4
--- /dev/null
+++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/actions/core.d.ts
@@ -0,0 +1,3 @@
+export type Action = (args?: Input) => Promise