refactor(struct): split into separate package

This commit is contained in:
Simon Chan 2020-09-23 18:06:31 +08:00
parent 03182c77c3
commit c2e167b647
10 changed files with 75 additions and 3 deletions

View file

@ -26,6 +26,7 @@
"dependencies": {
"@yume-chan/async-operation-manager": "^2.0.0",
"@yume-chan/event": "^0.0.1",
"@yume-chan/struct": "^0.0.0",
"tslib": "^2.0.1"
}
}

View file

@ -1,7 +1,8 @@
import { AutoDisposable } from '@yume-chan/event';
import { Struct, StructInitType, StructValueType } from '@yume-chan/struct';
import { AdbBufferedStream } from './buffered-stream';
import { AdbStream } from './stream';
import { AutoResetEvent, Struct, StructInitType, StructValueType } from './utils';
import { AutoResetEvent } from './utils';
export enum AdbSyncRequestId {
List = 'LIST',

View file

@ -1,5 +1,3 @@
export * from './auto-reset-event';
export * from './base64';
export * from './event-iterator';
export * from './struct';
export { default as Struct } from './struct';

View file

@ -7,6 +7,9 @@
"references": [
{
"path": "../event/tsconfig.json"
},
{
"path": "../struct/tsconfig.json"
}
]
}

11
packages/struct/README.md Normal file
View file

@ -0,0 +1,11 @@
# `struct`
> TODO: description
## Usage
```
const struct = require('struct');
// TODO: DEMONSTRATE API
```

19
packages/struct/package-lock.json generated Normal file
View file

@ -0,0 +1,19 @@
{
"name": "@yume-chan/struct",
"version": "0.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"tslib": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz",
"integrity": "sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ=="
},
"typescript": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.3.tgz",
"integrity": "sha512-tEu6DGxGgRJPb/mVPIZ48e69xCn2yRmCgYmDugAVwmJ6o+0u1RI18eO7E7WBTLYLaEVVOhwQmcdhQHweux/WPg==",
"dev": true
}
}
}

View file

@ -0,0 +1,30 @@
{
"name": "@yume-chan/struct",
"version": "0.0.0",
"description": "Easy to use C structure serializer and deserializer",
"keywords": [
"structure",
"typescript"
],
"author": "Simon Chan <cnsimonchan@live.com>",
"homepage": "https://github.com/yume-chan/ya-webadb#readme",
"license": "MIT",
"main": "lib/index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/yume-chan/ya-webadb.git"
},
"scripts": {
"build": "tsc -b",
"build:watch": "tsc -b -w"
},
"bugs": {
"url": "https://github.com/yume-chan/ya-webadb/issues"
},
"devDependencies": {
"typescript": "4.0.3"
},
"dependencies": {
"tslib": "2.0.1"
}
}

View file

@ -0,0 +1,2 @@
export * from './struct';
export { default as Struct } from './struct';

View file

@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "lib", // /* Redirect output structure to the directory. */
"rootDir": "./src", // /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
}
}