初始化

This commit is contained in:
Yuan 2023-12-19 14:20:48 +08:00
commit deb355c0f2
13 changed files with 2057 additions and 0 deletions

9
.editorconfig Normal file
View File

@ -0,0 +1,9 @@
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

21
.eslintrc Normal file
View File

@ -0,0 +1,21 @@
{
"root": true,
"env": {
"browser": true,
"es2021": true
},
"plugins": ["@typescript-eslint", "prettier"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"prettier/prettier": "error"
}
}

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
node_modules

9
dist/Section/Section.d.ts vendored Normal file
View File

@ -0,0 +1,9 @@
import { GraphicData, JlGraphic } from 'jl-graphic';
import { IPointData } from 'pixi.js';
export interface ISectionData extends GraphicData {
code: string;
points: IPointData[];
}
export declare class Section extends JlGraphic {
doRepaint(): void;
}

9
dist/Section/Section.js vendored Normal file
View File

@ -0,0 +1,9 @@
import { JlGraphic } from 'jl-graphic';
class Section extends JlGraphic {
doRepaint() {
console.log('repaint');
}
}
export { Section };

4
dist/Turnout/Turnout.d.ts vendored Normal file
View File

@ -0,0 +1,4 @@
import { JlGraphic } from "jl-graphic";
export declare class Turnout extends JlGraphic {
doRepaint(): void;
}

9
dist/Turnout/Turnout.js vendored Normal file
View File

@ -0,0 +1,9 @@
import { JlGraphic } from 'jl-graphic';
class Turnout extends JlGraphic {
doRepaint() {
console.log(111);
}
}
export { Turnout };

35
package.json Normal file
View File

@ -0,0 +1,35 @@
{
"name": "rt-graphic-component",
"version": "0.0.1",
"description": "图形库",
"type": "module",
"private": true,
"main": "dist",
"repository": {
"type": "git",
"url": "https://git.code.tencent.com/jl-framework/rt-graphic-component.git"
},
"author": "",
"license": "ISC",
"scripts": {
"build": "rollup -c rollup.config.js"
},
"dependencies": {
"jl-graphic": "git+https://git.code.tencent.com/jl-framework/graphic-pixi.git#v0.1.0"
},
"devDependencies": {
"@rollup/plugin-typescript": "^11.1.5",
"@types/node": "^20.10.5",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.0.1",
"prettier": "^3.1.1",
"rollup": "^4.9.1",
"typescript": "^5.3.3"
},
"engines": {
"node": ">= 14.19",
"npm": ">= 6.13.4",
"yarn": ">= 1.21.1"
}
}

View File

@ -0,0 +1,16 @@
import { GraphicData, JlGraphic } from 'jl-graphic'
import { IPointData } from 'pixi.js'
export interface ISectionData extends GraphicData {
code: string
points: IPointData[]
}
export class Section extends JlGraphic {
doRepaint(): void {
console.log('repaint')
}
}

View File

@ -0,0 +1,8 @@
import { JlGraphic } from "jl-graphic";
export class Turnout extends JlGraphic {
doRepaint(): void {
console.log(111)
}
}

36
rollup.config.js Normal file
View File

@ -0,0 +1,36 @@
const { resolve } = require("path");
const { readdirSync } = require("fs");
const typescript = require("@rollup/plugin-typescript");
/**
* @type {import('rollup').RollupOptions}
*/
const config = {
external: ["jl-graphic"],
input: getEntryPoints(),
output: {
dir: "dist",
format: "esm",
preserveModules: true,
},
plugins: [
typescript({
tsconfig: "./tsconfig.json",
compilerOptions: {
declaration: true,
declarationDir: "dist",
},
}),
],
};
module.exports = config;
function getEntryPoints() {
const packageDir = resolve(__dirname, "packages");
const entryPoints = readdirSync(packageDir, { withFileTypes: true })
.filter((dirent) => dirent.isDirectory())
.map((dirent) => resolve(packageDir, dirent.name, `${dirent.name}.ts`));
console.log(entryPoints);
return entryPoints;
}

14
tsconfig.json Normal file
View File

@ -0,0 +1,14 @@
{
"compilerOptions": {
"baseUrl": ".",
"allowJs": false,
"module": "ESNext",
"target": "ESNext",
"moduleResolution": "Node",
"strict": true,
"isolatedModules": true,
"lib": ["ESNext", "DOM"]
},
"include": ["packages/**/*.ts"],
"exclude": ["node_modules", "dist"]
}

1886
yarn.lock Normal file

File diff suppressed because it is too large Load Diff