Comparing version 0.0.8 to 0.1.0
@@ -5,7 +5,7 @@ import { Vector3, ITransformComponentData, IComponentData } from "./interfaces"; | ||
export declare class Component { | ||
readonly id: string; | ||
readonly name: string; | ||
readonly gameobject: Entity; | ||
readonly transform: TransformComponent; | ||
protected readonly watchedData: any; | ||
get id(): string; | ||
get name(): string; | ||
get gameobject(): Entity; | ||
get transform(): TransformComponent; | ||
protected get watchedData(): any; | ||
protected store: EntityStore; | ||
@@ -23,7 +23,7 @@ protected data: IComponentData; | ||
export declare class TransformComponent extends Component { | ||
readonly position: Vector3; | ||
readonly rotation: Vector3; | ||
readonly scale: Vector3; | ||
get position(): Vector3; | ||
get rotation(): Vector3; | ||
get scale(): Vector3; | ||
data: ITransformComponentData; | ||
constructor(store: EntityStore, data: IComponentData); | ||
} |
@@ -5,11 +5,13 @@ import { TransformComponent, Component } from "./component"; | ||
export declare class Entity { | ||
enable: boolean; | ||
readonly id: string; | ||
name: string; | ||
readonly gameobject: Entity; | ||
readonly transform: TransformComponent; | ||
readonly parent: Entity; | ||
readonly components: Component[]; | ||
readonly childs: Entity[]; | ||
protected readonly watchedData: any; | ||
get enable(): boolean; | ||
set enable(value: boolean); | ||
get id(): string; | ||
get name(): string; | ||
set name(value: string); | ||
get gameobject(): Entity; | ||
get transform(): TransformComponent; | ||
get parent(): Entity; | ||
get components(): Component[]; | ||
get childs(): Entity[]; | ||
protected get watchedData(): any; | ||
store: EntityStore; | ||
@@ -16,0 +18,0 @@ data: IEntityData; |
export * from "./interfaces"; | ||
export * from "./entity"; | ||
export * from "./component"; |
@@ -0,0 +0,0 @@ export interface IComponentData { |
import { EntityStore } from "../../stores"; | ||
import { IFileData } from "./interfaces"; | ||
export declare class EntityFile { | ||
readonly id: string; | ||
label: string; | ||
icon: string; | ||
readonly isFolder: boolean; | ||
protected readonly watchedData: any; | ||
get id(): string; | ||
get label(): string; | ||
set label(val: string); | ||
get icon(): string; | ||
set icon(val: string); | ||
get isFolder(): boolean; | ||
protected get watchedData(): any; | ||
protected store: EntityStore; | ||
@@ -10,0 +12,0 @@ protected data: IFileData; |
@@ -5,4 +5,5 @@ import { EntityStore } from "../../stores"; | ||
export declare class EntityFolder extends EntityFile { | ||
icon: string; | ||
readonly isFolder: boolean; | ||
get icon(): string; | ||
set icon(val: string); | ||
get isFolder(): boolean; | ||
protected data: IFolderData; | ||
@@ -9,0 +10,0 @@ constructor(store: EntityStore, data: IFolderData); |
export * from "./interfaces"; | ||
export * from "./entityFile"; | ||
export * from "./entityFolder"; |
@@ -0,0 +0,0 @@ export interface IFileData { |
export declare function pathWalk(obj: any, path: string): any; | ||
export declare function clone(obj: any): any; |
@@ -0,0 +0,0 @@ import { Kaaya } from "./kaaya"; |
@@ -0,0 +0,0 @@ import { BaseStore, KeyStore, TableStore, EntityStore } from "./stores"; |
import { DataStore } from "./dataStore"; | ||
export declare class BaseStore { | ||
readonly id: string; | ||
readonly history: any[]; | ||
readonly data: any; | ||
readonly proxy: any; | ||
readonly serialize: any; | ||
get id(): string; | ||
get history(): any[]; | ||
get data(): any; | ||
get proxy(): any; | ||
get serialize(): any; | ||
protected _store: DataStore; | ||
@@ -9,0 +9,0 @@ protected _originalData: any; |
@@ -17,4 +17,4 @@ import { Event } from "coopa"; | ||
private undoMap; | ||
readonly nextUndoId: string | number; | ||
readonly nextRedoId: string | number; | ||
get nextUndoId(): string | number; | ||
get nextRedoId(): string | number; | ||
constructor(); | ||
@@ -21,0 +21,0 @@ keepUndoObject(id: string, val: any): void; |
@@ -0,0 +0,0 @@ import { BaseStore } from "./baseStore"; |
@@ -0,0 +0,0 @@ export * from "./baseStore"; |
@@ -0,0 +0,0 @@ import { BaseStore } from "./baseStore"; |
@@ -0,0 +0,0 @@ import { BaseStore } from "./baseStore"; |
@@ -0,1 +1,2 @@ | ||
// [KAAYA] Build: 0.1.0 - November 17, 2019 | ||
(function (global, factory) { | ||
@@ -7,21 +8,36 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
/** | ||
* Provide polyfill around Date.now() | ||
*/ | ||
const now = typeof Date.now === "function" ? Date.now : new Date().getTime; | ||
const start = now(); | ||
/** | ||
* Provide polyfill around performance.now() | ||
*/ | ||
/* istanbul ignore next */ | ||
const perf = () => { | ||
if (globalThis && globalThis.performance) { | ||
return globalThis.performance.now(); | ||
} | ||
else if (globalThis.process) { | ||
return process.hrtime()[1]; | ||
} | ||
return now() - start; | ||
}; | ||
// [COOPA] Build: 0.2.2 - November 17, 2019 | ||
// Used only as a polyfill for DOMMatrix | ||
/* istanbul ignore file */ | ||
/* eslint @typescript-eslint/no-use-before-define: 0 */ | ||
var Matrix3D; | ||
(function (Matrix3D) { | ||
Matrix3D[Matrix3D["M11"] = 0] = "M11"; | ||
Matrix3D[Matrix3D["M12"] = 1] = "M12"; | ||
Matrix3D[Matrix3D["M13"] = 2] = "M13"; | ||
Matrix3D[Matrix3D["M14"] = 3] = "M14"; | ||
Matrix3D[Matrix3D["M21"] = 4] = "M21"; | ||
Matrix3D[Matrix3D["M22"] = 5] = "M22"; | ||
Matrix3D[Matrix3D["M23"] = 6] = "M23"; | ||
Matrix3D[Matrix3D["M24"] = 7] = "M24"; | ||
Matrix3D[Matrix3D["M31"] = 8] = "M31"; | ||
Matrix3D[Matrix3D["M32"] = 9] = "M32"; | ||
Matrix3D[Matrix3D["M33"] = 10] = "M33"; | ||
Matrix3D[Matrix3D["M34"] = 11] = "M34"; | ||
Matrix3D[Matrix3D["M41"] = 12] = "M41"; | ||
Matrix3D[Matrix3D["M42"] = 13] = "M42"; | ||
Matrix3D[Matrix3D["M43"] = 14] = "M43"; | ||
Matrix3D[Matrix3D["M44"] = 15] = "M44"; | ||
})(Matrix3D || (Matrix3D = {})); | ||
var Matrix2D; | ||
(function (Matrix2D) { | ||
Matrix2D[Matrix2D["A"] = 0] = "A"; | ||
Matrix2D[Matrix2D["B"] = 1] = "B"; | ||
Matrix2D[Matrix2D["C"] = 4] = "C"; | ||
Matrix2D[Matrix2D["D"] = 5] = "D"; | ||
Matrix2D[Matrix2D["E"] = 12] = "E"; | ||
Matrix2D[Matrix2D["F"] = 13] = "F"; | ||
})(Matrix2D || (Matrix2D = {})); | ||
/// Inspired by https://basarat.gitbooks.io/typescript/docs/tips/typed-event.html | ||
@@ -129,11 +145,22 @@ class Event { | ||
} | ||
if (!Math.hypot) { | ||
Math.hypot = function () { | ||
var y = 0, i = arguments.length; | ||
while (i--) | ||
y += arguments[i] * arguments[i]; | ||
return Math.sqrt(y); | ||
}; | ||
} | ||
/** | ||
* Provide polyfill around Date.now() | ||
*/ | ||
const now = typeof Date.now === "function" ? Date.now : new Date().getTime; | ||
const start = now(); | ||
/** | ||
* Provide polyfill around performance.now() | ||
*/ | ||
/* istanbul ignore next */ | ||
const perf = () => { | ||
if (globalThis && globalThis.performance) { | ||
return globalThis.performance.now(); | ||
} | ||
else if (globalThis.process) { | ||
return process.hrtime()[1]; | ||
} | ||
return now() - start; | ||
}; | ||
class Entity { | ||
@@ -219,2 +246,3 @@ constructor(store, data) { | ||
/* eslint @typescript-eslint/no-empty-function: 0 */ | ||
class Component { | ||
@@ -524,3 +552,3 @@ constructor(store, data) { | ||
let elem = this.syncQueue.shift(); | ||
while (!!elem) { | ||
while (elem) { | ||
this.syncCurrent = elem; | ||
@@ -527,0 +555,0 @@ await elem(); |
{ | ||
"name": "kaaya", | ||
"description": "DataStore synchronization library", | ||
"version": "0.0.8", | ||
"main": "build/kaaya.js", | ||
"version": "0.1.0", | ||
"main": "build/kaaya.umd.js", | ||
"module": "build/kaaya.es.mjs", | ||
@@ -26,30 +26,40 @@ "types": "build/declarations/index.d.ts", | ||
"scripts": { | ||
"build": "run-s build:pre && run-p build:dist:* && run-p build:definition && run-s build:clean", | ||
"build:pre": "rimraf build", | ||
"build:dist:rollup": "rollup -c rollup.config.js", | ||
"build:definition": "tsc --p ./tsconfig.json --declaration true --emitDeclarationOnly true --outDir ./build/declarations", | ||
"build:clean": "rimraf lib && rimraf build/lib && rimraf build/declarations/tests", | ||
"autofix": "run-s autofix:**", | ||
"autofix:eslint-src": "eslint \"src/**/*.ts\" --fix --quiet", | ||
"autofix:eslint-tests": "eslint \"tests/**/*.ts\" --fix --quiet", | ||
"autofix:prettier-src": "prettier --config .prettierrc.yaml --write \"src/**/*.ts\"", | ||
"autofix:prettier-tests": "prettier --config .prettierrc.yaml --write \"tests/**/*.ts\"", | ||
"build": "rimraf build && run-s build:**", | ||
"build:esm": "rollup -c rollup.config.js --file build/kaaya.es.mjs --format esm", | ||
"build:umd": "rollup -c rollup.config.js --file build/kaaya.umd.js --format umd --name \"Kaaya\"", | ||
"build:tsc": "tsc --declaration true --emitDeclarationOnly true --outDir ./build/declarations", | ||
"coverage": "jest --coverage", | ||
"coveralls": "jest --coverage && cat ./coverage/lcov.info | coveralls", | ||
"dev": "rollup -c rollup.dev.config.js", | ||
"prettier": "run-s prettier:**", | ||
"prettier:src": "prettier --config .prettierrc.yaml --write \"src/**/*.ts\"", | ||
"prettier:tests": "prettier --config .prettierrc.yaml --write \"tests/**/*.ts\"", | ||
"dev": "rollup -c rollup.dev.config.js --watch", | ||
"help": "npm-run-help", | ||
"test": "run-s test:**", | ||
"test:unittest": "jest", | ||
"test:lint": "prettier --config .prettierrc.yaml --check \"src/**/*.ts\"", | ||
"test:depencencies": "npm-check --production || echo \"Run 'npm run update' to interactively update dependencies for this project\"", | ||
"update": "npm-check --update" | ||
"test:lint": "eslint \"src/**/*.ts\"", | ||
"test:prettier": "prettier --config .prettierrc.yaml --check \"src/**/*.ts\"", | ||
"update": "npm-check --update", | ||
"postinstall": "npm run dev-dep", | ||
"postupdate": "npm run dev-dep", | ||
"dev-dep": "run-p dev-dep:*", | ||
"dev-dep:coopa": "path-exists ../coopa && npm link ../coopa || echo 'skip link coopa'" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^24.0.21", | ||
"@types/node": "^12.12.5", | ||
"coopa": "^0.1.5", | ||
"coveralls": "^3.0.7", | ||
"@types/jest": "^24.0.23", | ||
"@types/node": "^12.12.8", | ||
"@typescript-eslint/eslint-plugin": "^2.7.0", | ||
"@typescript-eslint/parser": "^2.7.0", | ||
"coopa": "^0.2.2", | ||
"eslint": "^6.6.0", | ||
"eslint-config-prettier": "^6.6.0", | ||
"jest": "^24.9.0", | ||
"npm-check": "^5.9.0", | ||
"npm-run-all": "^4.1.5", | ||
"prettier": "^1.18.2", | ||
"npm-run-help": "^1.1.0", | ||
"path-exists-cli": "^1.0.0", | ||
"prettier": "^1.19.1", | ||
"rimraf": "^3.0.0", | ||
"rollup": "^1.26.3", | ||
"rollup": "^1.27.0", | ||
"rollup-plugin-commonjs": "^10.1.0", | ||
@@ -60,7 +70,8 @@ "rollup-plugin-filesize": "^6.2.1", | ||
"rollup-plugin-typescript": "^1.0.1", | ||
"rollup-plugin-version-injector": "^1.1.3", | ||
"ts-jest": "^24.1.0", | ||
"ts-loader": "^6.2.1", | ||
"tslib": "^1.10.0", | ||
"typescript": "^3.6.4" | ||
"typescript": "^3.7.2" | ||
} | ||
} |
@@ -1,13 +0,15 @@ | ||
Still under development, do not use except for testing :P | ||
# Kaaya | ||
Kaaya is a delightful javascript library which target on state management and data synchronization between Applications. | ||
- **Samples**: [Here](https://kefniark.github.io/Kaaya/samples) | ||
[![Build Status](https://github.com/kefniark/Kaaya/workflows/Build%20CI/badge.svg)](https://github.com/kefniark/Kaaya/actions) | ||
[![Total alerts](https://img.shields.io/lgtm/alerts/g/kefniark/Kaaya.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/kefniark/Kaaya/alerts/) | ||
[![NPM Version](https://img.shields.io/npm/v/kaaya.svg)](https://npmjs.org/package/kaaya) | ||
[![NPM Download](https://img.shields.io/npm/dm/kaaya.svg)](https://npmjs.org/package/kaaya) | ||
[![Build Status](https://travis-ci.org/kefniark/Kaaya.svg?branch=master)](https://travis-ci.org/kefniark/Kaaya) | ||
[![Coverage Status](https://coveralls.io/repos/github/kefniark/Kaaya/badge.svg?branch=master)](https://coveralls.io/github/kefniark/Kaaya?branch=master) | ||
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/c0fc8bf9f62a4067a2d1454c1eba454e)](https://www.codacy.com/manual/kefniark/Kaaya?utm_source=github.com&utm_medium=referral&utm_content=kefniark/Kaaya&utm_campaign=Badge_Grade) | ||
[![License](https://img.shields.io/npm/l/kaaya.svg)](https://npmjs.org/package/kaaya) | ||
Kaaya is a delightful javascript library which target on state management and data synchronization between Applications. | ||
> Still under development, do not use except for testing | ||
@@ -29,6 +31,2 @@ - Support different data structure (and their usual format): | ||
* **Samples**: [Here](https://kefniark.github.io/Kaaya/samples) | ||
--- | ||
## Usage | ||
@@ -35,0 +33,0 @@ |
@@ -6,25 +6,18 @@ import commonjs from "rollup-plugin-commonjs" | ||
import filesize from "rollup-plugin-filesize" | ||
import versionInjector from "rollup-plugin-version-injector" | ||
export default { | ||
input: "src/index.ts", | ||
output: [ | ||
{ | ||
file: pkg.main, | ||
format: "cjs" | ||
}, | ||
{ | ||
name: "Kaaya", | ||
file: "build/kaaya.umd.js", | ||
format: "umd" | ||
}, | ||
{ | ||
file: pkg.module, | ||
format: "es" | ||
} | ||
], | ||
external: [...Object.keys(pkg.peerDependencies || {})], | ||
external: [...Object.keys(pkg.peerDependencies || {}), ...Object.keys(pkg.dependencies || {})], | ||
plugins: [ | ||
typescript(), | ||
resolve({ jsnext: true }), | ||
resolve(), | ||
commonjs(), | ||
versionInjector({ | ||
injectInComments: { | ||
fileRegexp: /\.(js|mjs)$/g, | ||
tag: `[${pkg.name.toUpperCase()}] Build: {version} - {date}`, | ||
dateFormat: "longDate" | ||
} | ||
}), | ||
filesize({ | ||
@@ -31,0 +24,0 @@ showGzippedSize: false |
@@ -12,9 +12,8 @@ import commonjs from "rollup-plugin-commonjs" | ||
file: pkg.module, | ||
format: "es" | ||
format: "esm" | ||
} | ||
], | ||
external: [...Object.keys(pkg.peerDependencies || {})], | ||
plugins: [ | ||
typescript(), | ||
resolve({ jsnext: true }), | ||
resolve(), | ||
commonjs(), | ||
@@ -21,0 +20,0 @@ serve({ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
394090
30
11778
25
117
1
1