shinkansen-relay 1.0.305 → 1.0.307
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/babel.config.cjs +0 -14
- package/jsconfig.json +5 -0
- package/package.json +9 -3
- package/src/index.d.mts +11 -5
- package/src/relay/index.d.mts +7 -3
- package/src/relay/initiate/index.d.mts +5 -1
- package/src/relay/initiate/index.mjs +8 -0
- package/src/relay/regulate/index.d.mts +5 -1
- package/src/relay/regulate/index.mjs +8 -0
- package/tsconfig.json +23 -4
package/babel.config.cjs
CHANGED
|
@@ -38,25 +38,11 @@ const presets = [
|
|
|
38
38
|
]
|
|
39
39
|
]
|
|
40
40
|
|
|
41
|
-
const plugins = [
|
|
42
|
-
[
|
|
43
|
-
'module-resolver', {
|
|
44
|
-
alias: {
|
|
45
|
-
'shinkansen-relay/relay/initiate': './src/relay/initiate/index.mjs',
|
|
46
|
-
'shinkansen-relay/relay/regulate': './src/relay/regulate/index.mjs',
|
|
47
|
-
'shinkansen-relay/relay': './src/relay/index.mjs',
|
|
48
|
-
'shinkansen-relay': './src/index.cjs'
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
]
|
|
53
|
-
|
|
54
41
|
module.exports = (api) => {
|
|
55
42
|
if (api) api.cache.using(env)
|
|
56
43
|
|
|
57
44
|
return {
|
|
58
45
|
presets,
|
|
59
|
-
plugins,
|
|
60
46
|
ignore: [
|
|
61
47
|
/node_modules\/(?!shinkansen|@modernpoacher)/
|
|
62
48
|
]
|
package/jsconfig.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shinkansen-relay",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.307",
|
|
4
4
|
"description": "Shinkansen Relay",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Shinkansen",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"repository": {
|
|
25
25
|
"type": "git",
|
|
26
|
-
"url": "git@github.com/modernpoacher/shinkansen-relay.git"
|
|
26
|
+
"url": "git+ssh://git@github.com/modernpoacher/shinkansen-relay.git"
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
29
|
"lint": "eslint . --ext .mjs,.cjs,.mts,.cts",
|
|
@@ -57,10 +57,16 @@
|
|
|
57
57
|
"mocha": "^10.8.2",
|
|
58
58
|
"shinkansen-signals": "1.1.182"
|
|
59
59
|
},
|
|
60
|
+
"imports": {
|
|
61
|
+
"#relay": "./src/index.mjs",
|
|
62
|
+
"#relay/relay": "./src/relay/index.mjs",
|
|
63
|
+
"#relay/relay/initiate": "./src/relay/initiate/index.mjs",
|
|
64
|
+
"#relay/relay/regulate": "./src/relay/regulate/index.mjs"
|
|
65
|
+
},
|
|
60
66
|
"exports": {
|
|
61
67
|
".": {
|
|
62
68
|
"require": "./src/index.cjs",
|
|
63
|
-
"import": "./src/index.
|
|
69
|
+
"import": "./src/index.mjs"
|
|
64
70
|
},
|
|
65
71
|
"./relay": "./src/relay/index.mjs",
|
|
66
72
|
"./relay/initiate": "./src/relay/initiate/index.mjs",
|
package/src/index.d.mts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
declare namespace RelayTypes {
|
|
2
|
+
export interface RelayType {
|
|
3
|
+
SIGNAL: string
|
|
4
|
+
SERVICE: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export type StateType = Record<PropertyKey, boolean>
|
|
4
8
|
}
|
|
5
9
|
|
|
6
|
-
|
|
10
|
+
declare module '#relay' {
|
|
11
|
+
export { default as Relay } from '#relay/relay'
|
|
12
|
+
}
|
|
7
13
|
|
|
8
14
|
declare module 'shinkansen-relay' {
|
|
9
|
-
export
|
|
15
|
+
export * from '#relay'
|
|
10
16
|
}
|
package/src/relay/index.d.mts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
declare module '
|
|
1
|
+
declare module '#relay/relay' {
|
|
2
2
|
export default class Relay {
|
|
3
|
-
static initiate (relay: { was: Record<
|
|
3
|
+
static initiate (relay: { was: Record<PropertyKey, string>, now: Record<PropertyKey, string> }): RelayTypes.StateType
|
|
4
4
|
|
|
5
|
-
static regulate (state: StateType): RelayType
|
|
5
|
+
static regulate (state: RelayTypes.StateType): RelayTypes.RelayType
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
+
|
|
9
|
+
declare module 'shinkansen-relay/relay' {
|
|
10
|
+
export { default } from '#relay/relay'
|
|
11
|
+
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
declare module '#relay/relay/initiate' {
|
|
2
|
+
export function initiate (relay: { was: Record<PropertyKey, string>, now: Record<PropertyKey, string> }): RelayTypes.StateType
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
declare module 'shinkansen-relay/relay/initiate' {
|
|
2
|
-
export
|
|
6
|
+
export * from '#relay/relay/initiate'
|
|
3
7
|
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('shinkansen-relay').RelayTypes} RelayTypes
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
import debug from 'debug'
|
|
2
6
|
|
|
3
7
|
import {
|
|
@@ -8,6 +12,10 @@ const log = debug('shinkansen-relay')
|
|
|
8
12
|
|
|
9
13
|
log('`shinkansen` is awake')
|
|
10
14
|
|
|
15
|
+
/**
|
|
16
|
+
* @param {{ was: Record<PropertyKey, string>, now: Record<PropertyKey, string> }} relay
|
|
17
|
+
* @returns {RelayTypes.StateType}
|
|
18
|
+
*/
|
|
11
19
|
export default function initiate ({ now = {}, was = {} } = {}) {
|
|
12
20
|
const {
|
|
13
21
|
ALPHA,
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
declare module '#relay/relay/regulate' {
|
|
2
|
+
export function regulate (state: RelayTypes.StateType): RelayTypes.RelayType
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
declare module 'shinkansen-relay/relay/regulate' {
|
|
2
|
-
export
|
|
6
|
+
export * from '#relay/relay/regulate'
|
|
3
7
|
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('shinkansen-relay').RelayTypes} RelayTypes
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
import debug from 'debug'
|
|
2
6
|
|
|
3
7
|
import {
|
|
@@ -8,6 +12,10 @@ const log = debug('shinkansen-relay')
|
|
|
8
12
|
|
|
9
13
|
log('`shinkansen` is awake')
|
|
10
14
|
|
|
15
|
+
/**
|
|
16
|
+
* @param {RelayTypes.StateType} state
|
|
17
|
+
* @returns {RelayTypes.RelayType}
|
|
18
|
+
*/
|
|
11
19
|
export default function regulate ({
|
|
12
20
|
HAS_ALPHA = false,
|
|
13
21
|
HAS_OMEGA = false,
|
package/tsconfig.json
CHANGED
|
@@ -1,11 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"module": "
|
|
3
|
+
"module": "ESNext",
|
|
4
4
|
"target": "ESNext",
|
|
5
|
-
"
|
|
5
|
+
"allowJs": true,
|
|
6
|
+
"checkJs": false,
|
|
7
|
+
"allowSyntheticDefaultImports": true,
|
|
6
8
|
"noEmit": true,
|
|
7
9
|
"strict": true,
|
|
8
10
|
"isolatedModules": true,
|
|
9
|
-
"baseUrl": "."
|
|
10
|
-
|
|
11
|
+
"baseUrl": ".",
|
|
12
|
+
"paths": {
|
|
13
|
+
"#relay": [
|
|
14
|
+
"src/index.mjs"
|
|
15
|
+
],
|
|
16
|
+
"#relay/relay": [
|
|
17
|
+
"src/relay/index.mjs"
|
|
18
|
+
],
|
|
19
|
+
"#relay/relay/initiate": [
|
|
20
|
+
"src/relay/initiate/index.mjs"
|
|
21
|
+
],
|
|
22
|
+
"#relay/relay/regulate": [
|
|
23
|
+
"src/relay/regulate/index.mjs"
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"include": [
|
|
28
|
+
"src/**/*"
|
|
29
|
+
]
|
|
11
30
|
}
|