@openwebf/webf 0.1.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/CLAUDE.md +206 -0
- package/README-zhCN.md +256 -0
- package/README.md +232 -0
- package/bin/webf.js +25 -0
- package/coverage/clover.xml +1295 -0
- package/coverage/coverage-final.json +12 -0
- package/coverage/lcov-report/IDLBlob.ts.html +142 -0
- package/coverage/lcov-report/analyzer.ts.html +2158 -0
- package/coverage/lcov-report/analyzer_original.ts.html +1450 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/commands.ts.html +700 -0
- package/coverage/lcov-report/dart.ts.html +490 -0
- package/coverage/lcov-report/declaration.ts.html +337 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/generator.ts.html +1171 -0
- package/coverage/lcov-report/index.html +266 -0
- package/coverage/lcov-report/logger.ts.html +424 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/react.ts.html +619 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov-report/utils.ts.html +466 -0
- package/coverage/lcov-report/vue.ts.html +613 -0
- package/coverage/lcov.info +2149 -0
- package/global.d.ts +2 -0
- package/jest.config.js +24 -0
- package/package.json +36 -0
- package/src/IDLBlob.ts +20 -0
- package/src/analyzer.ts +692 -0
- package/src/commands.ts +645 -0
- package/src/dart.ts +170 -0
- package/src/declaration.ts +84 -0
- package/src/generator.ts +454 -0
- package/src/logger.ts +114 -0
- package/src/react.ts +186 -0
- package/src/utils.ts +127 -0
- package/src/vue.ts +176 -0
- package/templates/class.dart.tpl +86 -0
- package/templates/gitignore.tpl +2 -0
- package/templates/react.component.tsx.tpl +53 -0
- package/templates/react.createComponent.tpl +286 -0
- package/templates/react.index.ts.tpl +8 -0
- package/templates/react.package.json.tpl +26 -0
- package/templates/react.tsconfig.json.tpl +16 -0
- package/templates/react.tsup.config.ts.tpl +10 -0
- package/templates/tsconfig.json.tpl +8 -0
- package/templates/vue.component.partial.tpl +31 -0
- package/templates/vue.components.d.ts.tpl +49 -0
- package/templates/vue.package.json.tpl +11 -0
- package/templates/vue.tsconfig.json.tpl +15 -0
- package/test/IDLBlob.test.ts +75 -0
- package/test/analyzer.test.ts +370 -0
- package/test/commands.test.ts +1253 -0
- package/test/generator.test.ts +460 -0
- package/test/logger.test.ts +215 -0
- package/test/react.test.ts +49 -0
- package/test/utils.test.ts +316 -0
- package/tsconfig.json +30 -0
package/global.d.ts
ADDED
package/jest.config.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
preset: 'ts-jest',
|
|
3
|
+
testEnvironment: 'node',
|
|
4
|
+
roots: ['<rootDir>/src', '<rootDir>/test'],
|
|
5
|
+
testMatch: ['**/__tests__/**/*.ts', '**/*.test.ts', '**/*.spec.ts'],
|
|
6
|
+
collectCoverageFrom: [
|
|
7
|
+
'src/**/*.ts',
|
|
8
|
+
'!src/**/*.d.ts',
|
|
9
|
+
'!src/**/__tests__/**',
|
|
10
|
+
],
|
|
11
|
+
coverageThreshold: {
|
|
12
|
+
global: {
|
|
13
|
+
branches: 70,
|
|
14
|
+
functions: 70,
|
|
15
|
+
lines: 70,
|
|
16
|
+
statements: 70,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
moduleFileExtensions: ['ts', 'js', 'json'],
|
|
20
|
+
transform: {
|
|
21
|
+
'^.+\\.ts$': 'ts-jest',
|
|
22
|
+
},
|
|
23
|
+
testTimeout: 10000,
|
|
24
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@openwebf/webf",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Command line tools for WebF",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"webf": "./bin/webf.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"test": "jest",
|
|
12
|
+
"test:watch": "jest --watch",
|
|
13
|
+
"test:coverage": "jest --coverage"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [],
|
|
16
|
+
"author": "",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"type": "commonjs",
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@types/inquirer": "^8.2.11",
|
|
21
|
+
"@types/jest": "^29.5.12",
|
|
22
|
+
"@types/lodash": "^4.17.17",
|
|
23
|
+
"@types/node": "^22.15.21",
|
|
24
|
+
"@types/yaml": "^1.9.6",
|
|
25
|
+
"jest": "^29.7.0",
|
|
26
|
+
"ts-jest": "^29.1.2"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"commander": "^14.0.0",
|
|
30
|
+
"glob": "^10.3.10",
|
|
31
|
+
"inquirer": "^8.2.6",
|
|
32
|
+
"lodash": "^4.17.21",
|
|
33
|
+
"typescript": "^5.8.3",
|
|
34
|
+
"yaml": "^2.8.0"
|
|
35
|
+
}
|
|
36
|
+
}
|
package/src/IDLBlob.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {ClassObject, FunctionObject} from "./declaration";
|
|
2
|
+
|
|
3
|
+
export class IDLBlob {
|
|
4
|
+
raw: string = '';
|
|
5
|
+
dist: string;
|
|
6
|
+
source: string;
|
|
7
|
+
filename: string;
|
|
8
|
+
implement: string;
|
|
9
|
+
relativeDir: string = '';
|
|
10
|
+
objects: (ClassObject | FunctionObject)[] = [];
|
|
11
|
+
|
|
12
|
+
constructor(source: string, dist: string, filename: string, implement: string, relativeDir: string = '') {
|
|
13
|
+
this.source = source;
|
|
14
|
+
this.dist = dist;
|
|
15
|
+
this.filename = filename;
|
|
16
|
+
this.implement = implement;
|
|
17
|
+
this.relativeDir = relativeDir;
|
|
18
|
+
// Don't read file in constructor - let the generator handle it
|
|
19
|
+
}
|
|
20
|
+
}
|