Skip to content

Commit 3c6e2ab

Browse files
committed
update templates
1 parent a91dfe2 commit 3c6e2ab

File tree

64 files changed

+59
-243
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+59
-243
lines changed

packages/create-cloudflare/templates-experimental/solid/c3.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ const config: TemplateConfig = {
8484
scripts: {
8585
preview: `${npm} run build && npx wrangler dev`,
8686
deploy: `${npm} run build && wrangler deploy`,
87+
"cf-typegen": `wrangler types`,
8788
},
8889
}),
8990
compatibilityFlags: ["nodejs_compat"],

packages/create-cloudflare/templates/analog/c3.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import { brandColor, dim } from "@cloudflare/cli/colors";
33
import { spinner } from "@cloudflare/cli/interactive";
44
import { runFrameworkGenerator } from "frameworks/index";
55
import { loadTemplateSnippets, transformFile } from "helpers/codemod";
6-
import { getLatestTypesEntrypoint } from "helpers/compatDate";
7-
import { readFile, writeFile } from "helpers/files";
86
import { detectPackageManager } from "helpers/packageManagers";
97
import { installPackages } from "helpers/packages";
108
import * as recast from "recast";
@@ -40,28 +38,6 @@ const configure = async (ctx: C3Context) => {
4038
}
4139

4240
updateViteConfig(ctx);
43-
updateEnvTypes(ctx);
44-
};
45-
46-
const updateEnvTypes = (ctx: C3Context) => {
47-
const filepath = "env.d.ts";
48-
49-
const s = spinner();
50-
s.start(`Updating ${filepath}`);
51-
52-
let file = readFile(filepath);
53-
54-
let typesEntrypoint = `@cloudflare/workers-types`;
55-
const latestEntrypoint = getLatestTypesEntrypoint(ctx);
56-
if (latestEntrypoint) {
57-
typesEntrypoint += `/${latestEntrypoint}`;
58-
}
59-
60-
// Replace placeholder with actual types entrypoint
61-
file = file.replace("WORKERS_TYPES_ENTRYPOINT", typesEntrypoint);
62-
writeFile("env.d.ts", file);
63-
64-
s.stop(`${brandColor(`updated`)} ${dim(`\`${filepath}\``)}`);
6541
};
6642

6743
const updateViteConfig = (ctx: C3Context) => {

packages/create-cloudflare/templates/analog/templates/env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/// <reference types="WORKERS_TYPES_ENTRYPOINT" />
1+
/// <reference types="./worker-configuration.d.ts" />
22

33
declare module "h3" {
44
interface H3EventContext {

packages/create-cloudflare/templates/analog/templates/worker-configuration.d.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/create-cloudflare/templates/angular/pages/c3.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { logRaw } from "@cloudflare/cli";
33
import { brandColor, dim } from "@cloudflare/cli/colors";
44
import { spinner } from "@cloudflare/cli/interactive";
55
import { runFrameworkGenerator } from "frameworks/index";
6-
import { compatDateFlag } from "helpers/compatDate";
76
import { readFile, readJSON, writeFile } from "helpers/files";
87
import { detectPackageManager } from "helpers/packageManagers";
98
import { installPackages } from "helpers/packages";
@@ -107,10 +106,11 @@ const config: TemplateConfig = {
107106
configure,
108107
transformPackageJson: async () => ({
109108
scripts: {
110-
start: `${npm} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()}`,
109+
start: `${npm} run build && wrangler pages dev`,
111110
build: `ng build && ${npm} run process`,
112111
process: "node ./tools/copy-files.mjs",
113-
deploy: `${npm} run build && wrangler pages deploy dist/cloudflare`,
112+
deploy: `${npm} run build && wrangler pages deploy`,
113+
"cf-typegen": `wrangler types`,
114114
},
115115
}),
116116
};
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "<TBD>",
3+
"compatibility_date": "<TBD>",
4+
"pages_build_output_dir": "./dist/cloudflare"
5+
}

packages/create-cloudflare/templates/angular/workers/c3.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ const config: TemplateConfig = {
106106
start: `${npm} run build && wrangler dev`,
107107
build: `ng build`,
108108
deploy: `${npm} run build && wrangler deploy`,
109+
"cf-typegen": `wrangler types`,
109110
},
110111
}),
111112
};

packages/create-cloudflare/templates/astro/workers/templates/ts/worker-configuration.d.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/create-cloudflare/templates/common/ts/tsconfig.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
/* Enable importing .json files */
1717
"resolveJsonModule": true,
1818

19-
/* Specify type package names to be included without being referenced in a source file. */
20-
"types": ["@cloudflare/workers-types"],
21-
2219
/* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */
2320
"allowJs": true,
2421
/* Enable error reporting in type-checked JavaScript files. */

packages/create-cloudflare/templates/common/ts/worker-configuration.d.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)