@danielx/civet 0.2.15 → 0.3.1
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 +9 -7
- package/dist/browser.js +730 -350
- package/dist/browser.js.map +3 -3
- package/dist/civet +14 -13
- package/dist/cli.js.map +4 -4
- package/dist/main.js +735 -355
- package/dist/types.d.ts +24 -5
- package/package.json +8 -1
- package/register.mjs +37 -10
package/README.md
CHANGED
|
@@ -3,9 +3,10 @@ Civet
|
|
|
3
3
|
|
|
4
4
|
[](https://github.com/DanielXMoore/Civet/actions/workflows/build.yml)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
The CoffeeScript of TypeScript. Much closer to ES2015+ (for better or worse).
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
- [Online Civet Playground](https://civet-web.vercel.app/)
|
|
9
|
+
- [Civet VSCode Extension](https://marketplace.visualstudio.com/items?itemName=DanielX.civet)
|
|
9
10
|
|
|
10
11
|
Quickstart Guide
|
|
11
12
|
---
|
|
@@ -15,8 +16,8 @@ Quickstart Guide
|
|
|
15
16
|
npm install -g @danielx/civet
|
|
16
17
|
# Compile civet source file to typescript
|
|
17
18
|
civet < source.civet > output.ts
|
|
18
|
-
# Execute a civet source file in node
|
|
19
|
-
node --loader @danielx/civet/
|
|
19
|
+
# Execute a civet source file in node using ts-node
|
|
20
|
+
node --loader ts-node/esm --loader @danielx/civet/esm source.civet
|
|
20
21
|
```
|
|
21
22
|
|
|
22
23
|

|
|
@@ -89,9 +90,10 @@ Things Kept from CoffeeScript
|
|
|
89
90
|
- `@` This shorthand `@` -> `this`, `@id` -> `this.id`
|
|
90
91
|
- Prototype shorthand `X::` -> `X.prototype`, `X::a` -> `X.prototype.a`
|
|
91
92
|
- Postfix `if/unless`
|
|
93
|
+
- Block Strings `"""` / `'''`
|
|
92
94
|
- JSX 😿
|
|
93
95
|
- TODO
|
|
94
|
-
- [ ] `"""`
|
|
96
|
+
- [ ] `"""` String interpolation (for compatibility with existing .coffee code)
|
|
95
97
|
- [ ] Chained comparisons
|
|
96
98
|
|
|
97
99
|
Things Removed from CoffeeScript
|
|
@@ -103,11 +105,11 @@ Things Removed from CoffeeScript
|
|
|
103
105
|
- `do` keyword (replaced with JS `do`)
|
|
104
106
|
- `for from` (use JS `for of`)
|
|
105
107
|
- Array slices `list[0...2]` (use `list.slice(0, 2)`)
|
|
106
|
-
- Slice assignment `numbers[3..6] = [-3, -4, -5, -6]`
|
|
108
|
+
- Slice assignment `numbers[3..6] = [-3, -4, -5, -6]` (use `numbers.splice(3, 4, -3, -4, -5, -6)`)
|
|
107
109
|
- Comprensions (a case could be made for keeping them)
|
|
108
110
|
- Iteration expression results
|
|
109
111
|
- Implicit declarations
|
|
110
|
-
- Implicit returns (will probably add later)
|
|
112
|
+
- Implicit returns (will probably add later at least for single line functions)
|
|
111
113
|
- Rest parameter in any assignment position (might add later)
|
|
112
114
|
- Postfix `while/until`
|
|
113
115
|
- `///` Heregexp
|