diff --git a/package.json b/package.json index 8d9bd2aa..739cf324 100644 --- a/package.json +++ b/package.json @@ -7,12 +7,12 @@ "build": "remix build", "lint": "prettier --check . && eslint --ignore-path .gitignore --cache --cache-location ./node_modules/.cache/eslint --max-warnings=0 .", "dev": "remix dev --manual -c \"npm start\"", - "start": "wrangler dev ./build/index.js", + "start": "wrangler dev ./build/index.js ${WRANGLER_ARGS:-}", "prebuild": "npm run clean", "clean": "del public/build && del build", "ci-test": "CI=true run-p typecheck test", "remove-sourcemaps": "del public/build/**/*.map", - "deploy": "npm run ci-test && npm run build -- --sourcemap && npm run remove-sourcemaps && wrangler publish --define __RELEASE__:\\\"$(git rev-parse --short HEAD)\\\" --define __SENTRY_DSN__:\\\"$SENTRY_DSN\\\"", + "deploy": "npm run ci-test && npm run build -- --sourcemap && npm run remove-sourcemaps && wrangler publish --define __RELEASE__:\\\"$(git rev-parse --short HEAD)\\\" --define __SENTRY_DSN__:\\\"$SENTRY_DSN\\\" ${WRANGLER_ARGS:-}", "prettier": "prettier -w .", "typecheck": "tsc --noEmit --skipLibCheck", "typecheck:watch": "npm run typecheck -- --watch", @@ -21,8 +21,14 @@ "test:e2e": "playwright test --headed", "check": "npm run lint && npm run typecheck && npm run test:ci", "db:generate": "drizzle-kit generate", - "db:migrate:local": "wrangler d1 migrations apply orange-meets-db --local", - "db:studio:local": "LOCAL_DB_PATH=$(find .wrangler/state/v3/d1/miniflare-D1DatabaseObject -type f -name '*.sqlite' -print -quit) drizzle-kit studio" + "db:migrate:local": "wrangler d1 migrations apply orange-meets-db-development -c wrangler.development.toml --local", + "db:migrate:development": "wrangler d1 migrations apply orange-meets-db-development -c wrangler.development.toml --remote", + "db:migrate:staging": "wrangler d1 migrations apply orange-meets-db-staging -c wrangler.staging.toml --remote", + "db:migrate:production": "wrangler d1 migrations apply orange-meets-db-production -c wrangler.production.toml --remote", + "db:studio:local": "LOCAL_DB_PATH=$(find .wrangler/state/v3/d1/miniflare-D1DatabaseObject -type f -name '*.sqlite' -print -quit) drizzle-kit studio", + "db:studio:development": "source .drizzle.env && DB_ID='6b0eceef-c836-4ba7-aac2-fa9b6f702e3b' drizzle-kit studio", + "db:studio:staging": "source .drizzle.env && DB_ID='e9091e61-7e0a-4719-b9cb-3e1c3e95e9fa' drizzle-kit studio", + "db:studio:production": "source .drizzle.env && DB_ID='125a3008-0a8a-4ada-a829-7d2eb2ef15bc' drizzle-kit studio" }, "dependencies": { "@heroicons/react": "^2.1.5", diff --git a/wrangler.development.toml b/wrangler.development.toml new file mode 100644 index 00000000..3c3adf52 --- /dev/null +++ b/wrangler.development.toml @@ -0,0 +1,55 @@ +name = "orange-meets-development" + +account_id = "8477399eb04accc1792af96aeaa25222" +main = "./build/index.js" +# https://developers.cloudflare.com/workers/platform/compatibility-dates +compatibility_date = "2024-06-20" +compatibility_flags = ["nodejs_compat"] + +[site] + bucket = "./public" + +[[build.upload.rules]] + type = "ESModule" + globs = ["**/*.js"] + +kv_namespaces = [ + { binding = "FEEDBACK_STORAGE", id = "acb3952303514551a17b6fe627fb6953", preview_id = "acb3952303514551a17b6fe627fb6953" } +] +durable_objects.bindings = [ + { name = "rooms", class_name = "ChatRoom" }, +] + +[vars] +CALLS_APP_ID = "f0ea263009299383d09d44b9fad5316c" +TURN_SERVICE_ID = "124bb066f462e966159bc4eef4b42048" + +[[queues.producers]] + queue = "orange-meets-feedback-queue-development" + binding = "FEEDBACK_QUEUE" + +[[queues.consumers]] + queue = "orange-meets-feedback-queue-development" + # Required: this should match the name of the queue you created in step 3. + # If you misspell the name, you will receive an error when attempting to publish your Worker. + max_batch_size = 10 # optional: defaults to 10 + max_batch_timeout = 5 # optional: defaults to 5 seconds + +[[d1_databases]] +binding = "DB" # i.e. available in your Worker on env.DB +database_name = "orange-meets-db-development" +database_id = "6b0eceef-c836-4ba7-aac2-fa9b6f702e3b" + +# Indicate that you want the ChatRoom and RateLimiter classes to be callable as Durable Objects. +[[migrations]] +tag = "v1" # Should be unique for each entry +new_classes = ["ChatRoom", "RateLimiter"] + +[[migrations]] +tag = "v2" +deleted_classes = ["RateLimiter"] + +# The necessary secrets are: +# - CALLS_APP_SECRET +# Run `echo | wrangler secret put ` for each of these + diff --git a/wrangler.production.toml b/wrangler.production.toml new file mode 100644 index 00000000..c1ed6cbd --- /dev/null +++ b/wrangler.production.toml @@ -0,0 +1,56 @@ +name = "orange-meets-production" + +account_id = "8477399eb04accc1792af96aeaa25222" +main = "./build/index.js" +# https://developers.cloudflare.com/workers/platform/compatibility-dates +compatibility_date = "2024-06-20" +compatibility_flags = ["nodejs_compat"] + +[site] + bucket = "./public" + +[[build.upload.rules]] + type = "ESModule" + globs = ["**/*.js"] + +kv_namespaces = [ + { binding = "FEEDBACK_STORAGE", id = "301815bba6144355bfda771856ca4614", preview_id = "acb3952303514551a17b6fe627fb6953" } +] +durable_objects.bindings = [ + { name = "rooms", class_name = "ChatRoom" }, +] + +[vars] +CALLS_APP_ID = "700932c6384d6f4ba19838afa3ab93cd" +TURN_SERVICE_ID = "53fa66872a8636170428abae9b049193" + +[[queues.producers]] + queue = "orange-meets-feedback-queue" + binding = "FEEDBACK_QUEUE" + +[[queues.consumers]] + queue = "orange-meets-feedback-queue" + # Required: this should match the name of the queue you created in step 3. + # If you misspell the name, you will receive an error when attempting to publish your Worker. + max_batch_size = 10 # optional: defaults to 10 + max_batch_timeout = 5 # optional: defaults to 5 seconds + +[[d1_databases]] +binding = "DB" # i.e. available in your Worker on env.DB +database_name = "orange-meets-db-production" +database_id = "125a3008-0a8a-4ada-a829-7d2eb2ef15bc" + +# Indicate that you want the ChatRoom and RateLimiter classes to be callable as Durable Objects. +[[migrations]] +tag = "v1" # Should be unique for each entry +new_classes = ["ChatRoom", "RateLimiter"] + +[[migrations]] +tag = "v2" +deleted_classes = ["RateLimiter"] + +# The necessary secrets are: +# - CALLS_APP_SECRET +# Run `echo | wrangler secret put ` for each of these + + diff --git a/wrangler.public.toml b/wrangler.public.toml new file mode 100644 index 00000000..d1cf82e7 --- /dev/null +++ b/wrangler.public.toml @@ -0,0 +1,39 @@ +name = "orange-meets-public" + +account_id = "8477399eb04accc1792af96aeaa25222" +main = "./build/index.js" +# https://developers.cloudflare.com/workers/platform/compatibility-dates +compatibility_date = "2024-06-20" +compatibility_flags = ["nodejs_compat"] + +[site] + bucket = "./public" + +[[build.upload.rules]] + type = "ESModule" + globs = ["**/*.js"] + +[vars] +CALLS_APP_ID = "d83fd70c193329ea4f683ffe7b34d056" +TURN_SERVICE_ID = "46711d6c5759085dd70f599f6190ab94" +PUBLIC = "true" + +[durable_objects] +bindings = [ + { name = "rooms", class_name = "ChatRoom", script_name = "orange-meets-public" } +] + +# Indicate that you want the ChatRoom and RateLimiter classes to be callable as Durable Objects. +[[migrations]] +tag = "v1" # Should be unique for each entry +new_classes = ["ChatRoom", "RateLimiter"] + +[[migrations]] +tag = "v2" +deleted_classes = ["RateLimiter"] + +# The necessary secrets are: +# - CALLS_APP_SECRET +# Run `echo | wrangler secret put ` for each of these + + diff --git a/wrangler.staging.toml b/wrangler.staging.toml new file mode 100644 index 00000000..fc623a56 --- /dev/null +++ b/wrangler.staging.toml @@ -0,0 +1,56 @@ +name = "orange-meets-staging" + +account_id = "8477399eb04accc1792af96aeaa25222" +main = "./build/index.js" +# https://developers.cloudflare.com/workers/platform/compatibility-dates +compatibility_date = "2024-06-20" +compatibility_flags = ["nodejs_compat"] + +[site] + bucket = "./public" + +[[build.upload.rules]] + type = "ESModule" + globs = ["**/*.js"] + +kv_namespaces = [ + { binding = "FEEDBACK_STORAGE", id = "acb3952303514551a17b6fe627fb6953", preview_id = "acb3952303514551a17b6fe627fb6953" } +] +durable_objects.bindings = [ + { name = "rooms", class_name = "ChatRoom" }, +] + +[vars] +CALLS_APP_ID = "9effffd0c077c1115c7d285e55593a9a" +TURN_SERVICE_ID = "11cebcf8429b947a48c6894650daa021" + +[[queues.producers]] + queue = "orange-meets-feedback-queue-staging" + binding = "FEEDBACK_QUEUE" + +[[queues.consumers]] + queue = "orange-meets-feedback-queue-staging" + # Required: this should match the name of the queue you created in step 3. + # If you misspell the name, you will receive an error when attempting to publish your Worker. + max_batch_size = 10 # optional: defaults to 10 + max_batch_timeout = 5 # optional: defaults to 5 seconds + +[[d1_databases]] +binding = "DB" # i.e. available in your Worker on env.DB +database_name = "orange-meets-db-staging" +database_id = "e9091e61-7e0a-4719-b9cb-3e1c3e95e9fa" + +# Indicate that you want the ChatRoom and RateLimiter classes to be callable as Durable Objects. +[[migrations]] +tag = "v1" # Should be unique for each entry +new_classes = ["ChatRoom", "RateLimiter"] + +[[migrations]] +tag = "v2" +deleted_classes = ["RateLimiter"] + +# The necessary secrets are: +# - CALLS_APP_SECRET +# Run `echo | wrangler secret put ` for each of these + +