shinkansen-cogs 1.7.280 → 1.7.282

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.
@@ -0,0 +1,189 @@
1
+ import globals from 'globals'
2
+ import standard from '@sequencemedia/eslint-config-standard/configs/recommended/merge'
3
+ import typescript from '@sequencemedia/eslint-config-typescript/configs/recommended/merge'
4
+ import babelParser from '@babel/eslint-parser'
5
+ import typescriptParser from '@typescript-eslint/parser'
6
+ import reactPlugin from 'eslint-plugin-react'
7
+ import storybookPlugin from 'eslint-plugin-storybook'
8
+
9
+ const reactParserOptions = {
10
+ ecmaFeatures: {
11
+ jsx: true
12
+ }
13
+ }
14
+
15
+ const reactPlugins = {
16
+ react: reactPlugin
17
+ }
18
+
19
+ const storybookPlugins = {
20
+ storybook: storybookPlugin
21
+ }
22
+
23
+ const reactRules = {
24
+ 'no-unused-vars': [
25
+ 'error',
26
+ {
27
+ varsIgnorePattern: 'React'
28
+ }
29
+ ],
30
+ quotes: [
31
+ 'error',
32
+ 'single'
33
+ ],
34
+ 'jsx-quotes': [
35
+ 'error',
36
+ 'prefer-single'
37
+ ],
38
+ 'react/jsx-indent': [
39
+ 'error',
40
+ 2,
41
+ {
42
+ checkAttributes: true,
43
+ indentLogicalExpressions: true
44
+ }
45
+ ]
46
+ }
47
+
48
+ const reactSettings = {
49
+ react: {
50
+ version: 'detect'
51
+ }
52
+ }
53
+
54
+ export default [
55
+ {
56
+ ignores: [
57
+ 'coverage'
58
+ ]
59
+ },
60
+ /**
61
+ * React config for all `jsx` and `tsx` files
62
+ */
63
+ {
64
+ ...reactPlugin.configs.flat.recommended,
65
+ settings: {
66
+ ...reactPlugin.configs.flat.recommended.settings,
67
+ ...reactSettings
68
+ }
69
+ },
70
+ /**
71
+ * Storybook config
72
+ */
73
+ ...storybookPlugin.configs['flat/recommended'],
74
+ /**
75
+ * Standard config
76
+ */
77
+ standard({
78
+ files: [
79
+ '**/*.{mjs,cjs,mts,cts}'
80
+ ],
81
+ ignores: [
82
+ 'src',
83
+ 'stories'
84
+ ],
85
+ languageOptions: {
86
+ globals: {
87
+ ...globals.node
88
+ }
89
+ }
90
+ }),
91
+ standard({
92
+ files: [
93
+ 'src/**/*.{mjs,cjs,mts,cts}',
94
+ 'stories/**/*.{mjs,cjs,mts,cts}'
95
+ ],
96
+ languageOptions: {
97
+ globals: {
98
+ ...globals.browser
99
+ }
100
+ }
101
+ }),
102
+ /**
103
+ * Standard config for all `jsx` and `tsx` files
104
+ */
105
+ standard({
106
+ files: [
107
+ 'src/**/*.tsx',
108
+ 'stories/**/*.jsx'
109
+ ],
110
+ languageOptions: {
111
+ parser: babelParser,
112
+ parserOptions: {
113
+ ...reactParserOptions,
114
+ project: null
115
+ },
116
+ globals: {
117
+ ...globals.browser
118
+ }
119
+ },
120
+ plugins: {
121
+ ...reactPlugins,
122
+ ...storybookPlugins
123
+ },
124
+ rules: {
125
+ ...reactRules
126
+ },
127
+ settings: {
128
+ ...reactSettings,
129
+ 'import/resolver': {
130
+ 'babel-module': {}
131
+ }
132
+ }
133
+ }),
134
+ /**
135
+ * TypeScript config
136
+ */
137
+ typescript({
138
+ files: [
139
+ '**/*.{mts,cts}'
140
+ ],
141
+ ignores: [
142
+ 'src'
143
+ ],
144
+ languageOptions: {
145
+ globals: {
146
+ ...globals.node,
147
+ CogsTypes: 'readonly'
148
+ }
149
+ }
150
+ }),
151
+ typescript({
152
+ files: [
153
+ 'src/**/*.{mts,cts}'
154
+ ],
155
+ languageOptions: {
156
+ globals: {
157
+ ...globals.browser
158
+ }
159
+ }
160
+ }),
161
+ /**
162
+ * TypeScript config for only `tsx` files
163
+ */
164
+ typescript({
165
+ files: [
166
+ 'src/**/*.tsx'
167
+ ],
168
+ languageOptions: {
169
+ parser: typescriptParser,
170
+ parserOptions: {
171
+ ...reactParserOptions,
172
+ projectService: true,
173
+ project: 'tsconfig.json'
174
+ },
175
+ globals: {
176
+ ...globals.browser
177
+ }
178
+ },
179
+ plugins: {
180
+ ...reactPlugins
181
+ },
182
+ rules: {
183
+ ...reactRules
184
+ },
185
+ settings: {
186
+ ...reactSettings
187
+ }
188
+ })
189
+ ]
package/index.d.mts ADDED
@@ -0,0 +1,20 @@
1
+ declare global {
2
+ namespace CogsTypes {
3
+ export type OnChangeType = () => void
4
+
5
+ export interface ErrorDefinitionType {
6
+ type: string
7
+ uri: string
8
+ params: {
9
+ expectedType: string
10
+ }
11
+ }
12
+
13
+ export interface FieldErrorType {
14
+ text: string
15
+ href: string
16
+ }
17
+ }
18
+ }
19
+
20
+ export {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shinkansen-cogs",
3
- "version": "1.7.280",
3
+ "version": "1.7.282",
4
4
  "description": "Shinkansen Cogs",
5
5
  "keywords": [
6
6
  "Shinkansen",
@@ -12,7 +12,7 @@
12
12
  ],
13
13
  "main": "./src/index.cjs",
14
14
  "type": "module",
15
- "types": "./src/index.d.mts",
15
+ "types": "./index.d.mts",
16
16
  "author": {
17
17
  "name": "Jonathan Perry for Modern Poacher Limited",
18
18
  "email": "modernpoacher@modernpoacher.com",
@@ -30,7 +30,7 @@
30
30
  "build": "cross-env DEBUG=shinkansen-cogs* webpack",
31
31
  "build-storybook": "storybook build",
32
32
  "build:watch": "cross-env DEBUG=shinkansen-cogs* webpack --watch",
33
- "lint": "eslint . .storybook --ext .mjs,.cjs,.jsx,.mts,.cts",
33
+ "lint": "eslint",
34
34
  "lint:fix": "npm run lint -- --fix",
35
35
  "nvm": "bash nvm.sh",
36
36
  "prelint": "npm run nvm",
@@ -53,23 +53,26 @@
53
53
  "@babel/preset-env": "^7.26.0",
54
54
  "@babel/preset-react": "^7.26.3",
55
55
  "@babel/register": "^7.25.9",
56
- "@modernpoacher/design-system": "1.1.20",
56
+ "@modernpoacher/design-system": "1.1.21",
57
+ "@sequencemedia/eslint-config-standard": "^0.2.10",
58
+ "@sequencemedia/eslint-config-typescript": "^0.1.15",
57
59
  "@storybook/addon-actions": "7.6.20",
58
60
  "@storybook/addon-essentials": "7.6.20",
59
61
  "@storybook/addon-links": "7.6.20",
60
62
  "@storybook/react": "7.6.20",
61
63
  "@storybook/react-webpack5": "7.6.20",
62
- "@types/react": "^18.3.13",
63
- "@typescript-eslint/eslint-plugin": "7.18.0",
64
- "@typescript-eslint/parser": "7.18.0",
64
+ "@types/react": "18.3.13",
65
+ "@typescript-eslint/eslint-plugin": "^8.19.1",
66
+ "@typescript-eslint/parser": "^8.19.1",
65
67
  "autoprefixer": "^10.4.20",
66
68
  "clean-webpack-plugin": "^4.0.0",
67
- "core-js": "^3.39.0",
69
+ "core-js": "^3.40.0",
68
70
  "cross-env": "^7.0.3",
69
- "eslint": "8.57.1",
70
- "eslint-config-love": "47.0.0",
71
- "eslint-config-standard": "^17.1.0",
72
- "eslint-plugin-react": "^7.37.2",
71
+ "eslint": "^9.17.0",
72
+ "eslint-import-resolver-babel-module": "^5.3.2",
73
+ "eslint-plugin-react": "^7.37.3",
74
+ "eslint-plugin-storybook": "^0.11.2",
75
+ "globals": "^15.14.0",
73
76
  "husky": "^9.1.7",
74
77
  "jest": "^29.7.0",
75
78
  "mini-css-extract-plugin": "^2.9.2",
@@ -81,15 +84,15 @@
81
84
  "postcss-loader": "^8.1.1",
82
85
  "postcss-map": "^0.11.0",
83
86
  "prop-types": "^15.8.1",
84
- "react": "^18.3.1",
85
- "react-dom": "^18.3.1",
86
- "react-test-renderer": "^18.3.1",
87
+ "react": "18.3.1",
88
+ "react-dom": "18.3.1",
89
+ "react-test-renderer": "18.3.1",
87
90
  "remove-files-webpack-plugin": "^1.5.0",
88
- "sass": "^1.82.0",
91
+ "sass": "^1.83.1",
89
92
  "sass-loader": "^16.0.4",
90
93
  "storybook": "7.6.20",
91
- "webpack": "^5.97.0",
92
- "webpack-cli": "^5.1.4"
94
+ "webpack": "^5.97.1",
95
+ "webpack-cli": "^6.0.1"
93
96
  },
94
97
  "imports": {
95
98
  "#build/paths": "./build/paths.mjs",
package/src/index.d.mts CHANGED
@@ -1,20 +1,3 @@
1
- declare namespace CogsTypes {
2
- export type OnChangeType = () => void
3
-
4
- export interface ErrorDefinitionType {
5
- type: string
6
- uri: string
7
- params: {
8
- expectedType: string
9
- }
10
- }
11
-
12
- export interface FieldErrorType {
13
- text: string
14
- href: string
15
- }
16
- }
17
-
18
1
  declare module '#cogs' {
19
2
  export { default as CheckboxCog } from '#cogs/cogs/checkbox'
20
3
  export { default as EmailCog } from '#cogs/cogs/email'