Skip to content

Commit a154690

Browse files
authored
Merge pull request #24 from idesigncode/updates
Updates: dependency updates
2 parents d95874b + 98dd7cb commit a154690

File tree

9 files changed

+37
-51
lines changed

9 files changed

+37
-51
lines changed

.npm-init.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function requiredPrompt(message) {
3838

3939
// Use scope option (if given)
4040
const [scopeArg = ''] = process.argv.filter((arg) =>
41-
arg.startsWith('--scope=')
41+
arg.startsWith('--scope='),
4242
);
4343
const scope = scopeArg.replace('--scope=', '');
4444
// Use basename global as name
@@ -56,7 +56,7 @@ module.exports = {
5656
'GitHub repository keywords',
5757
'',
5858
// Split keywordString on spaces or commas
59-
(keywordString) => keywordString.split(/[\s,]+/g)
59+
(keywordString) => keywordString.split(/[\s,]+/g),
6060
),
6161
license: optionalPrompt('License', package?.license),
6262
author: optionalPrompt('Author', package?.author?.name),

.npm-postprepare.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function sortObjectByKey(object, order) {
4949
}
5050
return order.indexOf(accumulator) - order.indexOf(key);
5151
}
52-
: undefined
52+
: undefined,
5353
)
5454
.reduce((accumulator, key) => {
5555
return { ...accumulator, [key]: object[key] };
@@ -135,7 +135,7 @@ function logFileUpdate(filename) {
135135
const readmeUpdated = updateReadme(
136136
pkgUpdated.description,
137137
pkgUpdated.name,
138-
readme
138+
readme,
139139
);
140140
if (readmeUpdated !== readme) {
141141
await fsPromises.writeFile(README_PATH, readmeUpdated);

.storybook/main.mjs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import packageJson from '../package.json';
2-
import { webpackFinal } from '@idesigncode/storybook-tools/storybookConfig.mjs';
2+
import webpackFinal from '@idesigncode/storybook-tools/webpackFinal.cjs';
33

44
export default {
55
addons: [
@@ -32,17 +32,5 @@ export default {
3232
options: {},
3333
},
3434
stories: ['../**/*.mdx', '../**/*.stories.*'],
35-
storyIndexers: (indexers) => {
36-
// Extend js story indexer for mjs
37-
return indexers.map((indexer) => {
38-
if (`${indexer.test}`.includes(`[tj]sx?$`)) {
39-
return {
40-
...indexer,
41-
test: /(stories|story)\.m?[tj]sx?$/,
42-
};
43-
}
44-
return indexer;
45-
});
46-
},
4735
webpackFinal,
4836
};

__snapshots__/samplecomponent.test.js.snap

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,18 +122,13 @@ exports[`SampleComponent Example test 1`] = `
122122
<span class="token punctuation">
123123
)
124124
</span>
125-
<span class="token punctuation">
126-
;
127-
</span>
128125
<span class>
129126
</span>
130127
<span class>
131128
</span>
132129
<span class="token punctuation">
133130
}
134131
</span>
135-
<span class>
136-
</span>
137132
</code>
138133
</pre>
139134
<button>
@@ -463,8 +458,6 @@ exports[`SampleComponent Implementation test 1`] = `
463458
<span class="token punctuation">
464459
;
465460
</span>
466-
<span class>
467-
</span>
468461
</code>
469462
</pre>
470463
<button>

__snapshots__/samplefunction.test.js.snap

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ exports[`sampleFunction Implementation test 1`] = `
1515
(
1616
</span>
1717
<span class="token string">
18-
'This is the argument given to sampleFunction'
18+
"This is the argument given to sampleFunction"
1919
</span>
2020
<span class="token punctuation">
2121
)
2222
</span>
23+
<span class="token punctuation">
24+
;
25+
</span>
2326
</code>
2427
</pre>
2528
<button>

package.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -71,34 +71,34 @@
7171
"react-dom": "^18.2.0"
7272
},
7373
"devDependencies": {
74-
"@babel/cli": "^7.22.5",
75-
"@babel/core": "^7.22.5",
76-
"@babel/preset-env": "^7.22.5",
74+
"@babel/cli": "^7.22.9",
75+
"@babel/core": "^7.22.9",
76+
"@babel/preset-env": "^7.22.9",
7777
"@babel/preset-react": "^7.22.5",
78-
"@idesigncode/storybook-tools": "^2.1.3",
79-
"@storybook/addon-coverage": "^0.0.8",
80-
"@storybook/addon-docs": "^7.0.20",
81-
"@storybook/addon-interactions": "^7.0.20",
82-
"@storybook/addons": "^7.0.20",
78+
"@idesigncode/storybook-tools": "^3.0.1",
79+
"@storybook/addon-coverage": "^0.0.9",
80+
"@storybook/addon-docs": "^7.1.1",
81+
"@storybook/addon-interactions": "^7.1.1",
82+
"@storybook/addons": "^7.1.1",
8383
"@storybook/jest": "^0.1.0",
84-
"@storybook/react": "^7.0.20",
85-
"@storybook/react-webpack5": "^7.0.20",
86-
"@storybook/test-runner": "^0.10.0",
87-
"@storybook/testing-library": "^0.1.0",
84+
"@storybook/react": "^7.1.1",
85+
"@storybook/react-webpack5": "^7.1.1",
86+
"@storybook/test-runner": "^0.12.0",
87+
"@storybook/testing-library": "^0.2.0",
8888
"autoprefixer": "^10.4.14",
8989
"babel-plugin-inline-react-svg": "^2.0.2",
9090
"cssnano": "^6.0.1",
91-
"eslint": "^8.42.0",
92-
"eslint-plugin-react": "^7.32.2",
91+
"eslint": "^8.46.0",
92+
"eslint-plugin-react": "^7.33.1",
9393
"eslint-plugin-simple-import-sort": "^10.0.0",
9494
"husky": "^8.0.3",
95-
"jest-image-snapshot": "^6.1.0",
96-
"lint-staged": "^13.2.2",
97-
"postcss": "^8.4.24",
95+
"jest-image-snapshot": "^6.2.0",
96+
"lint-staged": "^13.2.3",
97+
"postcss": "^8.4.27",
9898
"postcss-cli": "^10.1.0",
99-
"prettier": "^2.8.8",
100-
"sass": "^1.63.3",
101-
"storybook": "^7.0.20",
102-
"storybook-dark-mode": "^3.0.0"
99+
"prettier": "^3.0.0",
100+
"sass": "^1.64.1",
101+
"storybook": "^7.1.1",
102+
"storybook-dark-mode": "^3.0.1"
103103
}
104104
}

stories/SampleComponent.stories.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import React from 'react';
12
import Source from '@idesigncode/storybook-tools/Source.mjs';
23
import { expect, userEvent, within } from '../test/test-utils.mjs';
34
import SampleComponentExample from './SampleComponent.example.mjs';
@@ -24,5 +25,5 @@ export const Implementation = {
2425
args: {
2526
code: SampleComponentExampleRaw,
2627
},
27-
render: Source,
28+
render: (args) => <Source {...args} />,
2829
};

stories/sampleFunction.stories.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import React from 'react';
12
import Source from '@idesigncode/storybook-tools/Source.mjs';
23
import sampleFunction from '../src/sampleFunction.mjs';
34
import { expect } from '../test/test-utils.mjs';
@@ -23,5 +24,5 @@ export const Implementation = {
2324
args: {
2425
code: `sampleFunction('${Example.args.arg}')`,
2526
},
26-
render: Source,
27+
render: (args) => <Source {...args} />,
2728
};

test/snapshotResolver.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ module.exports = {
66
path.join(
77
process.cwd(),
88
'__snapshots__',
9-
`${path.basename(testPath)}${snapshotExtension}`
9+
`${path.basename(testPath)}${snapshotExtension}`,
1010
),
1111
resolveTestPath: (snapshotFilePath, snapshotExtension) =>
1212
path.join(
1313
process.env.TEST_ROOT,
14-
path.basename(snapshotFilePath, snapshotExtension)
14+
path.basename(snapshotFilePath, snapshotExtension),
1515
),
1616
testPathForConsistencyCheck: path.join(
1717
process.env.TEST_ROOT,
18-
'example.test.js'
18+
'example.test.js',
1919
),
2020
};

0 commit comments

Comments
 (0)