create-cloudflare 0.0.0-e4ef867c → 0.0.0-e6ddf8a7

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.
Files changed (57) hide show
  1. package/README.md +1 -52
  2. package/dist/angular/templates/{src/main.server.ts → server.ts} +14 -15
  3. package/dist/angular/templates/tools/alter-polyfills.mjs +27 -0
  4. package/dist/angular/templates/tools/copy-files.mjs +9 -0
  5. package/dist/cli.js +43018 -41717
  6. package/package.json +85 -73
  7. package/templates/chatgptPlugin/ts/README.md +2 -2
  8. package/templates/chatgptPlugin/ts/__dot__gitignore +171 -0
  9. package/templates/chatgptPlugin/ts/package.json +2 -1
  10. package/templates/chatgptPlugin/ts/src/search.ts +3 -7
  11. package/templates/common/js/__dot__gitignore +172 -0
  12. package/templates/common/js/package.json +1 -0
  13. package/templates/common/js/wrangler.toml +2 -2
  14. package/templates/common/ts/__dot__gitignore +172 -0
  15. package/templates/common/ts/package.json +1 -0
  16. package/templates/common/ts/wrangler.toml +2 -2
  17. package/templates/hello-world/js/__dot__gitignore +172 -0
  18. package/templates/hello-world/js/package.json +1 -0
  19. package/templates/hello-world/js/wrangler.toml +2 -2
  20. package/templates/hello-world/ts/__dot__gitignore +172 -0
  21. package/templates/hello-world/ts/package.json +1 -0
  22. package/templates/hello-world/ts/wrangler.toml +2 -2
  23. package/templates/openapi/ts/README.md +25 -0
  24. package/templates/openapi/ts/__dot__gitignore +171 -0
  25. package/templates/openapi/ts/package.json +19 -0
  26. package/templates/openapi/ts/src/endpoints/taskCreate.ts +48 -0
  27. package/templates/openapi/ts/src/endpoints/taskDelete.ts +55 -0
  28. package/templates/openapi/ts/src/endpoints/taskFetch.ts +74 -0
  29. package/templates/openapi/ts/src/endpoints/taskList.ts +66 -0
  30. package/templates/openapi/ts/src/index.ts +29 -0
  31. package/templates/openapi/ts/src/types.ts +9 -0
  32. package/templates/openapi/ts/tsconfig.json +32 -0
  33. package/templates/openapi/ts/wrangler.toml +3 -0
  34. package/templates/queues/js/__dot__gitignore +172 -0
  35. package/templates/queues/js/package.json +1 -0
  36. package/templates/queues/js/wrangler.toml +3 -3
  37. package/templates/queues/ts/__dot__gitignore +172 -0
  38. package/templates/queues/ts/package.json +1 -0
  39. package/templates/queues/ts/wrangler.toml +3 -3
  40. package/templates/scheduled/js/__dot__gitignore +172 -0
  41. package/templates/scheduled/js/package.json +1 -0
  42. package/templates/scheduled/js/wrangler.toml +1 -1
  43. package/templates/scheduled/ts/__dot__gitignore +172 -0
  44. package/templates/scheduled/ts/package.json +1 -0
  45. package/templates/scheduled/ts/wrangler.toml +2 -2
  46. package/dist/angular/templates/tools/bundle.mjs +0 -77
  47. package/dist/angular/templates/tools/copy-client-files.mjs +0 -4
  48. package/dist/angular/templates/tools/copy-worker-files.mjs +0 -10
  49. package/dist/angular/templates/tsconfig.server.json +0 -5
  50. /package/templates/common/js/src/{worker.js → index.js} +0 -0
  51. /package/templates/common/ts/src/{worker.ts → index.ts} +0 -0
  52. /package/templates/hello-world/js/src/{worker.js → index.js} +0 -0
  53. /package/templates/hello-world/ts/src/{worker.ts → index.ts} +0 -0
  54. /package/templates/queues/js/src/{worker.js → index.js} +0 -0
  55. /package/templates/queues/ts/src/{worker.ts → index.ts} +0 -0
  56. /package/templates/scheduled/js/src/{worker.js → index.js} +0 -0
  57. /package/templates/scheduled/ts/src/{worker.ts → index.ts} +0 -0
package/package.json CHANGED
@@ -1,74 +1,86 @@
1
1
  {
2
- "name": "create-cloudflare",
3
- "version": "0.0.0-e4ef867c",
4
- "description": "A CLI for creating and deploying new applications to Cloudflare.",
5
- "keywords": [
6
- "cloudflare",
7
- "workers",
8
- "cloudflare workers",
9
- "serverless",
10
- "serverless application"
11
- ],
12
- "repository": {
13
- "type": "git",
14
- "url": "https://github.com/cloudflare/workers-sdk.git",
15
- "directory": "packages/create-cloudflare"
16
- },
17
- "license": "MIT OR Apache-2.0",
18
- "author": "wrangler@cloudflare.com",
19
- "exports": {
20
- ".": "./dist/cli.js"
21
- },
22
- "main": "./dist/cli.js",
23
- "bin": "./dist/cli.js",
24
- "files": [
25
- "dist",
26
- "templates"
27
- ],
28
- "scripts": {
29
- "build": "node scripts/build.js",
30
- "check:lint": "eslint .",
31
- "check:type": "tsc",
32
- "lint": "eslint",
33
- "prepublishOnly": "npm run build",
34
- "test:e2e": "npm run build && vitest run --config ./vitest-e2e.config.ts",
35
- "test:unit": "vitest run --config ./vitest.config.ts",
36
- "watch": "node scripts/build.js --watch"
37
- },
38
- "devDependencies": {
39
- "@babel/parser": "^7.21.3",
40
- "@babel/types": "^7.21.4",
41
- "@clack/prompts": "^0.6.3",
42
- "@cloudflare/eslint-config-worker": "*",
43
- "@cloudflare/workers-tsconfig": "*",
44
- "@cloudflare/workers-types": "^4.20230419.0",
45
- "@types/command-exists": "^1.2.0",
46
- "@types/cross-spawn": "^6.0.2",
47
- "@types/esprima": "^4.0.3",
48
- "@types/node": "^18.15.3",
49
- "@types/which-pm-runs": "^1.0.0",
50
- "@types/yargs": "^17.0.22",
51
- "@typescript-eslint/eslint-plugin": "^5.55.0",
52
- "@typescript-eslint/parser": "^5.55.0",
53
- "chalk": "^5.2.0",
54
- "command-exists": "^1.2.9",
55
- "cross-spawn": "^7.0.3",
56
- "esbuild": "^0.17.12",
57
- "execa": "^7.1.1",
58
- "haikunator": "^2.1.2",
59
- "log-update": "^5.0.1",
60
- "open": "^8.4.0",
61
- "recast": "^0.22.0",
62
- "semver": "^7.5.1",
63
- "typescript": "^5.0.2",
64
- "undici": "5.20.0",
65
- "vite-tsconfig-paths": "^4.0.8",
66
- "vitest": "^0.30.0",
67
- "which-pm-runs": "^1.1.0",
68
- "wrangler": "*",
69
- "yargs": "^17.7.1"
70
- },
71
- "engines": {
72
- "node": ">=16.13.0"
73
- }
74
- }
2
+ "name": "create-cloudflare",
3
+ "version": "0.0.0-e6ddf8a7",
4
+ "description": "A CLI for creating and deploying new applications to Cloudflare.",
5
+ "keywords": [
6
+ "cloudflare",
7
+ "workers",
8
+ "cloudflare workers",
9
+ "serverless",
10
+ "serverless application"
11
+ ],
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/cloudflare/workers-sdk.git",
15
+ "directory": "packages/create-cloudflare"
16
+ },
17
+ "license": "MIT OR Apache-2.0",
18
+ "author": "wrangler@cloudflare.com",
19
+ "exports": {
20
+ ".": "./dist/cli.js"
21
+ },
22
+ "main": "./dist/cli.js",
23
+ "bin": "./dist/cli.js",
24
+ "files": [
25
+ "dist",
26
+ "templates"
27
+ ],
28
+ "devDependencies": {
29
+ "@babel/parser": "^7.21.3",
30
+ "@babel/types": "^7.21.4",
31
+ "@clack/prompts": "^0.6.3",
32
+ "@cloudflare/eslint-config-worker": "*",
33
+ "@cloudflare/workers-types": "^4.20230419.0",
34
+ "@types/command-exists": "^1.2.0",
35
+ "@types/cross-spawn": "^6.0.2",
36
+ "@types/dns2": "^2.0.3",
37
+ "@types/esprima": "^4.0.3",
38
+ "@types/node": "^18.15.3",
39
+ "@types/semver": "^7.5.1",
40
+ "@types/shell-quote": "^1.7.2",
41
+ "@types/which-pm-runs": "^1.0.0",
42
+ "@types/yargs": "^17.0.22",
43
+ "@typescript-eslint/eslint-plugin": "^5.55.0",
44
+ "@typescript-eslint/parser": "^5.55.0",
45
+ "chalk": "^5.2.0",
46
+ "command-exists": "^1.2.9",
47
+ "cross-spawn": "^7.0.3",
48
+ "dns2": "^2.1.0",
49
+ "esbuild": "^0.17.12",
50
+ "execa": "^7.1.1",
51
+ "glob": "^10.3.3",
52
+ "haikunator": "^2.1.2",
53
+ "open": "^8.4.0",
54
+ "pnpm": "^8.10.0",
55
+ "recast": "^0.22.0",
56
+ "semver": "^7.5.1",
57
+ "shell-quote": "^1.8.1",
58
+ "typescript": "^5.0.2",
59
+ "undici": "5.20.0",
60
+ "vite-tsconfig-paths": "^4.0.8",
61
+ "which-pm-runs": "^1.1.0",
62
+ "yargs": "^17.7.1",
63
+ "yarn": "^1.22.19",
64
+ "@cloudflare/workers-tsconfig": "0.0.0",
65
+ "wrangler": "3.17.1",
66
+ "@cloudflare/cli": "1.0.0"
67
+ },
68
+ "engines": {
69
+ "node": ">=18.14.1"
70
+ },
71
+ "scripts": {
72
+ "build": "node -r esbuild-register scripts/build.ts",
73
+ "check:lint": "eslint .",
74
+ "check:type": "tsc",
75
+ "lint": "eslint",
76
+ "test:e2e:cleanup": "node -r esbuild-register scripts/e2eCleanup.ts",
77
+ "test:e2e:npm": "pnpm run build && cross-env TEST_PM=npm vitest run --config ./vitest-e2e.config.ts",
78
+ "test:e2e:pnpm": "pnpm run build && cross-env TEST_PM=pnpm vitest run --config ./vitest-e2e.config.ts",
79
+ "test:e2e:bun": "pnpm run build && cross-env TEST_PM=bun vitest run --config ./vitest-e2e.config.ts",
80
+ "test:e2e:yarn": "pnpm run build && cross-env TEST_PM=yarn vitest run --config ./vitest-e2e.config.ts",
81
+ "test:unit": "vitest run --config ./vitest.config.ts",
82
+ "test:unit:watch": "vitest --config ./vitest.config.ts",
83
+ "watch": "node -r esbuild-register scripts/build.ts --watch",
84
+ "test:ci": "vitest run --config ./vitest.config.ts"
85
+ }
86
+ }
@@ -17,8 +17,8 @@ The sample plugin allows ChatGPT users to search for repositories using GitHub's
17
17
  ## Usage
18
18
 
19
19
  1. You can configure the `.well-known/ai-plugin.json` route in `index.ts`.
20
- 2. Update the OpenAPI schema in `openapi.ts`.
21
- 3. You can set up any new routes and the associated OpenAPI schema by defining new routes. See `search.ts` for an example.
20
+ 2. You can set up any new routes and the associated OpenAPI schema by defining new routes. See `search.ts` for an example.
21
+ 3. For more information read the [itty-router-openapi official documentation](https://cloudflare.github.io/itty-router-openapi/).
22
22
 
23
23
  ## Deploying to OpenAI's API
24
24
 
@@ -0,0 +1,171 @@
1
+ # Logs
2
+
3
+ logs
4
+ _.log
5
+ npm-debug.log_
6
+ yarn-debug.log*
7
+ yarn-error.log*
8
+ lerna-debug.log*
9
+ .pnpm-debug.log*
10
+
11
+ # Diagnostic reports (https://nodejs.org/api/report.html)
12
+
13
+ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
14
+
15
+ # Runtime data
16
+
17
+ pids
18
+ _.pid
19
+ _.seed
20
+ \*.pid.lock
21
+
22
+ # Directory for instrumented libs generated by jscoverage/JSCover
23
+
24
+ lib-cov
25
+
26
+ # Coverage directory used by tools like istanbul
27
+
28
+ coverage
29
+ \*.lcov
30
+
31
+ # nyc test coverage
32
+
33
+ .nyc_output
34
+
35
+ # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
36
+
37
+ .grunt
38
+
39
+ # Bower dependency directory (https://bower.io/)
40
+
41
+ bower_components
42
+
43
+ # node-waf configuration
44
+
45
+ .lock-wscript
46
+
47
+ # Compiled binary addons (https://nodejs.org/api/addons.html)
48
+
49
+ build/Release
50
+
51
+ # Dependency directories
52
+
53
+ node_modules/
54
+ jspm_packages/
55
+
56
+ # Snowpack dependency directory (https://snowpack.dev/)
57
+
58
+ web_modules/
59
+
60
+ # TypeScript cache
61
+
62
+ \*.tsbuildinfo
63
+
64
+ # Optional npm cache directory
65
+
66
+ .npm
67
+
68
+ # Optional eslint cache
69
+
70
+ .eslintcache
71
+
72
+ # Optional stylelint cache
73
+
74
+ .stylelintcache
75
+
76
+ # Microbundle cache
77
+
78
+ .rpt2_cache/
79
+ .rts2_cache_cjs/
80
+ .rts2_cache_es/
81
+ .rts2_cache_umd/
82
+
83
+ # Optional REPL history
84
+
85
+ .node_repl_history
86
+
87
+ # Output of 'npm pack'
88
+
89
+ \*.tgz
90
+
91
+ # Yarn Integrity file
92
+
93
+ .yarn-integrity
94
+
95
+ # dotenv environment variable files
96
+
97
+ .env
98
+ .env.development.local
99
+ .env.test.local
100
+ .env.production.local
101
+ .env.local
102
+
103
+ # parcel-bundler cache (https://parceljs.org/)
104
+
105
+ .cache
106
+ .parcel-cache
107
+
108
+ # Next.js build output
109
+
110
+ .next
111
+ out
112
+
113
+ # Nuxt.js build / generate output
114
+
115
+ .nuxt
116
+ dist
117
+
118
+ # Gatsby files
119
+
120
+ .cache/
121
+
122
+ # Comment in the public line in if your project uses Gatsby and not Next.js
123
+
124
+ # https://nextjs.org/blog/next-9-1#public-directory-support
125
+
126
+ # public
127
+
128
+ # vuepress build output
129
+
130
+ .vuepress/dist
131
+
132
+ # vuepress v2.x temp and cache directory
133
+
134
+ .temp
135
+ .cache
136
+
137
+ # Docusaurus cache and generated files
138
+
139
+ .docusaurus
140
+
141
+ # Serverless directories
142
+
143
+ .serverless/
144
+
145
+ # FuseBox cache
146
+
147
+ .fusebox/
148
+
149
+ # DynamoDB Local files
150
+
151
+ .dynamodb/
152
+
153
+ # TernJS port file
154
+
155
+ .tern-port
156
+
157
+ # Stores VSCode versions used for testing VSCode extensions
158
+
159
+ .vscode-test
160
+
161
+ # yarn v2
162
+
163
+ .yarn/cache
164
+ .yarn/unplugged
165
+ .yarn/build-state.yml
166
+ .yarn/install-state.gz
167
+ .pnp.\*
168
+
169
+ # wrangler project
170
+
171
+ .dev.vars
@@ -4,10 +4,11 @@
4
4
  "private": true,
5
5
  "scripts": {
6
6
  "deploy": "wrangler deploy",
7
+ "dev": "wrangler dev",
7
8
  "start": "wrangler dev"
8
9
  },
9
10
  "dependencies": {
10
- "@cloudflare/itty-router-openapi": "^0.1.2"
11
+ "@cloudflare/itty-router-openapi": "^1.0.1"
11
12
  },
12
13
  "devDependencies": {
13
14
  "@cloudflare/workers-types": "^4.20230404.0",
@@ -1,9 +1,4 @@
1
- import {
2
- ApiException,
3
- OpenAPIRoute,
4
- Query,
5
- ValidationError,
6
- } from "@cloudflare/itty-router-openapi";
1
+ import { OpenAPIRoute, Query } from "@cloudflare/itty-router-openapi";
7
2
 
8
3
  export class GetSearch extends OpenAPIRoute {
9
4
  static schema = {
@@ -17,6 +12,7 @@ export class GetSearch extends OpenAPIRoute {
17
12
  },
18
13
  responses: {
19
14
  "200": {
15
+ description: "Successfully response",
20
16
  schema: {
21
17
  repos: [
22
18
  {
@@ -33,7 +29,7 @@ export class GetSearch extends OpenAPIRoute {
33
29
  };
34
30
 
35
31
  async handle(request: Request, env, ctx, data: Record<string, any>) {
36
- const url = `https://api.github.com/search/repositories?q=${data.q}`;
32
+ const url = `https://api.github.com/search/repositories?q=${data.query.q}`;
37
33
 
38
34
  const resp = await fetch(url, {
39
35
  headers: {
@@ -0,0 +1,172 @@
1
+ # Logs
2
+
3
+ logs
4
+ _.log
5
+ npm-debug.log_
6
+ yarn-debug.log*
7
+ yarn-error.log*
8
+ lerna-debug.log*
9
+ .pnpm-debug.log*
10
+
11
+ # Diagnostic reports (https://nodejs.org/api/report.html)
12
+
13
+ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
14
+
15
+ # Runtime data
16
+
17
+ pids
18
+ _.pid
19
+ _.seed
20
+ \*.pid.lock
21
+
22
+ # Directory for instrumented libs generated by jscoverage/JSCover
23
+
24
+ lib-cov
25
+
26
+ # Coverage directory used by tools like istanbul
27
+
28
+ coverage
29
+ \*.lcov
30
+
31
+ # nyc test coverage
32
+
33
+ .nyc_output
34
+
35
+ # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
36
+
37
+ .grunt
38
+
39
+ # Bower dependency directory (https://bower.io/)
40
+
41
+ bower_components
42
+
43
+ # node-waf configuration
44
+
45
+ .lock-wscript
46
+
47
+ # Compiled binary addons (https://nodejs.org/api/addons.html)
48
+
49
+ build/Release
50
+
51
+ # Dependency directories
52
+
53
+ node_modules/
54
+ jspm_packages/
55
+
56
+ # Snowpack dependency directory (https://snowpack.dev/)
57
+
58
+ web_modules/
59
+
60
+ # TypeScript cache
61
+
62
+ \*.tsbuildinfo
63
+
64
+ # Optional npm cache directory
65
+
66
+ .npm
67
+
68
+ # Optional eslint cache
69
+
70
+ .eslintcache
71
+
72
+ # Optional stylelint cache
73
+
74
+ .stylelintcache
75
+
76
+ # Microbundle cache
77
+
78
+ .rpt2_cache/
79
+ .rts2_cache_cjs/
80
+ .rts2_cache_es/
81
+ .rts2_cache_umd/
82
+
83
+ # Optional REPL history
84
+
85
+ .node_repl_history
86
+
87
+ # Output of 'npm pack'
88
+
89
+ \*.tgz
90
+
91
+ # Yarn Integrity file
92
+
93
+ .yarn-integrity
94
+
95
+ # dotenv environment variable files
96
+
97
+ .env
98
+ .env.development.local
99
+ .env.test.local
100
+ .env.production.local
101
+ .env.local
102
+
103
+ # parcel-bundler cache (https://parceljs.org/)
104
+
105
+ .cache
106
+ .parcel-cache
107
+
108
+ # Next.js build output
109
+
110
+ .next
111
+ out
112
+
113
+ # Nuxt.js build / generate output
114
+
115
+ .nuxt
116
+ dist
117
+
118
+ # Gatsby files
119
+
120
+ .cache/
121
+
122
+ # Comment in the public line in if your project uses Gatsby and not Next.js
123
+
124
+ # https://nextjs.org/blog/next-9-1#public-directory-support
125
+
126
+ # public
127
+
128
+ # vuepress build output
129
+
130
+ .vuepress/dist
131
+
132
+ # vuepress v2.x temp and cache directory
133
+
134
+ .temp
135
+ .cache
136
+
137
+ # Docusaurus cache and generated files
138
+
139
+ .docusaurus
140
+
141
+ # Serverless directories
142
+
143
+ .serverless/
144
+
145
+ # FuseBox cache
146
+
147
+ .fusebox/
148
+
149
+ # DynamoDB Local files
150
+
151
+ .dynamodb/
152
+
153
+ # TernJS port file
154
+
155
+ .tern-port
156
+
157
+ # Stores VSCode versions used for testing VSCode extensions
158
+
159
+ .vscode-test
160
+
161
+ # yarn v2
162
+
163
+ .yarn/cache
164
+ .yarn/unplugged
165
+ .yarn/build-state.yml
166
+ .yarn/install-state.gz
167
+ .pnp.\*
168
+
169
+ # wrangler project
170
+
171
+ .dev.vars
172
+ .wrangler/
@@ -4,6 +4,7 @@
4
4
  "private": true,
5
5
  "scripts": {
6
6
  "deploy": "wrangler deploy",
7
+ "dev": "wrangler dev",
7
8
  "start": "wrangler dev"
8
9
  },
9
10
  "devDependencies": {
@@ -1,5 +1,5 @@
1
1
  name = "<TBD>"
2
- main = "src/worker.js"
2
+ main = "src/index.js"
3
3
  compatibility_date = "<TBD>"
4
4
 
5
5
  # Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
@@ -35,7 +35,7 @@ compatibility_date = "<TBD>"
35
35
  # Docs: https://developers.cloudflare.com/workers/platform/services
36
36
  # [[services]]
37
37
  # binding = "MY_SERVICE"
38
- # service = "/api/*"
38
+ # service = "my-service"
39
39
 
40
40
  # Bind a Durable Object. Durable objects are a scale-to-zero compute primitive based on the actor model.
41
41
  # Durable Objects can live for as long as needed. Use these when you need a long-running "server", such as in realtime apps.