@codecanvas-ide/engine 0.1.0 → 0.3.0
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 +15 -2
- package/dist/codecanvas-engine.js +147 -139
- package/dist/index.js +666 -201
- package/dist/index.js.map +4 -4
- package/dist/types/arrange.d.ts +6 -0
- package/dist/types/canvas.d.ts +4 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/layout.d.ts +7 -0
- package/dist/types/layoutRules.d.ts +26 -1
- package/dist/types/parse.d.ts +8 -1
- package/dist/types/project.d.ts +28 -23
- package/dist/types/projectServer.d.ts +3 -2
- package/dist/types/react.d.ts +30 -0
- package/dist/types/remoteProject.d.ts +3 -1
- package/dist/types/styles.d.ts +1 -1
- package/dist/types/syntax.d.ts +3 -0
- package/dist/types/types.d.ts +15 -2
- package/dist/types/workspace.d.ts +45 -0
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# @codecanvas-ide/engine
|
|
2
2
|
|
|
3
|
-
The canvas of [CodeCanvas](https://github.com/d-feliz/codecanvas-ide): it shows a TypeScript
|
|
4
|
-
zoomable diagram and lets you edit it there. Every function, class, variable and import is a block;
|
|
3
|
+
The canvas of [CodeCanvas](https://github.com/d-feliz/codecanvas-ide): it shows a TypeScript or JavaScript
|
|
4
|
+
file as a zoomable diagram and lets you edit it there. Every function, class, variable and import is a block;
|
|
5
5
|
usages are drawn as lines; anything changed on the canvas is written back to the text.
|
|
6
6
|
|
|
7
7
|
- Blocks with previews, nested blocks, and a stable layout you can save in the repo
|
|
8
8
|
- Usage lines, references across files, rename across files (TypeScript language service)
|
|
9
9
|
- Syntax and type errors on the blocks
|
|
10
|
+
- React: components, state and render links, turned on by itself in React files; the toolbar
|
|
11
|
+
shows the language (JS, TS, React JS/TS/JSX/TSX), also as `model.language`
|
|
10
12
|
- Changes against a base version (e.g. the last commit), and merge conflicts
|
|
11
13
|
- No framework: plain TypeScript and the DOM
|
|
12
14
|
|
|
@@ -31,6 +33,17 @@ const canvas = new CodeCanvas(document.getElementById('canvas')!, {
|
|
|
31
33
|
canvas.openFile('src/cart.ts', cartText);
|
|
32
34
|
```
|
|
33
35
|
|
|
36
|
+
Give the project the folder's TypeScript settings, so imports resolve as in the editor. In a monorepo,
|
|
37
|
+
pass every config file and `package.json`: each config gets its own program, and packages that import
|
|
38
|
+
each other by name resolve to their source.
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
project.setWorkspace({
|
|
42
|
+
configFiles: [{ path: 'packages/web/tsconfig.json', text: webConfigText }],
|
|
43
|
+
packageFiles: { 'packages/utils/package.json': utilsManifestText },
|
|
44
|
+
});
|
|
45
|
+
```
|
|
46
|
+
|
|
34
47
|
To keep TypeScript work off the page's thread, run the project in a worker: `serveProject(self)` in the
|
|
35
48
|
worker script, and `connectProjectWorker(worker)` in place of `new Project()` on the page.
|
|
36
49
|
|