alchemy 2.0.0-beta.6 → 2.0.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alchemy",
3
- "version": "2.0.0-beta.6",
3
+ "version": "2.0.0-beta.7",
4
4
  "homepage": "https://alchemy.run",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Sam Goodwin <sam@alchemy.run>",
@@ -930,10 +930,12 @@ export const WorkerProvider = () =>
930
930
  const deleteDomain = yield* workers.deleteDomain;
931
931
  const listZones = yield* zones.listZones;
932
932
  const telemetry = yield* CloudflareLogs;
933
- const defaultCompatibilityDate = yield* Effect.promise(() =>
934
- // @ts-expect-error no types for workerd
935
- import("workerd").then((m) => m.compatibilityDate as string),
936
- );
933
+ // TODO(sam): figure out why the later one from workerd breaks
934
+ const defaultCompatibilityDate = "2026-03-17";
935
+ // const defaultCompatibilityDate = yield* Effect.promise(() =>
936
+ // // @ts-expect-error no types for workerd
937
+ // import("workerd").then((m) => m.compatibilityDate as string),
938
+ // );
937
939
 
938
940
  const getAccountSubdomain = (accountId: string) =>
939
941
  getSubdomain({
@@ -1152,6 +1154,19 @@ export const WorkerProvider = () =>
1152
1154
  );
1153
1155
  });
1154
1156
 
1157
+ const getCompatibility = (props: WorkerProps) => ({
1158
+ compatibilityDate:
1159
+ props.compatibility?.date ?? defaultCompatibilityDate,
1160
+ compatibilityFlags: props.compatibility?.flags
1161
+ ? [
1162
+ ...props.compatibility.flags,
1163
+ ...(props.isExternal ? [] : ["nodejs_compat"]),
1164
+ ].filter((value, index, self) => self.indexOf(value) === index)
1165
+ : props.isExternal
1166
+ ? []
1167
+ : ["nodejs_compat"],
1168
+ });
1169
+
1155
1170
  const prepareBundle = (id: string, props: WorkerProps) =>
1156
1171
  Effect.gen(function* () {
1157
1172
  const main = yield* fs.realPath(props.main);
@@ -1162,20 +1177,7 @@ export const WorkerProvider = () =>
1162
1177
  input: main,
1163
1178
  cwd,
1164
1179
  plugins: [
1165
- cloudflareRolldown({
1166
- compatibilityDate:
1167
- props.compatibility?.date ?? defaultCompatibilityDate,
1168
- compatibilityFlags: props.compatibility?.flags
1169
- ? [
1170
- ...props.compatibility.flags,
1171
- ...(props.isExternal ? [] : ["nodejs_compat"]),
1172
- ].filter(
1173
- (value, index, self) => self.indexOf(value) === index,
1174
- )
1175
- : props.isExternal
1176
- ? []
1177
- : ["nodejs_compat"],
1178
- }),
1180
+ cloudflareRolldown(getCompatibility(props)),
1179
1181
  plugins,
1180
1182
  ...(props.build?.metafile ? [Sonda({ open: false })] : []),
1181
1183
  ],
@@ -1354,11 +1356,7 @@ ${[
1354
1356
  sharedConfigBuild: true,
1355
1357
  },
1356
1358
  plugins: [
1357
- cloudflareVite({
1358
- compatibilityDate:
1359
- props.compatibility?.date ?? defaultCompatibilityDate,
1360
- compatibilityFlags: props.compatibility?.flags,
1361
- }),
1359
+ cloudflareVite(getCompatibility(props)),
1362
1360
  {
1363
1361
  name: "output:ssr",
1364
1362
  applyToEnvironment(environment) {
@@ -1681,8 +1679,7 @@ ${[
1681
1679
  assets: metadataAssets,
1682
1680
  bindings: metadataBindings,
1683
1681
  bodyPart: undefined,
1684
- compatibilityDate: news.compatibility?.date ?? "2026-03-10",
1685
- compatibilityFlags: news.compatibility?.flags,
1682
+ ...getCompatibility(news),
1686
1683
  containers:
1687
1684
  metadataContainers.length > 0 ? metadataContainers : undefined,
1688
1685
  keepAssets,
@@ -1908,9 +1905,7 @@ ${[
1908
1905
  className,
1909
1906
  }))
1910
1907
  : undefined,
1911
- compatibilityDate:
1912
- news.compatibility?.date ?? defaultCompatibilityDate,
1913
- compatibilityFlags: news.compatibility?.flags,
1908
+ ...getCompatibility(news),
1914
1909
  containers,
1915
1910
  migrations:
1916
1911
  doClasses.length > 0