Compare commits

..

No commits in common. "main" and "0.1" have entirely different histories.
main ... 0.1

8 changed files with 20 additions and 142 deletions

View File

@ -1,25 +0,0 @@
## 生产接口协议
本项目使用typescript编写IDE推荐使用vscode。
### 术语表
| 中文 | CAD | MES | IMES | 备注 |
| --- | --- | --- | --- | --- |
| 房名 | RoomName | roomName | roomName | |
| 柜名 | CabinetName | boxName | bodyName | |
| 小板名 | BoardName | blockName | blockName | |
| 材质 | Material | material | material | |
| 大板名 | 无 | boardName | goodsName | |
| 余料 | 无 | scrap | remain | |
| 排单 | 无 | planOrder |planOrder | |
### 编译与发布
更新 package.json 版本号
```shell
pnpm clean
pnpm build
pnpm release
```
### 开发建议
MES与IMES存在不少命名上的差异可以考虑 接口类型独立, 参数与配置单独创建类型

View File

@ -1,13 +1,11 @@
{ {
"name": "cut-abstractions", "name": "cut-abstractions",
"version": "0.1.4", "version": "0.1.1",
"description": "", "description": "",
"main": "index.ts",
"files": ["dist/**/*"], "files": ["dist/**/*"],
"main":"./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.js",
"exports": { "exports": {
".": "./dist/index.js" ".": "./dist/**/*"
}, },
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",

View File

@ -1,29 +1,15 @@
import { ConfigBase } from "./models/config"; export class ConfigBase {
name: string = '';
version:string = '1.0.0';
/** enable:boolean = true;
* [key: string]: any;
*/
export abstract class ProcessorContext<TInput,TOutput,TConfig extends ConfigBase>{
/**
*
*/
public Input?:TInput;
/**
*
*/
public params?:TConfig;
/**
*
*/
public Ouput?:TOutput;
} }
/** export interface FileOptions {
* encode?: string;
*/ addBOM?: boolean;
export abstract class ProcessorBase<TInput,TOutput,TConfig extends ConfigBase> { }
public readonly name: string = ''; export interface FileInfo extends FileOptions {
public readonly version: string = '1.0.0'; name: string,
public abstract exec(context:ProcessorContext<TInput,TOutput,TConfig>):Promise<void>|void content: string | Blob | Uint8Array,
} }

View File

@ -1,4 +0,0 @@
export * from './base';
export * from './parsers';
export * from './models/config';
export * from './models/file';

View File

@ -1,28 +0,0 @@
/**
* ,线
*/
export class ConfigBase {
name: string = '';
version:string = '1.0.0';
[key: string]: any;
/**
*
* @param data
*/
load(data:Record<string,unknown>){
for (const key of Object.getOwnPropertyNames(this).filter(i=>i[0]!=='_')) {
if(data[key]!=undefined){
this[key] = data[key];
}
}
}
/**
* json方法
* @returns
*/
toJson(){
return JSON.stringify(this,(k,v)=>k[0]=='_'?undefined:v);
}
}

View File

@ -1,8 +0,0 @@
export interface FileOptions {
encode?: string;
addBOM?: boolean;
}
export interface FileInfo extends FileOptions {
name: string,
content: string | Blob | Uint8Array,
}

View File

@ -1,48 +1,7 @@
import { ProcessorBase } from "./base"; export abstract class ProcessorBase {
import { ConfigBase } from "./models/config"; public readonly name: string = '';
import { FileInfo } from "./models/file"; public readonly version: string = '1.0.0';
public abstract exec(...args: any[]): any
// todo: 类型参数待补完
export class BlockInfo{
}
export class BlockProcessorConfig extends ConfigBase{
} }
/**
*
*/
export abstract class BlockProcessor extends ProcessorBase<BlockInfo[],BlockInfo[],BlockProcessorConfig>{
}
export class LayoutInput {
}
export class LayoutOutput{
}
export class LyaoutProcessorConfig extends ConfigBase{
}
export abstract class LayoutProcessor extends ProcessorBase<LayoutInput,LayoutOutput,LyaoutProcessorConfig>{
}
export class ExporterInput{
}
export class ExporterProcessorConfig extends ConfigBase{
}
export abstract class ExporterProcessor extends ProcessorBase<ExporterInput,FileInfo,ExporterProcessorConfig>{
}

View File

@ -1,6 +1,6 @@
{ {
"include": ["src"], "include": ["src"],
"exclude": ["node_modules","samples","tests"], "exclude": ["samples","tests"],
"compilerOptions": { "compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */ /* Visit https://aka.ms/tsconfig to read more about this file */