create-cloudflare 2.0.9 → 2.0.11
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/README.md +7 -5
- package/dist/angular/templates/tools/bundle.mjs +5 -2
- package/dist/cli.js +48474 -51573
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -4
- package/templates/chatgptPlugin/ts/README.md +1 -1
- package/templates/chatgptPlugin/ts/package.json +1 -1
- package/templates/chatgptPlugin/ts/wrangler.toml +2 -2
- package/templates/common/js/package.json +1 -1
- package/templates/common/js/wrangler.toml +37 -25
- package/templates/common/ts/package.json +1 -1
- package/templates/common/ts/wrangler.toml +37 -25
- package/templates/{simple/ts → hello-world/js}/package.json +1 -1
- package/templates/hello-world/js/wrangler.toml +51 -0
- package/templates/{simple/js → hello-world/ts}/package.json +1 -1
- package/templates/hello-world/ts/wrangler.toml +51 -0
- package/templates/queues/js/.editorconfig +13 -0
- package/templates/queues/js/.prettierrc +6 -0
- package/templates/queues/js/package.json +14 -0
- package/templates/queues/js/src/worker.js +38 -0
- package/templates/queues/js/wrangler.toml +19 -0
- package/templates/queues/ts/.editorconfig +13 -0
- package/templates/queues/ts/.prettierrc +6 -0
- package/templates/queues/ts/package.json +14 -0
- package/templates/queues/ts/src/worker.ts +43 -0
- package/templates/queues/ts/tsconfig.json +101 -0
- package/templates/queues/ts/wrangler.toml +19 -0
- package/templates/scheduled/js/.editorconfig +13 -0
- package/templates/scheduled/js/.prettierrc +6 -0
- package/templates/scheduled/js/package.json +14 -0
- package/templates/scheduled/js/src/worker.js +30 -0
- package/templates/scheduled/js/wrangler.toml +9 -0
- package/templates/scheduled/ts/.editorconfig +13 -0
- package/templates/scheduled/ts/.prettierrc +6 -0
- package/templates/scheduled/ts/package.json +14 -0
- package/templates/scheduled/ts/src/worker.ts +50 -0
- package/templates/scheduled/ts/tsconfig.json +101 -0
- package/templates/scheduled/ts/wrangler.toml +9 -0
- package/templates/simple/js/wrangler.toml +0 -40
- package/templates/simple/ts/wrangler.toml +0 -40
- /package/templates/{simple → hello-world}/js/.editorconfig +0 -0
- /package/templates/{simple → hello-world}/js/.prettierrc +0 -0
- /package/templates/{simple → hello-world}/js/src/worker.js +0 -0
- /package/templates/{simple → hello-world}/ts/.editorconfig +0 -0
- /package/templates/{simple → hello-world}/ts/.prettierrc +0 -0
- /package/templates/{simple → hello-world}/ts/src/worker.ts +0 -0
- /package/templates/{simple → hello-world}/ts/tsconfig.json +0 -0
package/README.md
CHANGED
|
@@ -37,21 +37,23 @@ Currently supported framework options: `angular`, `astro`, `docusaurus`, `gatsby
|
|
|
37
37
|
To create a new Javascript "Hello World" worker, run:
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
|
-
npm create cloudflare@latest hello-world -- --type
|
|
40
|
+
npm create cloudflare@latest hello-world -- --type hello-world --no-ts
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
To create a new Typescript "Hello World" worker, run:
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
|
-
npm create cloudflare@latest hello-world -- --type
|
|
46
|
+
npm create cloudflare@latest hello-world -- --type hello-world --ts
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
Current template options are: `
|
|
49
|
+
Current template options are: `hello-world`, `common`, or `chatgptPlugin`.
|
|
50
50
|
|
|
51
51
|
#### Additional arguments
|
|
52
52
|
|
|
53
|
-
|
|
|
54
|
-
|
|
|
53
|
+
| | |
|
|
54
|
+
| ------------- | :---------------------------------------------------------------------: |
|
|
55
|
+
| `--deploy` | deploy your application automatically, bypassing the interactive prompt |
|
|
56
|
+
| `--no-deploy` | create and scaffold a new application and bypass deployment prompt |
|
|
55
57
|
|
|
56
58
|
### Community
|
|
57
59
|
|
|
@@ -37,7 +37,8 @@ async function bundleMain() {
|
|
|
37
37
|
],
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
// Store the original promise (before Angular/Zone.js replaces it) on the global scope.
|
|
41
|
+
let main = "globalThis.OGPromise = Promise;\n" + result.outputFiles[0].text;
|
|
41
42
|
|
|
42
43
|
// Patch any dynamic imports (converting `require()` calls to `import()` calls).
|
|
43
44
|
main = main.replace(
|
|
@@ -45,7 +46,9 @@ async function bundleMain() {
|
|
|
45
46
|
'promises.push(import("./" + __webpack_require__.u(chunkId)).then((mod) => installChunk(mod.default))'
|
|
46
47
|
);
|
|
47
48
|
// Export the fetch handler (grabbing it from the global).
|
|
48
|
-
|
|
49
|
+
// Also Cloudflare expects `fetch()` to return an original Promise (not a ZoneAwarePromise).
|
|
50
|
+
main +=
|
|
51
|
+
"\nexport default { fetch: (request, env) => globalThis.OGPromise.resolve(globalThis.__workerFetchHandler(request, env)) };";
|
|
49
52
|
|
|
50
53
|
await fs.writeFile(path.resolve(workerPath, "index.js"), main);
|
|
51
54
|
}
|