Skip to content

Commit

Permalink
chore: add compatibilityDate to all config files
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Sep 29, 2024
1 parent 1709b16 commit f70b03c
Show file tree
Hide file tree
Showing 16 changed files with 28 additions and 9 deletions.
4 changes: 3 additions & 1 deletion examples/api-routes/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export default defineNitroConfig({});
export default defineNitroConfig({
compatibilityDate: "2024-09-29",
});
4 changes: 3 additions & 1 deletion examples/auto-imports/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export default defineNitroConfig({});
export default defineNitroConfig({
compatibilityDate: "2024-09-29",
});
4 changes: 3 additions & 1 deletion examples/cached-handler/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export default defineNitroConfig({});
export default defineNitroConfig({
compatibilityDate: "2024-09-29",
});
1 change: 1 addition & 0 deletions examples/custom-error-handler/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import errorHandler from "./error";

export default defineNitroConfig({
compatibilityDate: "2024-09-29",
errorHandler: "~/error",
devErrorHandler: errorHandler,
});
1 change: 1 addition & 0 deletions examples/database/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default defineNitroConfig({
compatibilityDate: "2024-09-29",
experimental: {
database: true,
tasks: true,
Expand Down
4 changes: 3 additions & 1 deletion examples/graceful-shutdown/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { defineNitroConfig } from "nitropack/config";

export default defineNitroConfig({});
export default defineNitroConfig({
compatibilityDate: "2024-09-29",
});
1 change: 1 addition & 0 deletions examples/hello-world/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// https://nitro.unjs.io/config
export default defineNitroConfig({
compatibilityDate: "2024-09-29",
srcDir: "server",
});
4 changes: 3 additions & 1 deletion examples/middleware/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export default defineNitroConfig({});
export default defineNitroConfig({
compatibilityDate: "2024-09-29",
});
4 changes: 3 additions & 1 deletion examples/nano-jsx/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export default defineNitroConfig({});
export default defineNitroConfig({
compatibilityDate: "2024-09-29",
});
1 change: 1 addition & 0 deletions examples/plugins/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export default defineNitroConfig({
compatibilityDate: "2024-09-29",
plugins: ["~/plugins/test"],
});
2 changes: 1 addition & 1 deletion examples/renderer/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default defineNitroConfig({
compatibilityDate: "2024-06-21",
compatibilityDate: "2024-09-29",
renderer: "~/renderer",
});
1 change: 1 addition & 0 deletions examples/websocket/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default defineNitroConfig({
compatibilityDate: "2024-09-29",
experimental: {
websocket: true,
},
Expand Down
2 changes: 1 addition & 1 deletion playground/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineNitroConfig } from "nitropack/config";

export default defineNitroConfig({
compatibilityDate: "2024-09-25",
compatibilityDate: "2024-09-29",
});
1 change: 1 addition & 0 deletions src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ import type { NitroConfig } from "nitropack/types";
export type { NitroConfig } from "nitropack/types";

export function defineNitroConfig(config: NitroConfig): NitroConfig {
config.cloudflare?.wrangler?.compatibility_flags;

Check failure on line 6 in src/config/index.ts

View workflow job for this annotation

GitHub Actions / lint

Expected an assignment or function call and instead saw an expression
return config;
}
2 changes: 1 addition & 1 deletion test/fixture/nitro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineNitroConfig } from "nitropack/config";

export default defineNitroConfig({
compressPublicAssets: true,
compatibilityDate: "2024-06-12",
compatibilityDate: "2024-09-29",
imports: {
presets: [
{
Expand Down
1 change: 1 addition & 0 deletions test/fixture/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ describe("API routes", () => {
describe("defineNitroConfig", () => {
it("should not accept functions to routeRules.cache", () => {
defineNitroConfig({
compatibilityDate: "2024-09-29",
routeRules: {
"/**": {
cache: {
Expand Down

0 comments on commit f70b03c

Please sign in to comment.