Compare commits
71 Commits
6743240a1c
...
master
Author | SHA1 | Date | |
---|---|---|---|
bb7344740e | |||
002f0c3715 | |||
879fc564aa | |||
e6d69b135a | |||
e45f9fd3b7 | |||
86fe138e66 | |||
8fadff4a14 | |||
ec4a5eece3 | |||
887408a85c | |||
72793baf36 | |||
3a8bace490 | |||
12155578ac | |||
26d78a433f | |||
796bb9ad5d | |||
8032878594 | |||
4426ff6aa2 | |||
63cd177757 | |||
8270431e87 | |||
c54ff294f1 | |||
bbd1278e5a | |||
e6321a6d07 | |||
c79f71eb01 | |||
43f831596f | |||
1ef264bcef | |||
510ad0ca77 | |||
0840591d42 | |||
434da3ce20 | |||
194195b4dc | |||
9738e4a837 | |||
93bff42997 | |||
328baeb35f | |||
f6058eb50c | |||
b9381c2824 | |||
432adc5b58 | |||
0f26b14782 | |||
16d4e68a8a | |||
b00bf14bb4 | |||
d5272cf1cd | |||
15793afa98 | |||
5deecaea4c | |||
996694b6f4 | |||
d635aac840 | |||
11ec74e368 | |||
607db269c5 | |||
801c0920f6 | |||
8b123ae924 | |||
433b2b5b27 | |||
400b68daf0 | |||
9895e1d386 | |||
ac3296387e | |||
ac79bf8ef7 | |||
3783f6b52c | |||
64fb775478 | |||
dd5608afb7 | |||
a94c741624 | |||
3838c8c978 | |||
373635f0db | |||
6101f066cd | |||
df53948f69 | |||
241f1dafac | |||
f6b6eb2142 | |||
e0b1063df9 | |||
161d4573c7 | |||
174739ad17 | |||
702f7383cb | |||
f2cfbe4f37 | |||
249316858f | |||
d504f892c0 | |||
de5c397ed3 | |||
4530ec9c39 | |||
256979e2bb |
14
.drone.yml
Normal file
14
.drone.yml
Normal file
@ -0,0 +1,14 @@
|
||||
kind: pipeline
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: setup
|
||||
image: registry:5000/node-build
|
||||
commands:
|
||||
- yarn
|
||||
- curl https://git.scode.ovh/Timo/standard/raw/branch/master/ci.js > ci.js
|
||||
|
||||
- name: build
|
||||
image: registry:5000/node-build
|
||||
commands:
|
||||
- node ci.js
|
16
.eslintrc.js
16
.eslintrc.js
@ -1,24 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) Sapphirecode - All Rights Reserved
|
||||
* This file is part of Snippeteer which is released under BSD-3-Clause.
|
||||
* This file is part of Modelling which is released under MIT.
|
||||
* See file 'LICENSE' for full license details.
|
||||
* Created by Timo Hocker <timo@scode.ovh>, March 2020
|
||||
* Created by Timo Hocker <timo@scode.ovh>, May 2020
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
env: {
|
||||
commonjs: true,
|
||||
es6: true,
|
||||
node: true
|
||||
},
|
||||
extends: [
|
||||
'@scode'
|
||||
],
|
||||
extends: [ '@sapphirecode' ],
|
||||
globals: {
|
||||
Atomics: 'readonly',
|
||||
SharedArrayBuffer: 'readonly'
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 2018
|
||||
}
|
||||
}
|
||||
parserOptions: { ecmaVersion: 2018 }
|
||||
};
|
||||
|
8
.liconfig.json
Normal file
8
.liconfig.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"has_license": true,
|
||||
"license": "MIT",
|
||||
"author": "Timo Hocker",
|
||||
"company": "Sapphirecode",
|
||||
"email": "timo@scode.ovh",
|
||||
"software": "Modelling"
|
||||
}
|
10
CHANGELOG.md
Normal file
10
CHANGELOG.md
Normal file
@ -0,0 +1,10 @@
|
||||
# Changelog
|
||||
|
||||
## 1.1.0
|
||||
|
||||
Adapting ControlModel to be able to use the full Persistent-Type range and use
|
||||
observers instead of baked in functions.
|
||||
|
||||
## 1.0.0
|
||||
|
||||
initial version
|
23
Jenkinsfile
vendored
23
Jenkinsfile
vendored
@ -1,23 +0,0 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
environment {
|
||||
VERSION = VersionNumber([
|
||||
versionNumberString:
|
||||
'${BUILDS_ALL_TIME}',
|
||||
versionPrefix: '1.0.',
|
||||
worstResultForIncrement: 'SUCCESS'
|
||||
])
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Building') {
|
||||
steps {
|
||||
script {
|
||||
currentBuild.displayName = env.VERSION
|
||||
}
|
||||
sh 'yarn ci ${VERSION}'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
7
LICENSE
Normal file
7
LICENSE
Normal file
@ -0,0 +1,7 @@
|
||||
MIT License Copyright (c) <year> <author>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
116
README.md
Normal file
116
README.md
Normal file
@ -0,0 +1,116 @@
|
||||
# @sapphirecode/modelling
|
||||
|
||||
version: 1.1.x
|
||||
|
||||
base classes for controlling data
|
||||
|
||||
## Installation
|
||||
|
||||
npm:
|
||||
|
||||
> npm i --save @sapphirecode/modelling
|
||||
|
||||
yarn:
|
||||
|
||||
> yarn add @sapphirecode/modelling
|
||||
|
||||
## Usage
|
||||
|
||||
### Classes
|
||||
|
||||
#### Persistent
|
||||
|
||||
Persistent allows easy data transfer between classes that extend Persistent, as
|
||||
long as they have overlapping properties.
|
||||
|
||||
to create a persistent type, create a class that extends Persistent and in the
|
||||
constructor, define all properties you want to store.
|
||||
|
||||
Property types can be string, boolean, number or array
|
||||
|
||||
```js
|
||||
import { Persistent } from '@sapphirecode/modelling';
|
||||
|
||||
class Foo extends Persistent {
|
||||
public constructor() {
|
||||
super();
|
||||
this.properties.foo = 'string';
|
||||
this.properties.baz = 'boolean';
|
||||
}
|
||||
}
|
||||
|
||||
class Bar extends Persistent {
|
||||
public constructor() {
|
||||
super();
|
||||
this.properties.bar = 'string';
|
||||
this.properties.baz = 'boolean';
|
||||
}
|
||||
}
|
||||
|
||||
const f = new Foo();
|
||||
f.set('foo','bar');
|
||||
f.set('baz', true);
|
||||
|
||||
const b = new Bar();
|
||||
b.assign(f); // f.assign_to(b) will do the same
|
||||
// now the property 'baz' of b will also be true
|
||||
console.log(b.serialize()); // Persistent also implements Serializable
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- assign, assign_to, assign_object: (implementation of Assignable)
|
||||
- to_object: return data as plain object
|
||||
- serialize: return data as json string (Implementation of Serializable)
|
||||
- set(key, value): set property to a specific value
|
||||
- get(key): get a property
|
||||
|
||||
#### DatabaseModel
|
||||
|
||||
Extends Persistent and has the abstract methods read, write, delete and
|
||||
define_properties to allow working with databases
|
||||
|
||||
in define_properties, set all the properties you need, id is automatically added
|
||||
and has to be a number.
|
||||
|
||||
read, write and delete specify the actions needed to interact with the database
|
||||
itself
|
||||
|
||||
#### ControlModel
|
||||
|
||||
The ControlModel is there to verify incoming data and modify it if needed. It
|
||||
also extends Persistent.
|
||||
|
||||
The method define_properties lets you define the data you will store.
|
||||
|
||||
before_change allows you to register observers, that are able to cancel changes.
|
||||
the registered observers are called with the following parameters: (new_value,
|
||||
old_value, property_name). By returning false they can cancel the change that
|
||||
was about to happen.
|
||||
|
||||
register_observer does the same thing, but those observers are not able to
|
||||
cancel the change and they are called after the change already happened.
|
||||
|
||||
### Interfaces
|
||||
|
||||
#### Assignable
|
||||
|
||||
Base interface of Persistent
|
||||
|
||||
Methods:
|
||||
|
||||
- assign(b): assign data of another assingable object (b)
|
||||
- assign_to(b): assing data to b
|
||||
- assign_object(obj): assign data of plain object obj
|
||||
|
||||
#### Serializable
|
||||
|
||||
Interface to allow serialization of different data structures
|
||||
|
||||
Methods:
|
||||
|
||||
- serialize: serialize into a string
|
||||
|
||||
## License
|
||||
|
||||
MIT © Timo Hocker <timo@scode.ovh>
|
38
jenkins.js
38
jenkins.js
@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Sapphirecode - All Rights Reserved
|
||||
* This file is part of Snippeteer which is released under BSD-3-Clause.
|
||||
* See file 'LICENSE' for full license details.
|
||||
* Created by Timo Hocker <timo@scode.ovh>, March 2020
|
||||
*/
|
||||
|
||||
/* eslint-disable no-process-exit */
|
||||
/* eslint-disable no-console */
|
||||
/* eslint-disable no-sync */
|
||||
'use strict';
|
||||
|
||||
const fs = require ('fs');
|
||||
const child_process = require ('child_process');
|
||||
|
||||
const pkg = JSON.parse (fs.readFileSync ('package.json', 'utf-8'));
|
||||
[
|
||||
,, pkg.version
|
||||
] = process.argv;
|
||||
fs.writeFileSync ('package.json', JSON.stringify (pkg, null, 2));
|
||||
|
||||
child_process.execSync ('yarn lint', { stdio: 'inherit' });
|
||||
if (typeof pkg.scripts !== 'undefined' && typeof pkg.scripts.test === 'string')
|
||||
child_process.execSync ('yarn test', { stdio: 'inherit' });
|
||||
if (
|
||||
typeof pkg.scripts !== 'undefined'
|
||||
&& typeof pkg.scripts.compile === 'string'
|
||||
)
|
||||
child_process.execSync ('yarn compile', { stdio: 'inherit' });
|
||||
|
||||
child_process.exec ('git log -1 | grep \'\\[no publish\\]\'')
|
||||
.addListener ('exit', (code) => {
|
||||
if (code === 0) {
|
||||
console.log ('build not marked for deployment');
|
||||
process.exit (1);
|
||||
}
|
||||
else { child_process.execSync ('yarn publish'); }
|
||||
});
|
@ -1,24 +1,24 @@
|
||||
/*
|
||||
* Copyright (C) Sapphirecode - All Rights Reserved
|
||||
* This file is part of Snippeteer which is released under BSD-3-Clause.
|
||||
* This file is part of Modelling which is released under MIT.
|
||||
* See file 'LICENSE' for full license details.
|
||||
* Created by Timo Hocker <timo@scode.ovh>, March 2020
|
||||
* Created by Timo Hocker <timo@scode.ovh>, May 2020
|
||||
*/
|
||||
|
||||
/* eslint-disable */
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
env: {
|
||||
commonjs: true,
|
||||
es6: true,
|
||||
node: true
|
||||
},
|
||||
extends: [
|
||||
'@scode/eslint-config-ts'
|
||||
],
|
||||
extends: [ '@sapphirecode/eslint-config-ts' ],
|
||||
globals: {
|
||||
Atomics: 'readonly',
|
||||
SharedArrayBuffer: 'readonly'
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 2018
|
||||
}
|
||||
}
|
||||
parserOptions: { ecmaVersion: 2018 }
|
||||
};
|
||||
|
@ -1,10 +1,51 @@
|
||||
export abstract class ControlModel {
|
||||
public abstract get object(): Record<string, unknown>;
|
||||
public abstract set object(obj: Record<string, unknown>);
|
||||
/*
|
||||
* Copyright (C) Sapphirecode - All Rights Reserved
|
||||
* This file is part of Modelling which is released under MIT.
|
||||
* See file 'LICENSE' for full license details.
|
||||
* Created by Timo Hocker <timo@scode.ovh>, May 2020
|
||||
*/
|
||||
|
||||
public update (): void {
|
||||
this.verify ();
|
||||
import { Persistent } from './Persistent';
|
||||
import { PersistentType, ControlObserver, Observer } from './Types';
|
||||
|
||||
export abstract class ControlModel extends Persistent {
|
||||
private _before_change: Record<string, ControlObserver[]> = {};
|
||||
private _observers: Record<string, Observer[]> = {};
|
||||
|
||||
public constructor (obj?: Record<string, PersistentType>) {
|
||||
super ();
|
||||
this.define_properties ();
|
||||
if (typeof obj !== 'undefined')
|
||||
this.assign_object (obj);
|
||||
}
|
||||
|
||||
public abstract verify(): void;
|
||||
public set (key: string, value: PersistentType): void {
|
||||
const prev = this.get (key);
|
||||
if (typeof this._before_change[key] !== 'undefined') {
|
||||
for (const obs of this._before_change[key]) {
|
||||
if (!obs (value, prev, key))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
super.set (key, value);
|
||||
if (typeof this._observers[key] !== 'undefined') {
|
||||
for (const obs of this._observers[key])
|
||||
obs (value, prev, key);
|
||||
}
|
||||
}
|
||||
|
||||
public before_change (key: string, func: ControlObserver): void {
|
||||
if (typeof this._before_change[key] === 'undefined')
|
||||
this._before_change[key] = [];
|
||||
this._before_change[key].push (func);
|
||||
}
|
||||
|
||||
public register_observer (key: string, func: Observer): void {
|
||||
if (typeof this._observers[key] === 'undefined')
|
||||
this._observers[key] = [];
|
||||
this._observers[key].push (func);
|
||||
}
|
||||
|
||||
protected abstract define_properties(): void;
|
||||
}
|
||||
|
@ -1,25 +1,50 @@
|
||||
export abstract class DatabaseModel {
|
||||
protected id?: number;
|
||||
/*
|
||||
* Copyright (C) Sapphirecode - All Rights Reserved
|
||||
* This file is part of Modelling which is released under MIT.
|
||||
* See file 'LICENSE' for full license details.
|
||||
* Created by Timo Hocker <timo@scode.ovh>, May 2020
|
||||
*/
|
||||
|
||||
public static async get<T extends DatabaseModel> (
|
||||
id: number,
|
||||
constructor: new () => T
|
||||
): Promise<T> {
|
||||
const dbm = (new constructor);
|
||||
dbm.id = id;
|
||||
await dbm.read ();
|
||||
return dbm;
|
||||
import { Persistent } from './Persistent';
|
||||
|
||||
export abstract class DatabaseModel extends Persistent {
|
||||
public get id (): number {
|
||||
return this.get ('id') as number;
|
||||
}
|
||||
|
||||
public get object (): Record<string, number | string | undefined> {
|
||||
const obj = { id: this.id };
|
||||
return obj;
|
||||
public constructor (id?: number) {
|
||||
super ();
|
||||
this.properties.id = 'number';
|
||||
this.define_properties ();
|
||||
for (const prop of Object.keys (this.properties)) {
|
||||
if ([
|
||||
'string',
|
||||
'number',
|
||||
'boolean'
|
||||
].indexOf (this.properties[prop]) < 0) {
|
||||
throw new Error (
|
||||
'property types have to be either string, number or boolean'
|
||||
);
|
||||
}
|
||||
}
|
||||
if (typeof id !== 'undefined')
|
||||
this.set ('id', id);
|
||||
}
|
||||
|
||||
public set object (obj: Record<string, number | string | undefined>) {
|
||||
this.id = obj.id as number | undefined;
|
||||
public get (key: string): string|number|boolean {
|
||||
return super.get (key) as string|number|boolean;
|
||||
}
|
||||
|
||||
public abstract read(): Promise<void>;
|
||||
public abstract write(): Promise<void>;
|
||||
public set (key: string, value: string|number|boolean): void {
|
||||
super.set (key, value);
|
||||
}
|
||||
|
||||
public to_object (): Record<string, string|number|boolean> {
|
||||
return super.to_object () as Record<string, string|number|boolean>;
|
||||
}
|
||||
|
||||
public abstract async read(): Promise<boolean>;
|
||||
public abstract async write(): Promise<boolean>;
|
||||
public abstract async delete(): Promise<boolean>;
|
||||
protected abstract define_properties(): void;
|
||||
}
|
||||
|
60
lib/Persistent.ts
Normal file
60
lib/Persistent.ts
Normal file
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (C) Sapphirecode - All Rights Reserved
|
||||
* This file is part of Modelling which is released under MIT.
|
||||
* See file 'LICENSE' for full license details.
|
||||
* Created by Timo Hocker <timo@scode.ovh>, May 2020
|
||||
*/
|
||||
|
||||
import { copy_object } from '@sapphirecode/utilities';
|
||||
import { Assignable, Serializable } from './interfaces';
|
||||
import { PersistentTypeString, PersistentType } from './Types';
|
||||
|
||||
export abstract class Persistent implements Assignable, Serializable {
|
||||
private _data: Record<string, PersistentType> = {};
|
||||
protected readonly properties: Record<string, PersistentTypeString> = {};
|
||||
|
||||
public assign (a: Assignable): void {
|
||||
this.assign_object (a.to_object ());
|
||||
}
|
||||
|
||||
public assign_to (a: Assignable): void {
|
||||
a.assign (this);
|
||||
}
|
||||
|
||||
public assign_object (obj: Record<string, unknown>): void {
|
||||
for (const key of Object.keys (obj)) {
|
||||
const prop = this.properties[key];
|
||||
if (typeof prop !== 'undefined' && typeof obj[key] === prop)
|
||||
this._data[key] = obj[key] as PersistentType;
|
||||
}
|
||||
}
|
||||
|
||||
public to_object (): Record<string, PersistentType> {
|
||||
return copy_object (this._data) as Record<string, PersistentType>;
|
||||
}
|
||||
|
||||
public serialize (formatted = false): string {
|
||||
if (formatted)
|
||||
return JSON.stringify (this._data, null, 2);
|
||||
return JSON.stringify (this._data);
|
||||
}
|
||||
|
||||
private check_type (value: unknown, prop: PersistentTypeString): boolean {
|
||||
if (typeof prop === 'undefined')
|
||||
return false;
|
||||
if (prop === 'array')
|
||||
return Array.isArray (value);
|
||||
|
||||
return typeof value === prop;
|
||||
}
|
||||
|
||||
public set (key: string, value: unknown): void {
|
||||
const prop = this.properties[key];
|
||||
if (this.check_type (value, prop))
|
||||
this._data[key] = value as PersistentType;
|
||||
}
|
||||
|
||||
public get (key: string): PersistentType {
|
||||
return this._data[key];
|
||||
}
|
||||
}
|
15
lib/Types.ts
Normal file
15
lib/Types.ts
Normal file
@ -0,0 +1,15 @@
|
||||
export type PersistentTypeString = 'string'|'number'|'boolean'|'array';
|
||||
export type PersistentPrimitive = string|number|boolean;
|
||||
export type PersistentType = PersistentPrimitive|PersistentPrimitive[];
|
||||
|
||||
export type Observer = (
|
||||
value: PersistentType,
|
||||
prev: PersistentType,
|
||||
key: string
|
||||
) => void;
|
||||
|
||||
export type ControlObserver = (
|
||||
value: PersistentType,
|
||||
prev: PersistentType,
|
||||
key: string
|
||||
) => boolean;
|
@ -1,2 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) Sapphirecode - All Rights Reserved
|
||||
* This file is part of Modelling which is released under MIT.
|
||||
* See file 'LICENSE' for full license details.
|
||||
* Created by Timo Hocker <timo@scode.ovh>, May 2020
|
||||
*/
|
||||
|
||||
export { ControlModel } from './ControlModel';
|
||||
export { DatabaseModel } from './DatabaseModel';
|
||||
export { Persistent } from './Persistent';
|
||||
export * from './interfaces';
|
||||
|
12
lib/interfaces/Assignable.ts
Normal file
12
lib/interfaces/Assignable.ts
Normal file
@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) Sapphirecode - All Rights Reserved
|
||||
* This file is part of Modelling which is released under MIT.
|
||||
* See file 'LICENSE' for full license details.
|
||||
* Created by Timo Hocker <timo@scode.ovh>, May 2020
|
||||
*/
|
||||
|
||||
export interface Assignable {
|
||||
assign (a: Assignable): void;
|
||||
assign_to (a: Assignable): void;
|
||||
to_object (): Record<string, unknown>;
|
||||
}
|
10
lib/interfaces/Serializable.ts
Normal file
10
lib/interfaces/Serializable.ts
Normal file
@ -0,0 +1,10 @@
|
||||
/*
|
||||
* Copyright (C) Sapphirecode - All Rights Reserved
|
||||
* This file is part of Modelling which is released under MIT.
|
||||
* See file 'LICENSE' for full license details.
|
||||
* Created by Timo Hocker <timo@scode.ovh>, May 2020
|
||||
*/
|
||||
|
||||
export interface Serializable {
|
||||
serialize(): string;
|
||||
}
|
9
lib/interfaces/index.ts
Normal file
9
lib/interfaces/index.ts
Normal file
@ -0,0 +1,9 @@
|
||||
/*
|
||||
* Copyright (C) Sapphirecode - All Rights Reserved
|
||||
* This file is part of Modelling which is released under MIT.
|
||||
* See file 'LICENSE' for full license details.
|
||||
* Created by Timo Hocker <timo@scode.ovh>, May 2020
|
||||
*/
|
||||
|
||||
export { Assignable } from './Assignable';
|
||||
export { Serializable } from './Serializable';
|
35
package.json
35
package.json
@ -1,18 +1,37 @@
|
||||
{
|
||||
"name": "@scode/modelling",
|
||||
"version": "1.0.0",
|
||||
"name": "@sapphirecode/modelling",
|
||||
"version": "1.1.13",
|
||||
"main": "dist/index.js",
|
||||
"author": "Timo Hocker <t-hocker@web.de>",
|
||||
"author": {
|
||||
"name": "Timo Hocker",
|
||||
"email": "timo@scode.ovh"
|
||||
},
|
||||
"bugs": "https://redmine.scode.ovh/projects/modelling",
|
||||
"license": "MIT",
|
||||
"description": "base classes for controlling data",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://git.scode.ovh:timo/modelling.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@scode/eslint-config-ts": "^1.0.27",
|
||||
"eslint": "^6.8.0",
|
||||
"typescript": "^3.8.3"
|
||||
"@sapphirecode/eslint-config-ts": "^1.1.4",
|
||||
"eslint": "^7.0.0",
|
||||
"typescript": "^4.0.2"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint . --ext .js,.jsx,.ts,.tsx,.vue,.mjs",
|
||||
"test": "echo \"no test\"",
|
||||
"ci": "yarn && node jenkins.js",
|
||||
"compile": "tsc"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"/dist/",
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@sapphirecode/utilities": "^1.3.2"
|
||||
},
|
||||
"keywords": [
|
||||
"typescript",
|
||||
"data control"
|
||||
]
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
||||
"declaration": true, /* Generates corresponding '.d.ts' file. */
|
||||
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
|
||||
// "sourceMap": true, /* Generates corresponding '.map' file. */
|
||||
"sourceMap": true, /* Generates corresponding '.map' file. */
|
||||
// "outFile": "./", /* Concatenate and emit output to single file. */
|
||||
"outDir": "./dist", /* Redirect output structure to the directory. */
|
||||
"rootDir": "./lib", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
||||
|
Reference in New Issue
Block a user