初始化
This commit is contained in:
commit
deb355c0f2
|
@ -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
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
node_modules
|
|
@ -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;
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
import { JlGraphic } from 'jl-graphic';
|
||||
|
||||
class Section extends JlGraphic {
|
||||
doRepaint() {
|
||||
console.log('repaint');
|
||||
}
|
||||
}
|
||||
|
||||
export { Section };
|
|
@ -0,0 +1,4 @@
|
|||
import { JlGraphic } from "jl-graphic";
|
||||
export declare class Turnout extends JlGraphic {
|
||||
doRepaint(): void;
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
import { JlGraphic } from 'jl-graphic';
|
||||
|
||||
class Turnout extends JlGraphic {
|
||||
doRepaint() {
|
||||
console.log(111);
|
||||
}
|
||||
}
|
||||
|
||||
export { Turnout };
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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')
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
import { JlGraphic } from "jl-graphic";
|
||||
|
||||
export class Turnout extends JlGraphic {
|
||||
|
||||
doRepaint(): void {
|
||||
console.log(111)
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
|
@ -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"]
|
||||
}
|
Loading…
Reference in New Issue