shinkansen-engine 1.4.11 → 1.5.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/eslint.config.mjs +10 -14
- package/index.d.mts +4 -0
- package/package.json +18 -21
- 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.0",
|
|
4
4
|
"description": "Shinkansen Engine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Shinkansen",
|
|
@@ -77,7 +77,6 @@
|
|
|
77
77
|
"core-js": "^3.41.0",
|
|
78
78
|
"cross-env": "^7.0.3",
|
|
79
79
|
"eslint": "^9.21.0",
|
|
80
|
-
"eslint-import-resolver-babel-module": "^5.3.2",
|
|
81
80
|
"eslint-plugin-react": "^7.37.4",
|
|
82
81
|
"eslint-plugin-storybook": "^0.11.4",
|
|
83
82
|
"globals": "^16.0.0",
|
|
@@ -100,28 +99,28 @@
|
|
|
100
99
|
"remove-files-webpack-plugin": "^1.5.0",
|
|
101
100
|
"sass": "^1.85.1",
|
|
102
101
|
"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.
|
|
102
|
+
"shinkansen-cogs": "1.9.0",
|
|
103
|
+
"shinkansen-gears": "1.3.0",
|
|
104
|
+
"shinkansen-pantograph": "1.5.0",
|
|
105
|
+
"shinkansen-pinion": "1.4.0",
|
|
106
|
+
"shinkansen-rails": "1.1.0",
|
|
107
|
+
"shinkansen-signals": "1.2.0",
|
|
108
|
+
"shinkansen-sprockets": "1.3.0",
|
|
109
|
+
"shinkansen-transmission": "2.5.0",
|
|
111
110
|
"sinon": "^19.0.2",
|
|
112
111
|
"storybook": "7.6.20",
|
|
113
112
|
"webpack": "^5.98.0",
|
|
114
113
|
"webpack-cli": "^6.0.1"
|
|
115
114
|
},
|
|
116
115
|
"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.
|
|
116
|
+
"shinkansen-cogs": "1.9.x",
|
|
117
|
+
"shinkansen-gears": "1.3.x",
|
|
118
|
+
"shinkansen-pantograph": "1.5.x",
|
|
119
|
+
"shinkansen-pinion": "1.4.x",
|
|
120
|
+
"shinkansen-rails": "1.1.x",
|
|
121
|
+
"shinkansen-signals": "1.2.x",
|
|
122
|
+
"shinkansen-sprockets": "1.3.x",
|
|
123
|
+
"shinkansen-transmission": "2.5.x"
|
|
125
124
|
},
|
|
126
125
|
"imports": {
|
|
127
126
|
"#build/paths": "./build/paths.mjs",
|
|
@@ -129,7 +128,6 @@
|
|
|
129
128
|
"require": "./src/index.cjs",
|
|
130
129
|
"import": "./src/index.mjs"
|
|
131
130
|
},
|
|
132
|
-
"#engine/common": "./src/common/index.mjs",
|
|
133
131
|
"#engine/components": {
|
|
134
132
|
"require": "./src/components/index.cjs",
|
|
135
133
|
"import": "./src/components/index.mjs"
|
|
@@ -155,7 +153,6 @@
|
|
|
155
153
|
"require": "./src/index.cjs",
|
|
156
154
|
"import": "./src/index.mjs"
|
|
157
155
|
},
|
|
158
|
-
"./common": "./src/common/index.mjs",
|
|
159
156
|
"./components": {
|
|
160
157
|
"require": "./src/components/index.cjs",
|
|
161
158
|
"import": "./src/components/index.mjs"
|
|
@@ -167,7 +164,7 @@
|
|
|
167
164
|
"./components/gears/forward": "./src/components/gears/forward/index.cjs",
|
|
168
165
|
"./components/gears/reverse": "./src/components/gears/reverse/index.cjs",
|
|
169
166
|
"./engine": "./src/engine/index.cjs",
|
|
170
|
-
"./
|
|
167
|
+
"./transformers": "./src/transformers/index.mjs",
|
|
171
168
|
"./transformers/*": "./src/transformers/*/index.mjs"
|
|
172
169
|
}
|
|
173
170
|
}
|
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