shinkansen-pinion 1.1.508 → 1.1.511
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 +1 -12
- package/package.json +33 -19
- package/src/common/index.d.mts +9 -0
- package/src/components/cogs/checkbox/index.cjs +17 -0
- package/src/components/cogs/checkbox/index.mjs +11 -0
- package/src/components/cogs/email/index.cjs +17 -0
- package/src/components/cogs/email/index.mjs +11 -0
- package/src/components/cogs/index.cjs +15 -0
- package/src/components/cogs/number/index.cjs +17 -0
- package/src/components/cogs/number/index.mjs +11 -0
- package/src/components/cogs/password/index.cjs +17 -0
- package/src/components/cogs/password/index.mjs +11 -0
- package/src/components/cogs/textarea/index.cjs +17 -0
- package/src/components/cogs/textarea/index.mjs +11 -0
- package/src/components/index.cjs +14 -0
- package/src/components/sprockets/index.cjs +15 -0
- package/test/components/cogs/index.spec.mjs +0 -33
- package/test/components/cogs/radio/index.spec.mjs +0 -13
- package/test/components/cogs/select/index.spec.mjs +0 -13
- package/test/components/cogs/text/index.spec.mjs +0 -13
- package/test/components/sprockets/check-answers/index.spec.mjs +0 -13
- package/test/components/sprockets/error-summary/index.spec.mjs +0 -13
- package/test/components/sprockets/fieldset/index.spec.mjs +0 -13
- package/test/components/sprockets/index.spec.mjs +0 -33
- package/test/pinion/index.spec.mjs +0 -15
- package/test/transformers/check-answers/index.spec.mjs +0 -13
- package/test/transformers/common/index.spec.mjs +0 -13
- package/test/transformers/error-message/index.spec.mjs +0 -13
- package/transform.sh +0 -4
- package/tsconfig.json +0 -11
- package/webpack.config.mjs +0 -129
package/babel.config.cjs
CHANGED
|
@@ -40,18 +40,7 @@ const presets = [
|
|
|
40
40
|
]
|
|
41
41
|
|
|
42
42
|
const plugins = [
|
|
43
|
-
'@babel/syntax-jsx'
|
|
44
|
-
[
|
|
45
|
-
'module-resolver', {
|
|
46
|
-
alias: {
|
|
47
|
-
/**
|
|
48
|
-
* Storybook
|
|
49
|
-
*/
|
|
50
|
-
'#stories/errors': './stories/errors.mjs',
|
|
51
|
-
'#stories': './stories'
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
]
|
|
43
|
+
'@babel/syntax-jsx'
|
|
55
44
|
]
|
|
56
45
|
|
|
57
46
|
module.exports = (api) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shinkansen-pinion",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.511",
|
|
4
4
|
"description": "Shinkansen Pinion",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Shinkansen",
|
|
@@ -96,10 +96,10 @@
|
|
|
96
96
|
"remove-files-webpack-plugin": "^1.5.0",
|
|
97
97
|
"sass": "^1.81.0",
|
|
98
98
|
"sass-loader": "^16.0.3",
|
|
99
|
-
"shinkansen-cogs": "1.7.
|
|
99
|
+
"shinkansen-cogs": "1.7.271",
|
|
100
100
|
"shinkansen-rails": "1.0.252",
|
|
101
101
|
"shinkansen-signals": "1.1.182",
|
|
102
|
-
"shinkansen-sprockets": "1.1.
|
|
102
|
+
"shinkansen-sprockets": "1.1.430",
|
|
103
103
|
"sinon": "^19.0.2",
|
|
104
104
|
"storybook": "7.6.20",
|
|
105
105
|
"webpack": "^5.96.1",
|
|
@@ -113,7 +113,19 @@
|
|
|
113
113
|
},
|
|
114
114
|
"imports": {
|
|
115
115
|
"#build/paths": "./build/paths.mjs",
|
|
116
|
-
"#
|
|
116
|
+
"#pinion/common": "./src/common/index.mjs",
|
|
117
|
+
"#pinion/components": "./src/components/index.mjs",
|
|
118
|
+
"#pinion/components/*": "./src/components/*/index.mjs",
|
|
119
|
+
"#pinion/pinion": "./src/pinion/index.jsx",
|
|
120
|
+
"#pinion/pinion/*": "./src/pinion/*/index.jsx",
|
|
121
|
+
"#pinion/transformers": "./src/transformers/index.mjs",
|
|
122
|
+
"#pinion/transformers/*": "./src/transformers/*/index.mjs",
|
|
123
|
+
"#stories/components/*": "./stories/components/*/index.stories.jsx",
|
|
124
|
+
"#stories/definitions/*": "./stories/definitions/*.json",
|
|
125
|
+
"#stories/errors": "./stories/errors.mjs",
|
|
126
|
+
"#stories/pinion/*": "./stories/pinion/*/index.stories.jsx",
|
|
127
|
+
"#stories/state": "./stories/state/index.jsx",
|
|
128
|
+
"#stories/state/*": "./stories/state/*/index.jsx"
|
|
117
129
|
},
|
|
118
130
|
"exports": {
|
|
119
131
|
".": {
|
|
@@ -121,23 +133,25 @@
|
|
|
121
133
|
"import": "./src/index.mjs"
|
|
122
134
|
},
|
|
123
135
|
"./common": "./src/common/index.mjs",
|
|
124
|
-
"./components":
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
"./components/cogs/select": "./src/components/cogs/select/index.cjs",
|
|
128
|
-
"./components/cogs/text": "./src/components/cogs/text/index.cjs",
|
|
129
|
-
"./components/sprockets": "./src/components/sprockets/index.mjs",
|
|
130
|
-
"./components/sprockets/check-answers": {
|
|
131
|
-
"require": "./src/components/sprockets/check-answers/index.cjs",
|
|
132
|
-
"import": "./src/components/sprockets/check-answers/index.mjs"
|
|
136
|
+
"./components": {
|
|
137
|
+
"require": "./src/components/index.cjs",
|
|
138
|
+
"import": "./src/components/index.mjs"
|
|
133
139
|
},
|
|
134
|
-
"./components/
|
|
135
|
-
"require": "./src/components/
|
|
136
|
-
"import": "./src/components/
|
|
140
|
+
"./components/cogs": {
|
|
141
|
+
"require": "./src/components/cogs/index.cjs",
|
|
142
|
+
"import": "./src/components/cogs/index.mjs"
|
|
137
143
|
},
|
|
138
|
-
"./components/
|
|
139
|
-
"require": "./src/components/
|
|
140
|
-
"import": "./src/components/
|
|
144
|
+
"./components/cogs/*": {
|
|
145
|
+
"require": "./src/components/cogs/*/index.cjs",
|
|
146
|
+
"import": "./src/components/cogs/*/index.mjs"
|
|
147
|
+
},
|
|
148
|
+
"./components/sprockets": {
|
|
149
|
+
"require": "./src/components/sprockets/index.cjs",
|
|
150
|
+
"import": "./src/components/sprockets/index.mjs"
|
|
151
|
+
},
|
|
152
|
+
"./components/sprockets/*": {
|
|
153
|
+
"require": "./src/components/sprockets/*/index.cjs",
|
|
154
|
+
"import": "./src/components/sprockets/*/index.mjs"
|
|
141
155
|
},
|
|
142
156
|
"./pinion": "./src/pinion/index.cjs",
|
|
143
157
|
"./transformers": "./src/transformers/index.mjs",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
require('@babel/register')({
|
|
2
|
+
ignore: [
|
|
3
|
+
/node_modules\/(?!shinkansen|@modernpoacher)/
|
|
4
|
+
]
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
const debug = require('debug')
|
|
8
|
+
|
|
9
|
+
const log = debug('shinkansen-pinion/components/cogs/checkbox')
|
|
10
|
+
|
|
11
|
+
log('`shinkansen` is awake')
|
|
12
|
+
|
|
13
|
+
const {
|
|
14
|
+
CheckboxCog
|
|
15
|
+
} = require('shinkansen-cogs')
|
|
16
|
+
|
|
17
|
+
module.exports = CheckboxCog
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
require('@babel/register')({
|
|
2
|
+
ignore: [
|
|
3
|
+
/node_modules\/(?!shinkansen|@modernpoacher)/
|
|
4
|
+
]
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
const debug = require('debug')
|
|
8
|
+
|
|
9
|
+
const log = debug('shinkansen-pinion/components/cogs/email')
|
|
10
|
+
|
|
11
|
+
log('`shinkansen` is awake')
|
|
12
|
+
|
|
13
|
+
const {
|
|
14
|
+
EmailCog
|
|
15
|
+
} = require('shinkansen-cogs')
|
|
16
|
+
|
|
17
|
+
module.exports = EmailCog
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require('@babel/register')({
|
|
2
|
+
ignore: [
|
|
3
|
+
/node_modules\/(?!shinkansen|@modernpoacher)/
|
|
4
|
+
]
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
const debug = require('debug')
|
|
8
|
+
|
|
9
|
+
const log = debug('shinkansen-pinion/components/sprockets')
|
|
10
|
+
|
|
11
|
+
log('`shinkansen` is awake')
|
|
12
|
+
|
|
13
|
+
module.exports.RadioCog = require('./radio/index.cjs')
|
|
14
|
+
module.exports.SelectCog = require('./select/index.cjs')
|
|
15
|
+
module.exports.TextCog = require('./text/index.cjs')
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
require('@babel/register')({
|
|
2
|
+
ignore: [
|
|
3
|
+
/node_modules\/(?!shinkansen|@modernpoacher)/
|
|
4
|
+
]
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
const debug = require('debug')
|
|
8
|
+
|
|
9
|
+
const log = debug('shinkansen-pinion/components/cogs/number')
|
|
10
|
+
|
|
11
|
+
log('`shinkansen` is awake')
|
|
12
|
+
|
|
13
|
+
const {
|
|
14
|
+
NumberCog
|
|
15
|
+
} = require('shinkansen-cogs')
|
|
16
|
+
|
|
17
|
+
module.exports = NumberCog
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
require('@babel/register')({
|
|
2
|
+
ignore: [
|
|
3
|
+
/node_modules\/(?!shinkansen|@modernpoacher)/
|
|
4
|
+
]
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
const debug = require('debug')
|
|
8
|
+
|
|
9
|
+
const log = debug('shinkansen-pinion/components/cogs/password')
|
|
10
|
+
|
|
11
|
+
log('`shinkansen` is awake')
|
|
12
|
+
|
|
13
|
+
const {
|
|
14
|
+
PasswordCog
|
|
15
|
+
} = require('shinkansen-cogs')
|
|
16
|
+
|
|
17
|
+
module.exports = PasswordCog
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
require('@babel/register')({
|
|
2
|
+
ignore: [
|
|
3
|
+
/node_modules\/(?!shinkansen|@modernpoacher)/
|
|
4
|
+
]
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
const debug = require('debug')
|
|
8
|
+
|
|
9
|
+
const log = debug('shinkansen-pinion/components/cogs/textarea')
|
|
10
|
+
|
|
11
|
+
log('`shinkansen` is awake')
|
|
12
|
+
|
|
13
|
+
const {
|
|
14
|
+
TextareaCog
|
|
15
|
+
} = require('shinkansen-cogs')
|
|
16
|
+
|
|
17
|
+
module.exports = TextareaCog
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
require('@babel/register')({
|
|
2
|
+
ignore: [
|
|
3
|
+
/node_modules\/(?!shinkansen|@modernpoacher)/
|
|
4
|
+
]
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
const debug = require('debug')
|
|
8
|
+
|
|
9
|
+
const log = debug('shinkansen-pinion/components/sprockets')
|
|
10
|
+
|
|
11
|
+
log('`shinkansen` is awake')
|
|
12
|
+
|
|
13
|
+
module.exports.Cogs = require('./cogs/index.cjs')
|
|
14
|
+
module.exports.Sprockets = require('./sprockets/index.cjs')
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require('@babel/register')({
|
|
2
|
+
ignore: [
|
|
3
|
+
/node_modules\/(?!shinkansen|@modernpoacher)/
|
|
4
|
+
]
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
const debug = require('debug')
|
|
8
|
+
|
|
9
|
+
const log = debug('shinkansen-pinion/components/sprockets')
|
|
10
|
+
|
|
11
|
+
log('`shinkansen` is awake')
|
|
12
|
+
|
|
13
|
+
module.exports.CheckAnswers = require('./check-answers/index.cjs')
|
|
14
|
+
module.exports.ErrorSummary = require('./error-summary/index.cjs')
|
|
15
|
+
module.exports.Fieldset = require('./fieldset/index.cjs')
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { use, expect } from 'chai'
|
|
2
|
-
import sinonChai from '@sequencemedia/sinon-chai'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
RadioCog,
|
|
6
|
-
SelectCog,
|
|
7
|
-
TextCog
|
|
8
|
-
} from 'shinkansen-pinion/components/cogs'
|
|
9
|
-
|
|
10
|
-
use(sinonChai)
|
|
11
|
-
|
|
12
|
-
describe('shinkansen-pinion/components/cogs', () => {
|
|
13
|
-
describe('`RadioCog`', () => {
|
|
14
|
-
it('is a function', () => {
|
|
15
|
-
return expect(RadioCog)
|
|
16
|
-
.to.be.a('function')
|
|
17
|
-
})
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
describe('`SelectCog`', () => {
|
|
21
|
-
it('is a function', () => {
|
|
22
|
-
return expect(SelectCog)
|
|
23
|
-
.to.be.a('function')
|
|
24
|
-
})
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
describe('`TextCog`', () => {
|
|
28
|
-
it('is a function', () => {
|
|
29
|
-
return expect(TextCog)
|
|
30
|
-
.to.be.a('function')
|
|
31
|
-
})
|
|
32
|
-
})
|
|
33
|
-
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { use, expect } from 'chai'
|
|
2
|
-
import sinonChai from '@sequencemedia/sinon-chai'
|
|
3
|
-
|
|
4
|
-
import Radio from 'shinkansen-pinion/components/cogs/radio'
|
|
5
|
-
|
|
6
|
-
use(sinonChai)
|
|
7
|
-
|
|
8
|
-
describe('shinkansen-pinion/components/cogs/radio', () => {
|
|
9
|
-
it('is a function', () => {
|
|
10
|
-
return expect(Radio)
|
|
11
|
-
.to.be.a('function')
|
|
12
|
-
})
|
|
13
|
-
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { use, expect } from 'chai'
|
|
2
|
-
import sinonChai from '@sequencemedia/sinon-chai'
|
|
3
|
-
|
|
4
|
-
import Select from 'shinkansen-pinion/components/cogs/select'
|
|
5
|
-
|
|
6
|
-
use(sinonChai)
|
|
7
|
-
|
|
8
|
-
describe('shinkansen-pinion/components/cogs/select', () => {
|
|
9
|
-
it('is a function', () => {
|
|
10
|
-
return expect(Select)
|
|
11
|
-
.to.be.a('function')
|
|
12
|
-
})
|
|
13
|
-
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { use, expect } from 'chai'
|
|
2
|
-
import sinonChai from '@sequencemedia/sinon-chai'
|
|
3
|
-
|
|
4
|
-
import Text from 'shinkansen-pinion/components/cogs/text'
|
|
5
|
-
|
|
6
|
-
use(sinonChai)
|
|
7
|
-
|
|
8
|
-
describe('shinkansen-pinion/components/cogs/text', () => {
|
|
9
|
-
it('is a function', () => {
|
|
10
|
-
return expect(Text)
|
|
11
|
-
.to.be.a('function')
|
|
12
|
-
})
|
|
13
|
-
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { use, expect } from 'chai'
|
|
2
|
-
import sinonChai from '@sequencemedia/sinon-chai'
|
|
3
|
-
|
|
4
|
-
import CheckAnswers from 'shinkansen-pinion/components/sprockets/check-answers'
|
|
5
|
-
|
|
6
|
-
use(sinonChai)
|
|
7
|
-
|
|
8
|
-
describe('shinkansen-pinion/components/sprockets/check-answers', () => {
|
|
9
|
-
it('is a function', () => {
|
|
10
|
-
return expect(CheckAnswers)
|
|
11
|
-
.to.be.a('function')
|
|
12
|
-
})
|
|
13
|
-
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { use, expect } from 'chai'
|
|
2
|
-
import sinonChai from '@sequencemedia/sinon-chai'
|
|
3
|
-
|
|
4
|
-
import ErrorSummary from 'shinkansen-pinion/components/sprockets/error-summary'
|
|
5
|
-
|
|
6
|
-
use(sinonChai)
|
|
7
|
-
|
|
8
|
-
describe('shinkansen-pinion/components/sprockets/error-summary', () => {
|
|
9
|
-
it('is a function', () => {
|
|
10
|
-
return expect(ErrorSummary)
|
|
11
|
-
.to.be.a('function')
|
|
12
|
-
})
|
|
13
|
-
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { use, expect } from 'chai'
|
|
2
|
-
import sinonChai from '@sequencemedia/sinon-chai'
|
|
3
|
-
|
|
4
|
-
import Fieldset from 'shinkansen-pinion/components/sprockets/fieldset'
|
|
5
|
-
|
|
6
|
-
use(sinonChai)
|
|
7
|
-
|
|
8
|
-
describe('shinkansen-pinion/components/sprockets/fieldset', () => {
|
|
9
|
-
it('is a function', () => {
|
|
10
|
-
return expect(Fieldset)
|
|
11
|
-
.to.be.a('function')
|
|
12
|
-
})
|
|
13
|
-
})
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { use, expect } from 'chai'
|
|
2
|
-
import sinonChai from '@sequencemedia/sinon-chai'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
CheckAnswers,
|
|
6
|
-
ErrorSummary,
|
|
7
|
-
Fieldset
|
|
8
|
-
} from 'shinkansen-pinion/components/sprockets'
|
|
9
|
-
|
|
10
|
-
use(sinonChai)
|
|
11
|
-
|
|
12
|
-
describe('shinkansen-pinion/components/sprockets', () => {
|
|
13
|
-
describe('`CheckAnswers`', () => {
|
|
14
|
-
it('is a function', () => {
|
|
15
|
-
return expect(CheckAnswers)
|
|
16
|
-
.to.be.a('function')
|
|
17
|
-
})
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
describe('`ErrorSummary`', () => {
|
|
21
|
-
it('is a function', () => {
|
|
22
|
-
return expect(ErrorSummary)
|
|
23
|
-
.to.be.a('function')
|
|
24
|
-
})
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
describe('`Fieldset`', () => {
|
|
28
|
-
it('is a function', () => {
|
|
29
|
-
return expect(Fieldset)
|
|
30
|
-
.to.be.a('function')
|
|
31
|
-
})
|
|
32
|
-
})
|
|
33
|
-
})
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { use, expect } from 'chai'
|
|
2
|
-
import sinonChai from '@sequencemedia/sinon-chai'
|
|
3
|
-
|
|
4
|
-
import Pinion from 'shinkansen-pinion/pinion'
|
|
5
|
-
|
|
6
|
-
use(sinonChai)
|
|
7
|
-
|
|
8
|
-
describe('shinkansen-pinion/pinion', () => {
|
|
9
|
-
describe('`Pinion`', () => {
|
|
10
|
-
it('is a function', () => {
|
|
11
|
-
return expect(Pinion)
|
|
12
|
-
.to.be.a('function')
|
|
13
|
-
})
|
|
14
|
-
})
|
|
15
|
-
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { use, expect } from 'chai'
|
|
2
|
-
import sinonChai from '@sequencemedia/sinon-chai'
|
|
3
|
-
|
|
4
|
-
import * as checkAnswers from 'shinkansen-pinion/transformers/check-answers'
|
|
5
|
-
|
|
6
|
-
use(sinonChai)
|
|
7
|
-
|
|
8
|
-
describe('shinkansen-pinion/transformers/check-answers', () => {
|
|
9
|
-
it('is a module', () => {
|
|
10
|
-
return expect(checkAnswers)
|
|
11
|
-
.to.be.a('module')
|
|
12
|
-
})
|
|
13
|
-
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { use, expect } from 'chai'
|
|
2
|
-
import sinonChai from '@sequencemedia/sinon-chai'
|
|
3
|
-
|
|
4
|
-
import * as common from 'shinkansen-pinion/transformers/common'
|
|
5
|
-
|
|
6
|
-
use(sinonChai)
|
|
7
|
-
|
|
8
|
-
describe('shinkansen-pinion/transformers/common', () => {
|
|
9
|
-
it('is a module', () => {
|
|
10
|
-
return expect(common)
|
|
11
|
-
.to.be.a('module')
|
|
12
|
-
})
|
|
13
|
-
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { use, expect } from 'chai'
|
|
2
|
-
import sinonChai from '@sequencemedia/sinon-chai'
|
|
3
|
-
|
|
4
|
-
import * as errorMessage from 'shinkansen-pinion/transformers/error-message'
|
|
5
|
-
|
|
6
|
-
use(sinonChai)
|
|
7
|
-
|
|
8
|
-
describe('shinkansen-pinion/transformers/error-message', () => {
|
|
9
|
-
it('is a module', () => {
|
|
10
|
-
return expect(errorMessage)
|
|
11
|
-
.to.be.a('module')
|
|
12
|
-
})
|
|
13
|
-
})
|
package/transform.sh
DELETED
package/tsconfig.json
DELETED
package/webpack.config.mjs
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
join
|
|
3
|
-
} from 'node:path'
|
|
4
|
-
|
|
5
|
-
import Webpack from 'webpack'
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
CleanWebpackPlugin as CleanPlugin
|
|
9
|
-
} from 'clean-webpack-plugin'
|
|
10
|
-
import MiniCssExtractPlugin from 'mini-css-extract-plugin'
|
|
11
|
-
import RemoveFilesPlugin from 'remove-files-webpack-plugin'
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
storybookPath as STORYBOOK_PATH,
|
|
15
|
-
modulePath as MODULE_PATH
|
|
16
|
-
} from '#build/paths'
|
|
17
|
-
|
|
18
|
-
const {
|
|
19
|
-
EnvironmentPlugin,
|
|
20
|
-
SourceMapDevToolPlugin
|
|
21
|
-
} = Webpack
|
|
22
|
-
|
|
23
|
-
export default {
|
|
24
|
-
mode: 'production',
|
|
25
|
-
entry: {
|
|
26
|
-
'preview-head': join(STORYBOOK_PATH, 'sass/preview-head.scss')
|
|
27
|
-
},
|
|
28
|
-
output: {
|
|
29
|
-
path: join(STORYBOOK_PATH, 'css')
|
|
30
|
-
},
|
|
31
|
-
stats: {
|
|
32
|
-
colors: true
|
|
33
|
-
},
|
|
34
|
-
module: {
|
|
35
|
-
rules: [
|
|
36
|
-
{
|
|
37
|
-
test: /\.scss$/i,
|
|
38
|
-
use: [
|
|
39
|
-
MiniCssExtractPlugin.loader,
|
|
40
|
-
{
|
|
41
|
-
loader: 'css-loader',
|
|
42
|
-
options: {
|
|
43
|
-
importLoaders: 1,
|
|
44
|
-
sourceMap: false,
|
|
45
|
-
url: false
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
loader: 'postcss-loader',
|
|
50
|
-
options: {
|
|
51
|
-
sourceMap: false,
|
|
52
|
-
postcssOptions: {
|
|
53
|
-
config: false,
|
|
54
|
-
plugins: [
|
|
55
|
-
'postcss-import',
|
|
56
|
-
'postcss-discard-comments',
|
|
57
|
-
'postcss-discard-empty',
|
|
58
|
-
[
|
|
59
|
-
'postcss-map', {
|
|
60
|
-
maps: [
|
|
61
|
-
join(MODULE_PATH, '@modernpoacher/design-system/src/tokens/palette.json')
|
|
62
|
-
]
|
|
63
|
-
}
|
|
64
|
-
],
|
|
65
|
-
[
|
|
66
|
-
'autoprefixer', {
|
|
67
|
-
remove: false
|
|
68
|
-
}
|
|
69
|
-
],
|
|
70
|
-
[
|
|
71
|
-
'perfectionist', {
|
|
72
|
-
trimLeadingZero: false,
|
|
73
|
-
sourcemap: true,
|
|
74
|
-
indentSize: 2,
|
|
75
|
-
format: 'expanded',
|
|
76
|
-
syntax: 'scss'
|
|
77
|
-
}
|
|
78
|
-
]
|
|
79
|
-
]
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
loader: 'sass-loader',
|
|
85
|
-
options: {
|
|
86
|
-
sourceMap: false,
|
|
87
|
-
sassOptions: {
|
|
88
|
-
loadPaths: [
|
|
89
|
-
join(MODULE_PATH, '@modernpoacher/design-system/src/sass')
|
|
90
|
-
]
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
]
|
|
95
|
-
}
|
|
96
|
-
]
|
|
97
|
-
},
|
|
98
|
-
plugins: [
|
|
99
|
-
new CleanPlugin({
|
|
100
|
-
verbose: false,
|
|
101
|
-
cleanOnceBeforeBuildPatterns: [
|
|
102
|
-
join(STORYBOOK_PATH, 'css/*.css'),
|
|
103
|
-
join(STORYBOOK_PATH, 'css/*.css.map')
|
|
104
|
-
]
|
|
105
|
-
}),
|
|
106
|
-
new EnvironmentPlugin({
|
|
107
|
-
NODE_ENV: 'production'
|
|
108
|
-
}),
|
|
109
|
-
new SourceMapDevToolPlugin({
|
|
110
|
-
test: /\.css$/i,
|
|
111
|
-
filename: '[name].css.map'
|
|
112
|
-
}),
|
|
113
|
-
new MiniCssExtractPlugin({
|
|
114
|
-
filename: '[name].css'
|
|
115
|
-
}),
|
|
116
|
-
new RemoveFilesPlugin({
|
|
117
|
-
after: {
|
|
118
|
-
test: [
|
|
119
|
-
{
|
|
120
|
-
folder: join(STORYBOOK_PATH, 'css'),
|
|
121
|
-
method (filePath) {
|
|
122
|
-
return /\.js$/m.test(filePath)
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
]
|
|
126
|
-
}
|
|
127
|
-
})
|
|
128
|
-
]
|
|
129
|
-
}
|