Skip to content

Commit a4fd9c9

Browse files
authored
Merge pull request #165 from aeagle/feature/node-20x
Build update + unit test fix
2 parents f534c27 + 2b7a993 commit a4fd9c9

File tree

101 files changed

+28962
-25348
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+28962
-25348
lines changed

.npmrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
registry=https://registry.npmjs.org/
1+
registry=https://registry.npmjs.org/
2+
legacy-peer-deps=true

.storybook/main.js

+22-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
const path = require("path");
22

33
module.exports = {
4-
stories: ["../src/**/*.stories.@(mdx|tsx)"],
4+
stories: ["../src/**/*.@(mdx|stories.@(tsx))"],
5+
56
addons: [
67
"@storybook/addon-actions",
78
"@storybook/addon-links",
89
{
910
name: "@storybook/addon-docs",
1011
options: {
1112
configureJSX: true,
12-
inlineStories: false,
13+
inlineStories: true,
1314
},
1415
},
16+
"@storybook/addon-mdx-gfm",
17+
"@storybook/addon-webpack5-compiler-babel",
18+
"@chromatic-com/storybook",
1519
],
20+
1621
webpackFinal: async (config, { configType }) => {
1722
if (process.env.NODE === "production") {
1823
config.output.publicPath = "/react-spaces/docs";
@@ -26,7 +31,20 @@ module.exports = {
2631

2732
return config;
2833
},
29-
reactOptions: {
30-
strictMode: true,
34+
35+
framework: {
36+
name: "@storybook/react-webpack5",
37+
38+
options: {
39+
strictMode: true,
40+
},
41+
},
42+
43+
docs: {
44+
autodocs: true,
45+
story: {
46+
inline: true,
47+
height: "500px",
48+
},
3149
},
3250
};

.storybook/preview.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
import { addParameters } from "@storybook/react";
2-
3-
addParameters({
4-
docs: {
5-
inlineStories: false,
1+
module.exports = {
2+
parameters: {
3+
actions: { argTypesRegex: "^on.*" },
4+
docs: {
5+
story: {
6+
inline: true, // Render stories in an iframe
7+
},
8+
},
69
},
7-
});
10+
};

azure-pipelines.yml

+89-59
Original file line numberDiff line numberDiff line change
@@ -4,64 +4,94 @@
44
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
55

66
pool:
7-
vmImage: "ubuntu-latest"
7+
vmImage: "ubuntu-latest"
88

99
steps:
10-
- task: gitversion/setup@0
11-
inputs:
12-
versionSpec: '5.x'
13-
14-
- task: gitversion/execute@0
15-
16-
- script: echo "##vso[build.updatebuildnumber]$(GitVersion.MajorMinorPatch)"
17-
18-
- task: Bash@3
19-
displayName: Update version number in react-spaces package.json
20-
inputs:
21-
targetType: 'inline'
22-
script: sed -i "s/0.2.2/$GITVERSIONNUMBER/g" package.json
23-
env:
24-
GITVERSIONNUMBER: $(GitVersion.MajorMinorPatch)
25-
26-
- task: Bash@3
27-
displayName: Update version number in react-spaces-storybook package.json
28-
inputs:
29-
targetType: 'inline'
30-
script: sed -i "s/0.2.2/$GITVERSIONNUMBER/g" .storybook/package.json
31-
env:
32-
GITVERSIONNUMBER: $(GitVersion.MajorMinorPatch)
33-
34-
- task: NodeTool@0
35-
inputs:
36-
versionSpec: '12.x'
37-
checkLatest: true
38-
displayName: 'Install Node.js'
39-
40-
- script: |
41-
npm install
42-
npm run build
43-
npm run build-storybook
44-
displayName: 'NPM install and build'
45-
46-
- task: CopyFiles@2
47-
displayName: Move storybook package json
48-
inputs:
49-
SourceFolder: '.storybook'
50-
Contents: 'package.json'
51-
TargetFolder: './storybook-static'
52-
OverWrite: true
53-
54-
- task: Npm@1
55-
enabled: true
56-
displayName: Publish react-spaces-storybook
57-
inputs:
58-
command: 'publish'
59-
workingDir: 'storybook-static'
60-
publishEndpoint: 'NPM'
61-
62-
- task: Npm@1
63-
enabled: true
64-
displayName: Publish react-spaces
65-
inputs:
66-
command: 'publish'
67-
publishEndpoint: 'NPM'
10+
- task: gitversion/setup@0
11+
inputs:
12+
versionSpec: "5.x"
13+
14+
- task: gitversion/execute@0
15+
16+
- script: echo "##vso[build.updatebuildnumber]$(GitVersion.SemVer)"
17+
18+
- task: Bash@3
19+
displayName: Update version number in react-spaces package.json
20+
inputs:
21+
targetType: "inline"
22+
script: sed -i "s/0.2.2/$GITVERSIONNUMBER/g" package.json
23+
env:
24+
GITVERSIONNUMBER: $(GitVersion.SemVer)
25+
26+
- task: Bash@3
27+
displayName: Update version number in react-spaces-storybook package.json
28+
inputs:
29+
targetType: "inline"
30+
script: sed -i "s/0.2.2/$GITVERSIONNUMBER/g" .storybook/package.json
31+
env:
32+
GITVERSIONNUMBER: $(GitVersion.SemVer)
33+
34+
- task: NodeTool@0
35+
inputs:
36+
versionSpec: "20.x"
37+
checkLatest: true
38+
displayName: "Install Node.js"
39+
40+
- task: Cache@2
41+
displayName: Cache node_modules
42+
inputs:
43+
key: 'npm | "$(Agent.OS)" | $(Build.SourcesDirectory)/package-lock.json'
44+
path: $(Build.SourcesDirectory)/node_modules
45+
cacheHitVar: CACHE_RESTORED
46+
47+
- task: Npm@1
48+
displayName: "Install the dependencies"
49+
inputs:
50+
command: custom
51+
verbose: false
52+
customCommand: "ci"
53+
condition: ne(variables.CACHE_RESTORED, 'true')
54+
55+
- script: |
56+
npm test
57+
displayName: "Run tests"
58+
59+
- script: |
60+
npm run build
61+
displayName: "Build package"
62+
63+
- script: |
64+
npm run build-storybook
65+
displayName: "Build storybook"
66+
67+
- task: CopyFiles@2
68+
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
69+
displayName: Move storybook package json
70+
inputs:
71+
SourceFolder: ".storybook"
72+
Contents: "package.json"
73+
TargetFolder: "./storybook-static"
74+
OverWrite: true
75+
76+
- task: Npm@1
77+
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
78+
displayName: Publish react-spaces-storybook
79+
inputs:
80+
command: "publish"
81+
workingDir: "storybook-static"
82+
publishEndpoint: "NPM"
83+
84+
- task: Npm@1
85+
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
86+
displayName: Publish react-spaces
87+
inputs:
88+
command: "publish"
89+
publishEndpoint: "NPM"
90+
91+
- task: Npm@1
92+
condition: ne(variables['Build.SourceBranch'], 'refs/heads/master')
93+
displayName: Publish react-spaces (BETA)
94+
inputs:
95+
command: "custom"
96+
customCommand: "run publish:beta"
97+
customEndpoint: "NPM"

0 commit comments

Comments
 (0)