shinkansen-engine 1.0.24 → 1.0.27

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.
Files changed (36) hide show
  1. package/package.json +30 -15
  2. package/src/components/gears/forward/index.cjs +9 -0
  3. package/src/components/gears/index.cjs +1 -1
  4. package/src/components/gears/reverse/index.cjs +9 -0
  5. package/src/components/pinion/check-answers/index.cjs +13 -0
  6. package/src/components/pinion/check-answers/index.mjs +7 -0
  7. package/src/components/pinion/common/index.cjs +9 -0
  8. package/src/components/pinion/common/index.mjs +7 -0
  9. package/src/components/pinion/common/text-content/index.cjs +9 -0
  10. package/src/components/pinion/error-summary/index.cjs +13 -0
  11. package/src/components/pinion/error-summary/index.mjs +7 -0
  12. package/src/components/pinion/index.mjs +0 -0
  13. package/src/transformers/pinion/common/index.mjs +0 -1
  14. package/src/transformers/pinion/error-message/index.mjs +7 -0
  15. package/test/components/cogs/index.spec.mjs +13 -0
  16. package/test/components/gears/forward/index.spec.mjs +13 -0
  17. package/test/components/gears/index.spec.mjs +13 -0
  18. package/test/components/gears/reverse/index.spec.mjs +13 -0
  19. package/test/components/pantograph/index.spec.mjs +13 -0
  20. package/test/components/pinion/check-answers/index.spec.mjs +13 -0
  21. package/test/components/pinion/common/index.spec.mjs +13 -0
  22. package/test/components/pinion/common/text-content/index.spec.mjs +13 -0
  23. package/test/components/pinion/error-summary/index.spec.mjs +13 -0
  24. package/test/components/pinion/index.spec.mjs +13 -0
  25. package/test/components/rails/index.spec.mjs +13 -0
  26. package/test/components/signals/index.spec.mjs +13 -0
  27. package/test/components/sprockets/index.spec.mjs +13 -0
  28. package/test/engine/index.spec.mjs +13 -0
  29. package/test/transformers/pinion/check-answers/index.spec.mjs +18 -0
  30. package/test/transformers/pinion/common/index.spec.mjs +18 -0
  31. package/test/transformers/pinion/error-message/index.spec.mjs +18 -0
  32. package/test/transformers/transmission/from-document-to-hash/index.spec.mjs +13 -0
  33. package/test/transformers/transmission/from-hash-to-document/index.spec.mjs +13 -0
  34. package/test/transformers/transmission/index.spec.mjs +27 -0
  35. package/test/transformers/transmission/to-zashiki/index.spec.mjs +13 -0
  36. package/src/transformers/pinion/error-summary/index.mjs +0 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shinkansen-engine",
3
- "version": "1.0.24",
3
+ "version": "1.0.27",
4
4
  "description": "Shinkansen Engine",
5
5
  "keywords": [
6
6
  "Shinkansen",
@@ -35,20 +35,25 @@
35
35
  "prelint": "npm run nvm",
36
36
  "lint": "eslint . .storybook --ext .mjs --ext .cjs --ext .jsx",
37
37
  "lint:fix": "npm run lint -- --fix",
38
- "test": "cross-env NODE_ENV=test jest --collect-coverage false --pass-with-no-tests --verbose --run-in-band",
38
+ "pretest": "npm run nvm",
39
+ "test": "cross-env NODE_ENV=test mocha test --recursive",
39
40
  "nvm": "bash nvm.sh",
40
41
  "storybook": "npm run build && npm run transform && start-storybook -p 6010"
41
42
  },
42
43
  "dependencies": {
44
+ "chai": "^4.3.7",
43
45
  "debug": "^4.3.4",
44
- "shinkansen-cogs": "1.5.49",
45
- "shinkansen-gears": "1.0.38",
46
- "shinkansen-pantograph": "1.1.7",
47
- "shinkansen-pinion": "1.0.47",
48
- "shinkansen-rails": "1.0.23",
49
- "shinkansen-signals": "1.1.8",
50
- "shinkansen-sprockets": "1.0.51",
51
- "shinkansen-transmission": "2.2.3"
46
+ "mocha": "^10.2.0",
47
+ "shinkansen-cogs": "1.5.54",
48
+ "shinkansen-gears": "1.0.42",
49
+ "shinkansen-pantograph": "1.1.10",
50
+ "shinkansen-pinion": "1.0.52",
51
+ "shinkansen-rails": "1.0.26",
52
+ "shinkansen-signals": "1.1.11",
53
+ "shinkansen-sprockets": "1.0.54",
54
+ "shinkansen-transmission": "2.2.6",
55
+ "sinon": "^15.0.4",
56
+ "sinon-chai": "^3.7.0"
52
57
  },
53
58
  "devDependencies": {
54
59
  "@babel/cli": "^7.21.5",
@@ -61,9 +66,9 @@
61
66
  "@babel/preset-env": "^7.21.5",
62
67
  "@babel/preset-react": "^7.18.6",
63
68
  "@babel/register": "^7.21.0",
64
- "@modernpoacher/design-system": "1.0.3",
65
- "@modernpoacher/hooks": "^1.0.394",
66
- "@sequencemedia/gulp": "^1.0.6",
69
+ "@modernpoacher/design-system": "1.0.4",
70
+ "@modernpoacher/hooks": "^1.0.395",
71
+ "@sequencemedia/gulp": "^1.0.7",
67
72
  "@storybook/addon-actions": "6.5.12",
68
73
  "@storybook/addon-essentials": "6.5.12",
69
74
  "@storybook/addon-links": "6.5.12",
@@ -71,7 +76,7 @@
71
76
  "autoprefixer": "^10.4.14",
72
77
  "babel-plugin-module-resolver": "^5.0.0",
73
78
  "concurrently": "^8.0.1",
74
- "core-js": "^3.30.1",
79
+ "core-js": "^3.30.2",
75
80
  "cross-env": "^7.0.3",
76
81
  "cssnano": "^6.0.1",
77
82
  "del": "^7.0.0",
@@ -128,13 +133,23 @@
128
133
  "./components/gears/forward": "./src/components/gears/forward/index.cjs",
129
134
  "./components/gears/reverse": "./src/components/gears/forward/index.cjs",
130
135
  "./components/gears": "./src/components/gears/index.cjs",
136
+ "./components/pinion/check-answers": {
137
+ "require": "./src/components/pinion/check-answers/index.cjs",
138
+ "import": "./src/components/pinion/check-answers/index.mjs"
139
+ },
140
+ "./components/pinion/common/text-content": "./src/components/pinion/common/text-content/index.cjs",
141
+ "./components/pinion/common": "./src/components/pinion/common/index.mjs",
142
+ "./components/pinion/error-summary": {
143
+ "require": "./src/components/pinion/error-summary/index.cjs",
144
+ "import": "./src/components/pinion/error-summary/index.mjs"
145
+ },
131
146
  "./components/pinion": "./src/components/pinion/index.cjs",
132
147
  "./components/rails": "./src/components/rails/index.cjs",
133
148
  "./components/signals": "./src/components/signals/index.cjs",
134
149
  "./components/pantograph": "./src/components/pantograph/index.cjs",
135
150
  "./transformers/pinion/check-answers": "./src/transformers/pinion/check-answers/index.mjs",
136
151
  "./transformers/pinion/common": "./src/transformers/pinion/common/index.mjs",
137
- "./transformers/pinion/error-summary": "./src/transformers/pinion/error-summary/index.mjs",
152
+ "./transformers/pinion/error-message": "./src/transformers/pinion/error-message/index.mjs",
138
153
  "./transformers/pinion": "./src/transformers/pinion/index.mjs",
139
154
  "./transformers/transmission/from-document-to-hash": "./src/transformers/transmission/from-document-to-hash/index.mjs",
140
155
  "./transformers/transmission/from-hash-to-document": "./src/transformers/transmission/from-hash-to-document/index.mjs",
@@ -0,0 +1,9 @@
1
+ require('@babel/register')
2
+
3
+ const debug = require('debug')
4
+
5
+ const log = debug('shinkansen-engine/components/gears/forward')
6
+
7
+ log('`shinkansen` is awake')
8
+
9
+ module.exports = require('shinkansen-gears/gears/forward')
@@ -6,7 +6,7 @@ const {
6
6
  Gears
7
7
  } = require('shinkansen-gears')
8
8
 
9
- const log = debug('shinksansen-engine')
9
+ const log = debug('shinksansen-engine/components/gears')
10
10
 
11
11
  log('`shinkansen` is awake')
12
12
 
@@ -0,0 +1,9 @@
1
+ require('@babel/register')
2
+
3
+ const debug = require('debug')
4
+
5
+ const log = debug('shinkansen-engine/components/gears/reverse')
6
+
7
+ log('`shinkansen` is awake')
8
+
9
+ module.exports = require('shinkansen-gears/gears/reverse')
@@ -0,0 +1,13 @@
1
+ require('@babel/register')({ ignore: [] })
2
+
3
+ const debug = require('debug')
4
+
5
+ const {
6
+ default: CheckAnswers
7
+ } = require('shinkansen-pinion/components/check-answers')
8
+
9
+ const log = debug('shinksansen-engine/components/pinion/check-answers')
10
+
11
+ log('`shinkansen` is awake')
12
+
13
+ module.exports = CheckAnswers
@@ -0,0 +1,7 @@
1
+ import debug from 'debug'
2
+
3
+ const log = debug('shinksansen-engine/components/pinion/check-answers')
4
+
5
+ log('`shinkansen` is awake')
6
+
7
+ export { default } from 'shinkansen-pinion/components/check-answers'
@@ -0,0 +1,9 @@
1
+ require('@babel/register')({ ignore: [] })
2
+
3
+ const debug = require('debug')
4
+
5
+ const log = debug('shinksansen-engine/components/pinion/common')
6
+
7
+ log('`shinkansen` is awake')
8
+
9
+ module.exports = require('shinkansen-pinion/components/common')
@@ -0,0 +1,7 @@
1
+ import debug from 'debug'
2
+
3
+ const log = debug('shinksansen-engine/components/pinion/common')
4
+
5
+ log('`shinkansen` is awake')
6
+
7
+ export * from 'shinkansen-pinion/components/common'
@@ -0,0 +1,9 @@
1
+ require('@babel/register')({ ignore: [] })
2
+
3
+ const debug = require('debug')
4
+
5
+ const log = debug('shinksansen-engine/components/pinion/common/text-content')
6
+
7
+ log('`shinkansen` is awake')
8
+
9
+ module.exports = require('shinkansen-pinion/components/common/text-content')
@@ -0,0 +1,13 @@
1
+ require('@babel/register')({ ignore: [] })
2
+
3
+ const debug = require('debug')
4
+
5
+ const {
6
+ default: ErrorSummary
7
+ } = require('shinkansen-pinion/components/error-summary')
8
+
9
+ const log = debug('shinksansen-engine/components/pinion/error-summary')
10
+
11
+ log('`shinkansen` is awake')
12
+
13
+ module.exports = ErrorSummary
@@ -0,0 +1,7 @@
1
+ import debug from 'debug'
2
+
3
+ const log = debug('shinksansen-engine/components/pinion/error-summary')
4
+
5
+ log('`shinkansen` is awake')
6
+
7
+ export { default } from 'shinkansen-pinion/components/error-summary'
File without changes
@@ -5,4 +5,3 @@ const log = debug('shinksansen-engine')
5
5
  log('`shinkansen` is awake')
6
6
 
7
7
  export * from 'shinkansen-pinion/transformers/common'
8
- export { default } from 'shinkansen-pinion/transformers/common'
@@ -0,0 +1,7 @@
1
+ import debug from 'debug'
2
+
3
+ const log = debug('shinksansen-engine')
4
+
5
+ log('`shinkansen` is awake')
6
+
7
+ export * from 'shinkansen-pinion/transformers/error-message'
@@ -0,0 +1,13 @@
1
+ import chai, { expect } from 'chai'
2
+ import sinonChai from 'sinon-chai'
3
+
4
+ import Cogs from 'shinkansen-engine/components/cogs'
5
+
6
+ chai.use(sinonChai)
7
+
8
+ describe('shinkansen-engine/components/cogs', () => {
9
+ it('is an object', () => {
10
+ return expect(Cogs)
11
+ .to.be.an('object')
12
+ })
13
+ })
@@ -0,0 +1,13 @@
1
+ import chai, { expect } from 'chai'
2
+ import sinonChai from 'sinon-chai'
3
+
4
+ import Forward from 'shinkansen-engine/components/gears/forward'
5
+
6
+ chai.use(sinonChai)
7
+
8
+ describe('shinkansen-engine/components/gears/forward', () => {
9
+ it('is a function', () => {
10
+ return expect(Forward)
11
+ .to.be.a('function')
12
+ })
13
+ })
@@ -0,0 +1,13 @@
1
+ import chai, { expect } from 'chai'
2
+ import sinonChai from 'sinon-chai'
3
+
4
+ import Gears from 'shinkansen-engine/components/gears'
5
+
6
+ chai.use(sinonChai)
7
+
8
+ describe('shinkansen-engine/components/gears', () => {
9
+ it('is a function', () => {
10
+ return expect(Gears)
11
+ .to.be.a('function')
12
+ })
13
+ })
@@ -0,0 +1,13 @@
1
+ import chai, { expect } from 'chai'
2
+ import sinonChai from 'sinon-chai'
3
+
4
+ import Reverse from 'shinkansen-engine/components/gears/reverse'
5
+
6
+ chai.use(sinonChai)
7
+
8
+ describe('shinkansen-engine/components/gears/reverse', () => {
9
+ it('is a function', () => {
10
+ return expect(Reverse)
11
+ .to.be.a('function')
12
+ })
13
+ })
@@ -0,0 +1,13 @@
1
+ import chai, { expect } from 'chai'
2
+ import sinonChai from 'sinon-chai'
3
+
4
+ import Pantograph from 'shinkansen-engine/components/pantograph'
5
+
6
+ chai.use(sinonChai)
7
+
8
+ describe('shinkansen-engine/components/pantograph', () => {
9
+ it('is a function', () => {
10
+ return expect(Pantograph)
11
+ .to.be.a('function')
12
+ })
13
+ })
@@ -0,0 +1,13 @@
1
+ import chai, { expect } from 'chai'
2
+ import sinonChai from 'sinon-chai'
3
+
4
+ import CheckAnswers from 'shinkansen-engine/components/pinion/check-answers'
5
+
6
+ chai.use(sinonChai)
7
+
8
+ describe('shinkansen-engine/components/pinion/check-answers', () => {
9
+ it('is a function', () => {
10
+ return expect(CheckAnswers)
11
+ .to.be.a('function')
12
+ })
13
+ })
@@ -0,0 +1,13 @@
1
+ import chai, { expect } from 'chai'
2
+ import sinonChai from 'sinon-chai'
3
+
4
+ import * as common from 'shinkansen-engine/components/pinion/common'
5
+
6
+ chai.use(sinonChai)
7
+
8
+ describe('shinkansen-engine/components/pinion/common', () => {
9
+ it('is a module', () => {
10
+ return expect(common)
11
+ .to.be.a('module')
12
+ })
13
+ })
@@ -0,0 +1,13 @@
1
+ import chai, { expect } from 'chai'
2
+ import sinonChai from 'sinon-chai'
3
+
4
+ import TextContent from 'shinkansen-engine/components/pinion/common/text-content'
5
+
6
+ chai.use(sinonChai)
7
+
8
+ describe('shinkansen-engine/components/pinion/common/text-content', () => {
9
+ it('is a function', () => {
10
+ return expect(TextContent)
11
+ .to.be.a('function')
12
+ })
13
+ })
@@ -0,0 +1,13 @@
1
+ import chai, { expect } from 'chai'
2
+ import sinonChai from 'sinon-chai'
3
+
4
+ import ErrorSummary from 'shinkansen-engine/components/pinion/error-summary'
5
+
6
+ chai.use(sinonChai)
7
+
8
+ describe('shinkansen-engine/components/pinion/error-summary', () => {
9
+ it('is a function', () => {
10
+ return expect(ErrorSummary)
11
+ .to.be.a('function')
12
+ })
13
+ })
@@ -0,0 +1,13 @@
1
+ import chai, { expect } from 'chai'
2
+ import sinonChai from 'sinon-chai'
3
+
4
+ import Pinion from 'shinkansen-engine/components/pinion'
5
+
6
+ chai.use(sinonChai)
7
+
8
+ describe('shinkansen-engine/components/pinion', () => {
9
+ it('is a function', () => {
10
+ return expect(Pinion)
11
+ .to.be.a('function')
12
+ })
13
+ })
@@ -0,0 +1,13 @@
1
+ import chai, { expect } from 'chai'
2
+ import sinonChai from 'sinon-chai'
3
+
4
+ import Rails from 'shinkansen-engine/components/rails'
5
+
6
+ chai.use(sinonChai)
7
+
8
+ describe('shinkansen-engine/components/rails', () => {
9
+ it('is a function', () => {
10
+ return expect(Rails)
11
+ .to.be.a('function')
12
+ })
13
+ })
@@ -0,0 +1,13 @@
1
+ import chai, { expect } from 'chai'
2
+ import sinonChai from 'sinon-chai'
3
+
4
+ import Signals from 'shinkansen-engine/components/signals'
5
+
6
+ chai.use(sinonChai)
7
+
8
+ describe('shinkansen-engine/components/signals', () => {
9
+ it('is an object', () => {
10
+ return expect(Signals)
11
+ .to.be.an('object')
12
+ })
13
+ })
@@ -0,0 +1,13 @@
1
+ import chai, { expect } from 'chai'
2
+ import sinonChai from 'sinon-chai'
3
+
4
+ import Sprockets from 'shinkansen-engine/components/sprockets'
5
+
6
+ chai.use(sinonChai)
7
+
8
+ describe('shinkansen-engine/components/sprockets', () => {
9
+ it('is an object', () => {
10
+ return expect(Sprockets)
11
+ .to.be.a('object')
12
+ })
13
+ })
@@ -0,0 +1,13 @@
1
+ import chai, { expect } from 'chai'
2
+ import sinonChai from 'sinon-chai'
3
+
4
+ import Engine from 'shinkansen-engine/engine'
5
+
6
+ chai.use(sinonChai)
7
+
8
+ describe('shinkansen-engine/engine', () => {
9
+ it('is a function', () => {
10
+ return expect(Engine)
11
+ .to.be.a('function')
12
+ })
13
+ })
@@ -0,0 +1,18 @@
1
+ import chai, { expect } from 'chai'
2
+ import sinonChai from 'sinon-chai'
3
+
4
+ import * as checkAnswers from 'shinkansen-engine/transformers/pinion/check-answers'
5
+
6
+ chai.use(sinonChai)
7
+
8
+ describe('shinkansen-engine/transformers/pinion/check-answers', () => {
9
+ /**
10
+ * A pass-through from `shinkansen-pinion` so we don't interrogate the module
11
+ *
12
+ * (This project exports exactly what `shinkansen-pinion` exports)
13
+ */
14
+ it('is a module', () => {
15
+ return expect(checkAnswers)
16
+ .to.be.a('module')
17
+ })
18
+ })
@@ -0,0 +1,18 @@
1
+ import chai, { expect } from 'chai'
2
+ import sinonChai from 'sinon-chai'
3
+
4
+ import * as common from 'shinkansen-engine/transformers/pinion/common'
5
+
6
+ chai.use(sinonChai)
7
+
8
+ describe('shinkansen-engine/transformers/pinion/common', () => {
9
+ /**
10
+ * A pass-through from `shinkansen-pinion` so we don't interrogate the module
11
+ *
12
+ * (This project exports exactly what `shinkansen-pinion` exports)
13
+ */
14
+ it('is a module', () => {
15
+ return expect(common)
16
+ .to.be.a('module')
17
+ })
18
+ })
@@ -0,0 +1,18 @@
1
+ import chai, { expect } from 'chai'
2
+ import sinonChai from 'sinon-chai'
3
+
4
+ import * as errorMessage from 'shinkansen-engine/transformers/pinion/error-message'
5
+
6
+ chai.use(sinonChai)
7
+
8
+ describe('shinkansen-engine/transformers/pinion/error-message', () => {
9
+ /**
10
+ * A pass-through from `shinkansen-pinion` so we don't interrogate the module
11
+ *
12
+ * (This project exports exactly what `shinkansen-pinion` exports)
13
+ */
14
+ it('is a module', () => {
15
+ return expect(errorMessage)
16
+ .to.be.a('module')
17
+ })
18
+ })
@@ -0,0 +1,13 @@
1
+ import chai, { expect } from 'chai'
2
+ import sinonChai from 'sinon-chai'
3
+
4
+ import fromDocumentToHash from 'shinkansen-engine/transformers/transmission/from-document-to-hash'
5
+
6
+ chai.use(sinonChai)
7
+
8
+ describe('shinkansen-engine/transformers/transmission/from-document-to-hash', () => {
9
+ it('is a function', () => {
10
+ return expect(fromDocumentToHash)
11
+ .to.be.a('function')
12
+ })
13
+ })
@@ -0,0 +1,13 @@
1
+ import chai, { expect } from 'chai'
2
+ import sinonChai from 'sinon-chai'
3
+
4
+ import fromHashToDocument from 'shinkansen-engine/transformers/transmission/from-hash-to-document'
5
+
6
+ chai.use(sinonChai)
7
+
8
+ describe('shinkansen-engine/transformers/transmission/from-hash-to-document', () => {
9
+ it('is a function', () => {
10
+ return expect(fromHashToDocument)
11
+ .to.be.a('function')
12
+ })
13
+ })
@@ -0,0 +1,27 @@
1
+ import chai, { expect } from 'chai'
2
+ import sinonChai from 'sinon-chai'
3
+
4
+ import {
5
+ fromDocumentToHash,
6
+ fromHashToDocument,
7
+ toZashiki
8
+ } from 'shinkansen-engine/transformers/transmission'
9
+
10
+ chai.use(sinonChai)
11
+
12
+ describe('shinkansen-engine/transformers/transmission', () => {
13
+ it('is a function', () => {
14
+ return expect(fromDocumentToHash)
15
+ .to.be.a('function')
16
+ })
17
+
18
+ it('is a function', () => {
19
+ return expect(fromHashToDocument)
20
+ .to.be.a('function')
21
+ })
22
+
23
+ it('is a function', () => {
24
+ return expect(toZashiki)
25
+ .to.be.a('function')
26
+ })
27
+ })
@@ -0,0 +1,13 @@
1
+ import chai, { expect } from 'chai'
2
+ import sinonChai from 'sinon-chai'
3
+
4
+ import toZashiki from 'shinkansen-engine/transformers/transmission/to-zashiki'
5
+
6
+ chai.use(sinonChai)
7
+
8
+ describe('shinkansen-engine/transformers/transmission/to-zashiki', () => {
9
+ it('is a function', () => {
10
+ return expect(toZashiki)
11
+ .to.be.a('function')
12
+ })
13
+ })
@@ -1,8 +0,0 @@
1
- import debug from 'debug'
2
-
3
- const log = debug('shinksansen-engine')
4
-
5
- log('`shinkansen` is awake')
6
-
7
- export * from 'shinkansen-pinion/transformers/error-summary'
8
- export { default } from 'shinkansen-pinion/transformers/error-summary'