@jay-framework/compiler 0.5.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/dist/index.d.ts +77 -0
- package/dist/index.js +1918 -0
- package/package.json +55 -0
- package/readme.md +41 -0
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jay-framework/compiler",
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"directories": {
|
|
8
|
+
"lib": "lib"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"readme.md"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "npm run build:js && npm run build:types",
|
|
16
|
+
"build:watch": "npm run build:js -- --watch & npm run build:types -- --watch",
|
|
17
|
+
"build:js": "vite build",
|
|
18
|
+
"build:types": "tsup lib/index.ts --dts-only --format cjs",
|
|
19
|
+
"build:check-types": "tsc",
|
|
20
|
+
"clean": "rimraf dist",
|
|
21
|
+
"confirm": "npm run clean && npm run build && npm run build:check-types && npm run test",
|
|
22
|
+
"test": "vitest run",
|
|
23
|
+
"test:watch": "vitest"
|
|
24
|
+
},
|
|
25
|
+
"author": "",
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@jay-framework/compiler-analyze-exported-types": "workspace:^",
|
|
28
|
+
"@jay-framework/compiler-jay-html": "workspace:^",
|
|
29
|
+
"@jay-framework/compiler-shared": "workspace:^",
|
|
30
|
+
"@jay-framework/component": "workspace:^",
|
|
31
|
+
"@jay-framework/runtime": "workspace:^",
|
|
32
|
+
"@jay-framework/secure": "workspace:^",
|
|
33
|
+
"@types/js-yaml": "^4.0.9",
|
|
34
|
+
"change-case": "^4.1.2",
|
|
35
|
+
"js-yaml": "^4.1.0",
|
|
36
|
+
"node-html-parser": "^6.1.12",
|
|
37
|
+
"pluralize": "^8.0.0",
|
|
38
|
+
"style-to-object": "^1.0.8",
|
|
39
|
+
"typescript": "^5.3.3"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@caiogondim/strip-margin": "^1.0.0",
|
|
43
|
+
"@jay-framework/dev-environment": "workspace:^",
|
|
44
|
+
"@testing-library/jest-dom": "^6.2.0",
|
|
45
|
+
"@types/js-beautify": "^1",
|
|
46
|
+
"@types/node": "^20.11.5",
|
|
47
|
+
"jest-diff": "^29.7.0",
|
|
48
|
+
"jest-matcher-utils": "^29.7.0",
|
|
49
|
+
"js-beautify": "^1.14.11",
|
|
50
|
+
"rimraf": "^5.0.5",
|
|
51
|
+
"tsup": "^8.0.1",
|
|
52
|
+
"vite": "^5.0.11",
|
|
53
|
+
"vitest": "^1.2.1"
|
|
54
|
+
}
|
|
55
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Jay Compiler
|
|
2
|
+
|
|
3
|
+
The Jay Compiler is the core library to build and transform jay HTML files and jay component source files.
|
|
4
|
+
|
|
5
|
+
The library includes the functionality to
|
|
6
|
+
|
|
7
|
+
- For Jay HTML files
|
|
8
|
+
- [Parse Jay HTML files](../compiler-jay-html/readme.md)
|
|
9
|
+
- [Parse Jay HTML expressions](../compiler-jay-html/readme.md#the--binding)
|
|
10
|
+
- Generate Jay HTML definition files (.d.ts)
|
|
11
|
+
- Generate Jay element files (runtime generated for Jay HTML files)
|
|
12
|
+
- Generate Jay element bridge files (running in sandbox environment for secure setup)
|
|
13
|
+
- Compiler Patterns
|
|
14
|
+
- [Compile Compiler Patterns](../compiler-jay-html/docs/compiler-patterns.md)
|
|
15
|
+
- For Component Files
|
|
16
|
+
- Extract component exported types
|
|
17
|
+
- Generate component definition files
|
|
18
|
+
- Generate component bridge files (running in main environment for secure setup)
|
|
19
|
+
- Transform component event handlers and `exec$` APIs by compiler patterns
|
|
20
|
+
- Jay JSX files
|
|
21
|
+
- Will support JSX style Jay Components. Not ready for usage.
|
|
22
|
+
|
|
23
|
+
## Compile Target
|
|
24
|
+
|
|
25
|
+
The compiler supports two compile targets - `Jay` and `React` (default `Jay`).
|
|
26
|
+
The compile target only impacts how Jay Elements are generated, not including the `.d.ts` element files.
|
|
27
|
+
|
|
28
|
+
See examples of `Jay` compile targets at [jay](..%2F..%2F..%2Fexamples%2Fjay),
|
|
29
|
+
and examples of `React` compile target at [@jay-framework/4-react](..%2F..%2F..%2Fexamples%2F4-react).
|
|
30
|
+
|
|
31
|
+
## package structure
|
|
32
|
+
|
|
33
|
+
The main folders in the compiler package are:
|
|
34
|
+
|
|
35
|
+
- [components-files](lib/components-files) - contains the typescript generators and transformers for component files
|
|
36
|
+
- [basic-analyzers](lib/components-files/basic-analyzers) - low level analyzers to detect what is an identifier,
|
|
37
|
+
pattern matching on AST, etc.
|
|
38
|
+
- [building-blocks](lib/components-files/building-blocks) - building blocks for type script component file transformations
|
|
39
|
+
- [jay-html-files](../compiler-jay-html) - contains the jay-html file parsing and code generators
|
|
40
|
+
- [expressions](../compiler-jay-html/lib/expressions) - contains the expressions parse used by jay-html files bindings
|
|
41
|
+
- [analyze-exported-types](../compiler-analyze-exported-types) - analyzes exported types for component files
|