You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: update root /templates to use wrangler generate instead of create-cloudflare@v1 (#3452)
* chore: update templates to use --no-delegate-c3 for all init commands.
* update templates to use wrangler generate
* prettier fixes
* remove mention of c3 since template instructions now rely on wrangler generate
* prettier fix
Copy file name to clipboardExpand all lines: templates/README.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -12,13 +12,13 @@ There are a few ways to quickly jumpstart your next project using one of the tem
12
12
13
13
1.**Local development, via CLI quickstart utility**
14
14
15
-
We recommend using the `npm create cloudflare@1 [folder-name] [template-name]` command to create new projects with templates.
16
-
17
-
You may select the name of any subdirectory within this repository to create your project; for example, `worker-typescript` and `examples/fast-google-fonts` are both valid subdirectory names.
15
+
We recommend using the `npx wrangler generate [folder-name] [template-name]` command to create new projects with templates.
18
16
19
17
To create a `my-project` directory using the [`worker-typescript`](/worker-typescript) template, you would run the following command:
Further documentation for Wrangler can be found [here](https://developers.cloudflare.com/workers/tooling/wrangler).
16
20
17
-
####Dart
21
+
## Dart
18
22
19
23
After installing Dart per the linked instructions above,
20
24
21
-
```
25
+
```sh
22
26
cd projectname
27
+
```
23
28
24
-
# run once to get dependencies
29
+
Then run the following to get dependencies:
30
+
31
+
```sh
25
32
pub get
26
33
27
34
dart2js -O2 --server-mode -o index.js index.dart
@@ -31,11 +38,11 @@ That will compile your code into index.js, after which you can run `wrangler dep
31
38
32
39
For more information on how Dart translates to JavaScript, see the [docs for dart2js](https://dart.dev/tools/dart2js) and the [interop guide](https://dart.dev/web/js-interop).
33
40
34
-
####Errors
41
+
## Errors
35
42
36
43
Dart `2.13.0` and above require the `dart2js --server-mode` flag when using native JavaScript classes. Server mode is used to compile JS to run on server side VMs such as nodejs. If this flag is not used, the following errors are displayed:
37
44
38
-
```
45
+
```sh
39
46
index.dart:4:7:
40
47
Error: JS interop class 'Request' conflicts with natively supported class '_Request'in'dart:html'.
> **Note:** Each command invokes [`create-cloudflare`](https://www.npmjs.com/package/create-cloudflare) for project creation.
27
-
28
26
## Credits
29
27
30
28
Shoutout to [Surma](https://twitter.com/dassurma) for his [webpack-emscripten-wasm](https://gist.github.com/surma/b2705b6cca29357ebea1c9e6e15684cc) gist that was instrumental in getting this working!
Copy file name to clipboardExpand all lines: templates/experimental/worker-kotlin/README.md
+12
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,18 @@ Your Kotlin code in [main.kt](https://github.com/cloudflare/kotlin-worker-hello-
4
4
5
5
In addition to [Wrangler v2.x](https://github.com/cloudflare/wrangler2) you will need to install Kotlin, including a JDK and support for Gradle projects. The easiest way to do this is using the free Community Edition of [IntelliJ IDEA](https://kotlinlang.org/docs/tutorials/jvm-get-started.html).
6
6
7
+
## Setup
8
+
9
+
To create a `my-project` directory using this template, run:
Copy file name to clipboardExpand all lines: templates/experimental/worker-perl/README.md
+14-6
Original file line number
Diff line number
Diff line change
@@ -4,21 +4,29 @@ Your Perl code in [index.pl](https://github.com/cloudflare/perl-worker-hello-wor
4
4
5
5
In addition to [Wrangler](https://github.com/cloudflare/wrangler) you will need to install Perl 5 and [Perlito](https://github.com/fglock/Perlito), a compiler from Perl to Java and JavaScript. Clone Perlito from GitHub (last tested on commit 97c296f), don't install the older version available on CPAN.
6
6
7
-
#### Wrangler
7
+
##Setup
8
8
9
-
To generate using [wrangler](https://github.com/cloudflare/wrangler)
9
+
To create a `my-project` directory using this template, run:
Copy file name to clipboardExpand all lines: templates/experimental/worker-python/README.md
+18-8
Original file line number
Diff line number
Diff line change
@@ -4,19 +4,29 @@ Your Python code in [index.py](https://github.com/cloudflare/python-worker-hello
4
4
5
5
In addition to [Wrangler](https://github.com/cloudflare/wrangler2) and [npm](https://www.npmjs.com/get-npm), you will need to install [Transcrypt](https://www.transcrypt.org/docs/html/installation_use.html), including Python 3.7 and virtualenv.
Wrangler is used to develop, deploy, and configure your Worker via CLI.
14
22
15
-
#### Transcrypt
23
+
Further documentation for Wrangler can be found [here](https://developers.cloudflare.com/workers/tooling/wrangler).
24
+
25
+
## Transcrypt
16
26
17
27
Before building your project, you'll need to do one-time setup of Transcrypt. Assuming you have Python 3.7 and virtualenv installed per the linked instructions above, that setup on unix systems looks like the following (for windows see [virtualenv docs](https://virtualenv.pypa.io/en/latest/user_guide.html#activators)):
18
28
19
-
```
29
+
```sh
20
30
cd projectname
21
31
22
32
virtualenv env
@@ -34,7 +44,7 @@ For more information on how Python translates to Javascript, see the [Transcrypt
34
44
35
45
Because of aliases, for a KV namespace binding named `KV` you can use `KV.put` normally, but need to use `KV.js_get` instead of `KV.get`. For example, a handler using KV might look like:
Copy file name to clipboardExpand all lines: templates/experimental/worker-reason/README.md
+14-6
Original file line number
Diff line number
Diff line change
@@ -4,21 +4,29 @@ Your [Reason](https://reasonml.github.io/) code in [Demo.re](https://github.com/
4
4
5
5
In addition to [Wrangler](https://github.com/cloudflare/wrangler) you will need to [install BuckleScript](https://reasonml.github.io/docs/en/installation) using npm or Yarn.
6
6
7
-
#### Wrangler
7
+
##Setup
8
8
9
-
To generate using [wrangler](https://github.com/cloudflare/wrangler)
9
+
To create a `my-project` directory using this template, run:
Copy file name to clipboardExpand all lines: templates/experimental/worker-scala-kv/README.md
+13-7
Original file line number
Diff line number
Diff line change
@@ -4,23 +4,29 @@
4
4
5
5
In addition to [Wrangler](https://github.com/cloudflare/wrangler) you will need to install the Scala build tool [sbt](https://www.scala-sbt.org/1.x/docs/Setup.html), including a JDK.
6
6
7
-
#### Wrangler
7
+
##Setup
8
8
9
-
To generate using [wrangler](https://github.com/cloudflare/wrangler)
9
+
To create a `my-project` directory using this template, run:
Copy file name to clipboardExpand all lines: templates/experimental/worker-scala/README.md
+14-6
Original file line number
Diff line number
Diff line change
@@ -4,21 +4,29 @@ Your Scala code in [Main.scala](https://github.com/cloudflare/scala-worker-hello
4
4
5
5
In addition to [Wrangler](https://github.com/cloudflare/wrangler) you will need to install the Scala build tool [sbt](https://www.scala-sbt.org/1.x/docs/Setup.html), including a JDK.
6
6
7
-
#### Wrangler
7
+
##Setup
8
8
9
-
To generate using [wrangler](https://github.com/cloudflare/wrangler)
9
+
To create a `my-project` directory using this template, run:
0 commit comments