shinkansen-sprockets 1.1.422 → 1.1.424

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shinkansen-sprockets",
3
- "version": "1.1.422",
3
+ "version": "1.1.424",
4
4
  "description": "Shinkansen Sprockets",
5
5
  "keywords": [
6
6
  "Shinkansen",
@@ -27,23 +27,20 @@
27
27
  "url": "git@github.com/modernpoacher/shinkansen-sprockets.git"
28
28
  },
29
29
  "scripts": {
30
- "build": "cross-env DEBUG=shinkansen-sprockets npm run gulp -- build",
30
+ "build": "cross-env DEBUG=shinkansen-sprockets webpack",
31
31
  "build-storybook": "storybook build",
32
- "build:watch": "cross-env DEBUG=shinkansen-sprockets npm run gulp -- build:watch",
33
- "gulp": "gulp --color",
32
+ "build:watch": "cross-env DEBUG=shinkansen-sprockets webpack --watch",
34
33
  "lint": "eslint . .storybook --ext .mjs,.cjs,.jsx,.mts,.cts",
35
34
  "lint:fix": "npm run lint -- --fix",
36
35
  "nvm": "bash nvm.sh",
37
- "pregulp": "npm run nvm",
38
36
  "prelint": "npm run nvm",
39
37
  "prepare": "husky",
40
38
  "prepublishOnly": "cross-env NODE_ENV=production npm run build",
41
39
  "prestorybook": "npm run build && npm run transform",
42
40
  "pretest": "npm run nvm",
43
41
  "storybook": "storybook dev -p 6007",
44
- "test": "cross-env NODE_ENV=test jest --collect-coverage false --run-in-band",
45
- "transform": "cross-env DEBUG=shinkansen-sprockets npm run gulp -- transform",
46
- "transform:watch": "cross-env DEBUG=shinkansen-sprockets npm run gulp -- transform:watch"
42
+ "test": "cross-env NODE_ENV=test jest",
43
+ "transform": "cross-env DEBUG=shinkansen-sprockets ./transform.sh"
47
44
  },
48
45
  "dependencies": {
49
46
  "classnames": "^2.5.1",
@@ -57,13 +54,6 @@
57
54
  "@babel/preset-react": "^7.25.9",
58
55
  "@babel/register": "^7.25.9",
59
56
  "@modernpoacher/design-system": "1.1.15",
60
- "@sequencemedia/gulp": "^1.1.275",
61
- "@sequencemedia/gulp-clean-css": "^1.0.182",
62
- "@sequencemedia/gulp-css-purge": "^1.1.202",
63
- "@sequencemedia/gulp-debug": "^1.0.193",
64
- "@sequencemedia/gulp-postcss": "^1.0.205",
65
- "@sequencemedia/gulp-sass": "^1.0.188",
66
- "@sequencemedia/gulp-sourcemaps": "^1.0.196",
67
57
  "@storybook/addon-actions": "7.6.20",
68
58
  "@storybook/addon-essentials": "7.6.20",
69
59
  "@storybook/addon-links": "7.6.20",
@@ -74,39 +64,38 @@
74
64
  "@typescript-eslint/parser": "7.18.0",
75
65
  "autoprefixer": "^10.4.20",
76
66
  "babel-plugin-module-resolver": "^5.0.2",
67
+ "clean-webpack-plugin": "^4.0.0",
77
68
  "core-js": "^3.39.0",
78
69
  "cross-env": "^7.0.3",
79
- "cssnano": "^7.0.6",
80
- "del": "^8.0.0",
81
70
  "eslint": "8.57.1",
82
71
  "eslint-config-love": "47.0.0",
83
72
  "eslint-config-standard": "^17.1.0",
84
73
  "eslint-import-resolver-babel-module": "^5.3.2",
85
74
  "eslint-plugin-react": "^7.37.2",
86
- "glob-all": "^3.3.1",
87
75
  "husky": "^9.1.7",
88
76
  "jest": "^29.7.0",
77
+ "mini-css-extract-plugin": "^2.9.2",
78
+ "perfectionist": "^2.4.0",
89
79
  "postcss": "^8.4.49",
90
- "postcss-easy-import": "^4.0.0",
80
+ "postcss-discard-comments": "^7.0.3",
81
+ "postcss-discard-empty": "^7.0.0",
82
+ "postcss-import": "^16.1.0",
83
+ "postcss-loader": "^8.1.1",
91
84
  "postcss-map": "^0.11.0",
92
- "postcss-normalize": "^13.0.1",
93
- "postcss-scss": "^4.0.9",
94
85
  "prop-types": "^15.8.1",
95
86
  "react": "^18.3.1",
96
87
  "react-dom": "^18.3.1",
97
88
  "react-router": "^7.0.1",
98
89
  "react-router-dom": "^7.0.1",
99
90
  "react-test-renderer": "^18.3.1",
100
- "regenerator-runtime": "^0.14.1",
91
+ "remove-files-webpack-plugin": "^1.5.0",
101
92
  "sass": "^1.81.0",
93
+ "sass-loader": "^16.0.3",
102
94
  "storybook": "7.6.20",
103
- "vinyl-paths": "^5.0.0"
95
+ "webpack": "^5.96.1",
96
+ "webpack-cli": "^5.1.4"
104
97
  },
105
98
  "imports": {
106
- "#build/gulp/*": "./build/gulp/*.mjs",
107
- "#build/gulp/build": "./build/gulp/build/index.mjs",
108
- "#build/gulp/build/*": "./build/gulp/build/*.mjs",
109
- "#build/gulp/transform": "./build/gulp/transform/index.mjs",
110
99
  "#build/paths": "./build/paths.mjs"
111
100
  },
112
101
  "exports": {
package/transform.sh ADDED
@@ -0,0 +1,4 @@
1
+ #!/bin/bash
2
+
3
+ DEBUG=@modernpoacher/sprockets*
4
+ node -e 'import("./build/transform.mjs").then(({ default: transform }) => transform())'
@@ -0,0 +1,129 @@
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
+ }