shinkansen-engine 1.4.11 → 1.5.1
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/eslint.config.mjs +10 -14
- package/index.d.mts +4 -0
- package/package.json +27 -27
- package/src/engine/index.cjs +9 -6
- package/src/engine/index.d.mts +1 -3
- package/src/engine/index.jsx +9 -5
- package/src/index.cjs +5 -3
- package/src/common/index.d.mts +0 -3
- package/src/common/index.mjs +0 -7
package/eslint.config.mjs
CHANGED
|
@@ -130,19 +130,16 @@ export default [
|
|
|
130
130
|
globals: {
|
|
131
131
|
...globals.browser
|
|
132
132
|
}
|
|
133
|
-
},
|
|
133
|
+
}, // @ts-expect-error Storybook
|
|
134
134
|
plugins: {
|
|
135
135
|
...reactPlugins,
|
|
136
136
|
...storybookPlugins
|
|
137
|
-
},
|
|
137
|
+
}, // @ts-expect-error Storybook
|
|
138
138
|
rules: {
|
|
139
139
|
...reactRules
|
|
140
140
|
},
|
|
141
141
|
settings: {
|
|
142
|
-
...reactSettings
|
|
143
|
-
'import/resolver': {
|
|
144
|
-
'babel-module': {}
|
|
145
|
-
}
|
|
142
|
+
...reactSettings
|
|
146
143
|
}
|
|
147
144
|
}),
|
|
148
145
|
standard({
|
|
@@ -160,19 +157,16 @@ export default [
|
|
|
160
157
|
...globals.browser,
|
|
161
158
|
...globals.jest
|
|
162
159
|
}
|
|
163
|
-
},
|
|
160
|
+
}, // @ts-expect-error Storybook
|
|
164
161
|
plugins: {
|
|
165
162
|
...reactPlugins,
|
|
166
163
|
...storybookPlugins
|
|
167
|
-
},
|
|
164
|
+
}, // @ts-expect-error Storybook
|
|
168
165
|
rules: {
|
|
169
166
|
...reactRules
|
|
170
167
|
},
|
|
171
168
|
settings: {
|
|
172
|
-
...reactSettings
|
|
173
|
-
'import/resolver': {
|
|
174
|
-
'babel-module': {}
|
|
175
|
-
}
|
|
169
|
+
...reactSettings
|
|
176
170
|
}
|
|
177
171
|
}),
|
|
178
172
|
/**
|
|
@@ -183,7 +177,8 @@ export default [
|
|
|
183
177
|
'**/*.{mts,cts}'
|
|
184
178
|
],
|
|
185
179
|
ignores: [
|
|
186
|
-
'src'
|
|
180
|
+
'src',
|
|
181
|
+
'test'
|
|
187
182
|
],
|
|
188
183
|
languageOptions: {
|
|
189
184
|
parser: typescriptParser,
|
|
@@ -199,7 +194,8 @@ export default [
|
|
|
199
194
|
}),
|
|
200
195
|
typescript({
|
|
201
196
|
files: [
|
|
202
|
-
'src/**/*.{mts,cts}'
|
|
197
|
+
'src/**/*.{mts,cts}',
|
|
198
|
+
'test/**/*.{mts,cts}'
|
|
203
199
|
],
|
|
204
200
|
languageOptions: {
|
|
205
201
|
parser: typescriptParser,
|
package/index.d.mts
CHANGED
|
@@ -18,6 +18,8 @@ import type { FieldsetProps } from 'shinkansen-sprockets/sprockets/fieldset'
|
|
|
18
18
|
|
|
19
19
|
declare global {
|
|
20
20
|
namespace EngineTypes {
|
|
21
|
+
export type OnEventType = () => void
|
|
22
|
+
|
|
21
23
|
export type EngineProps = PinionProps & { gears: GearsProps }
|
|
22
24
|
|
|
23
25
|
export namespace Components {
|
|
@@ -111,3 +113,5 @@ declare global {
|
|
|
111
113
|
}
|
|
112
114
|
}
|
|
113
115
|
}
|
|
116
|
+
|
|
117
|
+
export {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shinkansen-engine",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "Shinkansen Engine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Shinkansen",
|
|
@@ -58,11 +58,14 @@
|
|
|
58
58
|
"@modernpoacher/design-system": "1.1.31",
|
|
59
59
|
"@sequencemedia/eslint-config-standard": "^0.2.41",
|
|
60
60
|
"@sequencemedia/eslint-config-typescript": "^0.1.57",
|
|
61
|
-
"@storybook/addon-actions": "
|
|
62
|
-
"@storybook/addon-essentials": "
|
|
63
|
-
"@storybook/addon-links": "
|
|
64
|
-
"@storybook/
|
|
65
|
-
"@storybook/
|
|
61
|
+
"@storybook/addon-actions": "^8.6.4",
|
|
62
|
+
"@storybook/addon-essentials": "^8.6.4",
|
|
63
|
+
"@storybook/addon-links": "^8.6.4",
|
|
64
|
+
"@storybook/addon-webpack5-compiler-babel": "^3.0.5",
|
|
65
|
+
"@storybook/manager-api": "^8.6.4",
|
|
66
|
+
"@storybook/react": "^8.6.4",
|
|
67
|
+
"@storybook/react-webpack5": "^8.6.4",
|
|
68
|
+
"@storybook/theming": "^8.6.4",
|
|
66
69
|
"@types/babel__register": "^7.17.3",
|
|
67
70
|
"@types/chai": "^5.2.0",
|
|
68
71
|
"@types/debug": "^4.1.12",
|
|
@@ -77,7 +80,6 @@
|
|
|
77
80
|
"core-js": "^3.41.0",
|
|
78
81
|
"cross-env": "^7.0.3",
|
|
79
82
|
"eslint": "^9.21.0",
|
|
80
|
-
"eslint-import-resolver-babel-module": "^5.3.2",
|
|
81
83
|
"eslint-plugin-react": "^7.37.4",
|
|
82
84
|
"eslint-plugin-storybook": "^0.11.4",
|
|
83
85
|
"globals": "^16.0.0",
|
|
@@ -100,28 +102,28 @@
|
|
|
100
102
|
"remove-files-webpack-plugin": "^1.5.0",
|
|
101
103
|
"sass": "^1.85.1",
|
|
102
104
|
"sass-loader": "^16.0.5",
|
|
103
|
-
"shinkansen-cogs": "1.
|
|
104
|
-
"shinkansen-gears": "1.
|
|
105
|
-
"shinkansen-pantograph": "1.
|
|
106
|
-
"shinkansen-pinion": "1.
|
|
107
|
-
"shinkansen-rails": "1.0
|
|
108
|
-
"shinkansen-signals": "1.
|
|
109
|
-
"shinkansen-sprockets": "1.
|
|
110
|
-
"shinkansen-transmission": "2.
|
|
105
|
+
"shinkansen-cogs": "1.9.0",
|
|
106
|
+
"shinkansen-gears": "1.3.0",
|
|
107
|
+
"shinkansen-pantograph": "1.5.0",
|
|
108
|
+
"shinkansen-pinion": "1.4.0",
|
|
109
|
+
"shinkansen-rails": "1.1.0",
|
|
110
|
+
"shinkansen-signals": "1.2.0",
|
|
111
|
+
"shinkansen-sprockets": "1.3.0",
|
|
112
|
+
"shinkansen-transmission": "2.5.0",
|
|
111
113
|
"sinon": "^19.0.2",
|
|
112
|
-
"storybook": "
|
|
114
|
+
"storybook": "^8.6.4",
|
|
113
115
|
"webpack": "^5.98.0",
|
|
114
116
|
"webpack-cli": "^6.0.1"
|
|
115
117
|
},
|
|
116
118
|
"peerDependencies": {
|
|
117
|
-
"shinkansen-cogs": "1.
|
|
118
|
-
"shinkansen-gears": "1.
|
|
119
|
-
"shinkansen-pantograph": "1.
|
|
120
|
-
"shinkansen-pinion": "1.
|
|
121
|
-
"shinkansen-rails": "1.
|
|
122
|
-
"shinkansen-signals": "1.
|
|
123
|
-
"shinkansen-sprockets": "1.
|
|
124
|
-
"shinkansen-transmission": "2.
|
|
119
|
+
"shinkansen-cogs": "1.9.x",
|
|
120
|
+
"shinkansen-gears": "1.3.x",
|
|
121
|
+
"shinkansen-pantograph": "1.5.x",
|
|
122
|
+
"shinkansen-pinion": "1.4.x",
|
|
123
|
+
"shinkansen-rails": "1.1.x",
|
|
124
|
+
"shinkansen-signals": "1.2.x",
|
|
125
|
+
"shinkansen-sprockets": "1.3.x",
|
|
126
|
+
"shinkansen-transmission": "2.5.x"
|
|
125
127
|
},
|
|
126
128
|
"imports": {
|
|
127
129
|
"#build/paths": "./build/paths.mjs",
|
|
@@ -129,7 +131,6 @@
|
|
|
129
131
|
"require": "./src/index.cjs",
|
|
130
132
|
"import": "./src/index.mjs"
|
|
131
133
|
},
|
|
132
|
-
"#engine/common": "./src/common/index.mjs",
|
|
133
134
|
"#engine/components": {
|
|
134
135
|
"require": "./src/components/index.cjs",
|
|
135
136
|
"import": "./src/components/index.mjs"
|
|
@@ -155,7 +156,6 @@
|
|
|
155
156
|
"require": "./src/index.cjs",
|
|
156
157
|
"import": "./src/index.mjs"
|
|
157
158
|
},
|
|
158
|
-
"./common": "./src/common/index.mjs",
|
|
159
159
|
"./components": {
|
|
160
160
|
"require": "./src/components/index.cjs",
|
|
161
161
|
"import": "./src/components/index.mjs"
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
"./components/gears/forward": "./src/components/gears/forward/index.cjs",
|
|
168
168
|
"./components/gears/reverse": "./src/components/gears/reverse/index.cjs",
|
|
169
169
|
"./engine": "./src/engine/index.cjs",
|
|
170
|
-
"./
|
|
170
|
+
"./transformers": "./src/transformers/index.mjs",
|
|
171
171
|
"./transformers/*": "./src/transformers/*/index.mjs"
|
|
172
172
|
}
|
|
173
173
|
}
|
package/src/engine/index.cjs
CHANGED
|
@@ -6,12 +6,15 @@ require('@babel/register')({
|
|
|
6
6
|
|
|
7
7
|
const debug = require('debug')
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
default: component // @ts-ignore
|
|
11
|
-
} = require('./index.jsx')
|
|
12
|
-
|
|
13
|
-
const log = debug('shinksansen-engine')
|
|
9
|
+
const log = debug('shinksansen-engine/engine')
|
|
14
10
|
|
|
15
11
|
log('`shinkansen` is awake')
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
const {
|
|
14
|
+
default: Engine // @ts-expect-error
|
|
15
|
+
} = require('./index.jsx')
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Exports only default
|
|
19
|
+
*/
|
|
20
|
+
module.exports = Engine
|
package/src/engine/index.d.mts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
declare module '#engine/engine' {
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import type { PinionProps } from 'shinkansen-pinion/pinion'
|
|
4
|
-
import type { GearsProps } from 'shinkansen-gears/gears'
|
|
5
3
|
|
|
6
|
-
export type EngineProps =
|
|
4
|
+
export type EngineProps = EngineTypes.EngineProps
|
|
7
5
|
|
|
8
6
|
export default class Engine extends React.Component<EngineProps> {}
|
|
9
7
|
}
|
package/src/engine/index.jsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @typedef {EngineTypes.OnEventType} OnEventType
|
|
2
3
|
* @typedef {EngineTypes.Components.Pinion.PinionType} PinionType
|
|
3
4
|
* @typedef {EngineTypes.Components.Pinion.ParamsType} ParamsType
|
|
4
5
|
* @typedef {EngineTypes.Components.Gears.GearsProps} GearsProps
|
|
@@ -10,9 +11,12 @@ import PropTypes from 'prop-types'
|
|
|
10
11
|
import Pinion from '#engine/components/pinion'
|
|
11
12
|
import Gears from '#engine/components/gears'
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
/**
|
|
15
|
+
* @type {OnEventType}
|
|
16
|
+
*/
|
|
17
|
+
function DEFAULT_HANDLE_EVENT () {
|
|
18
|
+
/* */
|
|
19
|
+
}
|
|
16
20
|
|
|
17
21
|
/**
|
|
18
22
|
* @type {ParamsType}
|
|
@@ -39,9 +43,9 @@ export default class Engine extends Component {
|
|
|
39
43
|
*/
|
|
40
44
|
params = DEFAULT_PARAMS,
|
|
41
45
|
/**
|
|
42
|
-
* @type {
|
|
46
|
+
* @type {OnEventType}
|
|
43
47
|
*/
|
|
44
|
-
onChange =
|
|
48
|
+
onChange = DEFAULT_HANDLE_EVENT,
|
|
45
49
|
/**
|
|
46
50
|
* @type {GearsType}
|
|
47
51
|
*/
|
package/src/index.cjs
CHANGED
|
@@ -16,9 +16,11 @@ const Rails = require('./components/rails/index.cjs')
|
|
|
16
16
|
const Signals = require('./components/signals/index.cjs')
|
|
17
17
|
const Pantograph = require('./components/pantograph/index.cjs')
|
|
18
18
|
|
|
19
|
-
const {
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const {
|
|
20
|
+
fromDocumentToHash,
|
|
21
|
+
fromHashToDocument,
|
|
22
|
+
toZashiki // @ts-expect-error MJS
|
|
23
|
+
} = require('./transformers/transmission/index.mjs')
|
|
22
24
|
|
|
23
25
|
const log = debug('shinksansen-engine')
|
|
24
26
|
|
package/src/common/index.d.mts
DELETED