jikan0 0.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -15
- package/dist/index.d.ts +5 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/package.json +34 -9
- package/.eslintrc.json +0 -25
- package/jest.config.ts +0 -11
- package/project.json +0 -34
- package/src/index.ts +0 -15
- package/tsconfig.json +0 -22
- package/tsconfig.lib.json +0 -10
- package/tsconfig.spec.json +0 -14
package/README.md
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
# jikan0
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Convenience exports for the timer engine and stateful adapters.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
```ts
|
|
6
|
+
import { empty, push, tick } from 'jikan0';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
const queued = push([{ kind: 'exercise', duration: 1000 }])(empty);
|
|
9
|
+
if (queued.ok) {
|
|
10
|
+
const elapsed = tick(400)(queued.state);
|
|
11
|
+
if (elapsed.ok) console.log(elapsed.state);
|
|
12
|
+
}
|
|
13
|
+
```
|
|
8
14
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Npm package exposed API
|
|
12
|
-
|
|
13
|
-
`npx nx release p` - will release dependencies
|
|
14
|
-
|
|
15
|
-
`npx nx build facade`
|
|
16
|
-
|
|
17
|
-
`node tools/scripts/publish.mjs facade 0.0.4 latest`
|
|
18
|
-
|
|
19
|
-
used https://github.com/nrwl/nx/issues/4620#issuecomment-1546737883 as build solution for now
|
|
15
|
+
Consumers own state and supply elapsed time. See the [engine](../fsm/README.md)
|
|
16
|
+
and [adapters](../adapters/README.md) for APIs and constraints.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { empty, isEmpty, current, currentNE, tick, push, pop, restart, reset, } from '@jikan0/fsm';
|
|
2
|
+
export { StatefulSimulation as Timer } from '@jikan0/adapters';
|
|
3
|
+
export { MAX_DURATION, MAX_PROGRAM_STAGES, validateDuration, } from '@jikan0/fsm';
|
|
4
|
+
export { createElapsedDriver } from '@jikan0/adapters';
|
|
5
|
+
export type { State, QueueItem, ValidationIssue, TransitionResult, } from '@jikan0/fsm';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createElapsedDriver = exports.validateDuration = exports.MAX_PROGRAM_STAGES = exports.MAX_DURATION = exports.Timer = exports.reset = exports.restart = exports.pop = exports.push = exports.tick = exports.currentNE = exports.current = exports.isEmpty = exports.empty = void 0;
|
|
4
|
+
var fsm_1 = require("@jikan0/fsm");
|
|
5
|
+
Object.defineProperty(exports, "empty", { enumerable: true, get: function () { return fsm_1.empty; } });
|
|
6
|
+
Object.defineProperty(exports, "isEmpty", { enumerable: true, get: function () { return fsm_1.isEmpty; } });
|
|
7
|
+
Object.defineProperty(exports, "current", { enumerable: true, get: function () { return fsm_1.current; } });
|
|
8
|
+
Object.defineProperty(exports, "currentNE", { enumerable: true, get: function () { return fsm_1.currentNE; } });
|
|
9
|
+
Object.defineProperty(exports, "tick", { enumerable: true, get: function () { return fsm_1.tick; } });
|
|
10
|
+
Object.defineProperty(exports, "push", { enumerable: true, get: function () { return fsm_1.push; } });
|
|
11
|
+
Object.defineProperty(exports, "pop", { enumerable: true, get: function () { return fsm_1.pop; } });
|
|
12
|
+
Object.defineProperty(exports, "restart", { enumerable: true, get: function () { return fsm_1.restart; } });
|
|
13
|
+
Object.defineProperty(exports, "reset", { enumerable: true, get: function () { return fsm_1.reset; } });
|
|
14
|
+
var adapters_1 = require("@jikan0/adapters");
|
|
15
|
+
Object.defineProperty(exports, "Timer", { enumerable: true, get: function () { return adapters_1.StatefulSimulation; } });
|
|
16
|
+
var fsm_2 = require("@jikan0/fsm");
|
|
17
|
+
Object.defineProperty(exports, "MAX_DURATION", { enumerable: true, get: function () { return fsm_2.MAX_DURATION; } });
|
|
18
|
+
Object.defineProperty(exports, "MAX_PROGRAM_STAGES", { enumerable: true, get: function () { return fsm_2.MAX_PROGRAM_STAGES; } });
|
|
19
|
+
Object.defineProperty(exports, "validateDuration", { enumerable: true, get: function () { return fsm_2.validateDuration; } });
|
|
20
|
+
var adapters_2 = require("@jikan0/adapters");
|
|
21
|
+
Object.defineProperty(exports, "createElapsedDriver", { enumerable: true, get: function () { return adapters_2.createElapsedDriver; } });
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAUqB;AATnB,4FAAA,KAAK,OAAA;AACL,8FAAA,OAAO,OAAA;AACP,8FAAA,OAAO,OAAA;AACP,gGAAA,SAAS,OAAA;AACT,2FAAA,IAAI,OAAA;AACJ,2FAAA,IAAI,OAAA;AACJ,0FAAA,GAAG,OAAA;AACH,8FAAA,OAAO,OAAA;AACP,4FAAA,KAAK,OAAA;AAGP,6CAA+D;AAAtD,iGAAA,kBAAkB,OAAS;AACpC,mCAIqB;AAHnB,mGAAA,YAAY,OAAA;AACZ,yGAAA,kBAAkB,OAAA;AAClB,uGAAA,gBAAgB,OAAA;AAElB,6CAAuD;AAA9C,+GAAA,mBAAmB,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,15 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jikan0",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"type": "commonjs",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"default": "./dist/index.js"
|
|
11
|
+
}
|
|
8
12
|
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"README.md",
|
|
16
|
+
"LICENSE"
|
|
17
|
+
],
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"sideEffects": false,
|
|
9
20
|
"publishConfig": {
|
|
10
|
-
"access": "public"
|
|
21
|
+
"access": "public",
|
|
22
|
+
"registry": "https://registry.npmjs.org/"
|
|
11
23
|
},
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/dearlordylord/jikan.git",
|
|
27
|
+
"directory": "facade"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "node ../tools/build-package.cjs",
|
|
31
|
+
"prepack": "cd .. && npx turbo run build --filter=jikan0..."
|
|
32
|
+
},
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=24"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@jikan0/adapters": "2.0.0",
|
|
38
|
+
"@jikan0/fsm": "2.0.0"
|
|
39
|
+
}
|
|
15
40
|
}
|
package/.eslintrc.json
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": ["../.eslintrc.json"],
|
|
3
|
-
"ignorePatterns": ["!**/*"],
|
|
4
|
-
"overrides": [
|
|
5
|
-
{
|
|
6
|
-
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
|
7
|
-
"rules": {}
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"files": ["*.ts", "*.tsx"],
|
|
11
|
-
"rules": {}
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"files": ["*.js", "*.jsx"],
|
|
15
|
-
"rules": {}
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"files": ["*.json"],
|
|
19
|
-
"parser": "jsonc-eslint-parser",
|
|
20
|
-
"rules": {
|
|
21
|
-
"@nx/dependency-checks": "error"
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
]
|
|
25
|
-
}
|
package/jest.config.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
export default {
|
|
3
|
-
displayName: 'facade',
|
|
4
|
-
preset: '../jest.preset.js',
|
|
5
|
-
testEnvironment: 'node',
|
|
6
|
-
transform: {
|
|
7
|
-
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
|
|
8
|
-
},
|
|
9
|
-
moduleFileExtensions: ['ts', 'js', 'html'],
|
|
10
|
-
coverageDirectory: '../coverage/facade',
|
|
11
|
-
};
|
package/project.json
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "facade",
|
|
3
|
-
"$schema": "../node_modules/nx/schemas/project-schema.json",
|
|
4
|
-
"sourceRoot": "facade/src",
|
|
5
|
-
"projectType": "library",
|
|
6
|
-
"targets": {
|
|
7
|
-
"build": {
|
|
8
|
-
"executor": "@nx/js:tsc",
|
|
9
|
-
"outputs": ["{options.outputPath}"],
|
|
10
|
-
"options": {
|
|
11
|
-
"outputPath": "dist/facade",
|
|
12
|
-
"main": "facade/src/index.ts",
|
|
13
|
-
"tsConfig": "facade/tsconfig.lib.json",
|
|
14
|
-
"assets": ["facade/*.md"]
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"publish": {
|
|
18
|
-
"command": "node tools/scripts/publish.mjs facade {args.ver} {args.tag} {args.otp}",
|
|
19
|
-
"dependsOn": ["build"]
|
|
20
|
-
},
|
|
21
|
-
"lint": {
|
|
22
|
-
"executor": "@nx/eslint:lint",
|
|
23
|
-
"outputs": ["{options.outputFile}"]
|
|
24
|
-
},
|
|
25
|
-
"test": {
|
|
26
|
-
"executor": "@nx/jest:jest",
|
|
27
|
-
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
|
28
|
-
"options": {
|
|
29
|
-
"jestConfig": "facade/jest.config.ts"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
"tags": []
|
|
34
|
-
}
|
package/src/index.ts
DELETED
package/tsconfig.json
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"module": "commonjs",
|
|
5
|
-
"forceConsistentCasingInFileNames": true,
|
|
6
|
-
"strict": true,
|
|
7
|
-
"noImplicitOverride": true,
|
|
8
|
-
"noPropertyAccessFromIndexSignature": true,
|
|
9
|
-
"noImplicitReturns": true,
|
|
10
|
-
"noFallthroughCasesInSwitch": true
|
|
11
|
-
},
|
|
12
|
-
"files": [],
|
|
13
|
-
"include": [],
|
|
14
|
-
"references": [
|
|
15
|
-
{
|
|
16
|
-
"path": "./tsconfig.lib.json"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"path": "./tsconfig.spec.json"
|
|
20
|
-
}
|
|
21
|
-
]
|
|
22
|
-
}
|
package/tsconfig.lib.json
DELETED
package/tsconfig.spec.json
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "../dist/out-tsc",
|
|
5
|
-
"module": "commonjs",
|
|
6
|
-
"types": ["jest", "node"]
|
|
7
|
-
},
|
|
8
|
-
"include": [
|
|
9
|
-
"jest.config.ts",
|
|
10
|
-
"src/**/*.test.ts",
|
|
11
|
-
"src/**/*.spec.ts",
|
|
12
|
-
"src/**/*.d.ts"
|
|
13
|
-
]
|
|
14
|
-
}
|