Skip to content

Commit

Permalink
fix: use old hds correctly with old documentation, removed webpack sp…
Browse files Browse the repository at this point in the history
…lit optimization
  • Loading branch information
timwessman committed Nov 21, 2024
1 parent 8c448e8 commit 2408e7c
Show file tree
Hide file tree
Showing 4 changed files with 204 additions and 12 deletions.
26 changes: 25 additions & 1 deletion site/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,45 @@
const webpack = require('webpack');
const path = require('path');

exports.onCreateWebpackConfig = ({ actions }) => {
exports.onCreateWebpackConfig = ({ actions, getConfig }) => {
const config = getConfig();

config.plugins.push(
new webpack.NormalModuleReplacementPlugin(
/hds-core|hds-react/,
resource => {
if (resource.context.includes('.cache/gatsby-source-git/docs-release-2.17.1/site')) {
resource.request = resource.request.replace('hds-core', 'hds-2-core');
resource.request = resource.request.replace('hds-react', 'hds-2-react');
}
if (resource.context.includes('.cache/gatsby-source-git/docs-release-3.11.0/site')) {
resource.request = resource.request.replace('hds-core', 'hds-3-core');
resource.request = resource.request.replace('hds-react', 'hds-3-react');
}
}
)
);

actions.setWebpackConfig({
plugins: [
// We need to provide a polyfill for react-live library to make it work with the latest Gatsby: https://webpack.js.org/blog/2020-10-10-webpack-5-release/#automatic-nodejs-polyfills-removed
new webpack.ProvidePlugin({
process: 'process/browser',
}),
...config.plugins,
],
resolve: {
alias: {
fs$: path.resolve(__dirname, 'src/fs.js'),
'~hds-core': 'hds-2-core',
'hds-react': 'hds-react/lib',
stream: false,
},
fallback: {
crypto: require.resolve('crypto-browserify'),
},
},
/*
optimization: {
splitChunks: {
chunks: 'initial',
Expand All @@ -31,6 +52,7 @@ exports.onCreateWebpackConfig = ({ actions }) => {
},
},
},
*/
});
};

Expand Down Expand Up @@ -70,8 +92,10 @@ exports.createPages = async ({ actions, graphql }) => {
}

const brokenPages = [
/*
'/release-3.11.0/components/phone-input',
'/release-3.11.0/components/dropdown',
*/
];

// Create pages dynamically
Expand Down
4 changes: 4 additions & 0 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
"hds-core": "3.11.0",
"hds-design-tokens": "3.11.0",
"hds-react": "3.11.0",
"hds-3-core": "npm:hds-core@3.11.0",
"hds-3-react": "npm:hds-react@3.11.0",
"hds-2-core": "npm:hds-core@2.17.1",
"hds-2-react": "npm:hds-react@2.17.1",
"inquirer": "7.1.0",
"postcss": "8",
"prettier": "2.5.1",
Expand Down
3 changes: 2 additions & 1 deletion site/src/data/versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[
"4.0.0",
"3.11.0"
"3.11.0",
"2.17.1"
]
183 changes: 173 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1491,6 +1491,13 @@
dependencies:
regenerator-runtime "^0.14.0"

"@babel/runtime@^7.6.2":
version "7.26.0"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.26.0.tgz#8600c2f595f277c60815256418b85356a65173c1"
integrity sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==
dependencies:
regenerator-runtime "^0.14.0"

"@babel/template@^7.10.4", "@babel/template@^7.12.7", "@babel/template@^7.20.7", "@babel/template@^7.22.5", "@babel/template@^7.24.7", "@babel/template@^7.3.3":
version "7.24.7"
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.24.7.tgz#02efcee317d0609d2c07117cb70ef8fb17ab7315"
Expand Down Expand Up @@ -3844,6 +3851,16 @@
resolved "https://registry.yarnpkg.com/@reach/observe-rect/-/observe-rect-1.2.0.tgz#d7a6013b8aafcc64c778a0ccb83355a11204d3b2"
integrity sha512-Ba7HmkFgfQxZqqaeIWWkNK0rEhpxVQHIoVyW1YDSkGsGIXzcaW4deC8B0pZrNSSyLTdIk7y+5olKt5+g0GmFIQ==

"@react-aria/interactions@^3.2.0":
version "3.22.4"
resolved "https://registry.yarnpkg.com/@react-aria/interactions/-/interactions-3.22.4.tgz#88ed61ab6a485f869bc1f65ae6688d48ca96064b"
integrity sha512-E0vsgtpItmknq/MJELqYJwib+YN18Qag8nroqwjk1qOnBa9ROIkUhWJerLi1qs5diXq9LHKehZDXRlwPvdEFww==
dependencies:
"@react-aria/ssr" "^3.9.6"
"@react-aria/utils" "^3.25.3"
"@react-types/shared" "^3.25.0"
"@swc/helpers" "^0.5.0"

"@react-aria/interactions@^3.22.3":
version "3.22.3"
resolved "https://registry.yarnpkg.com/@react-aria/interactions/-/interactions-3.22.3.tgz#3ba50db12f6ed443ae061eed79e41509eaa3d8e6"
Expand All @@ -3861,7 +3878,7 @@
dependencies:
"@swc/helpers" "^0.5.0"

"@react-aria/utils@^3.25.3":
"@react-aria/utils@^3.2.0", "@react-aria/utils@^3.25.3":
version "3.25.3"
resolved "https://registry.yarnpkg.com/@react-aria/utils/-/utils-3.25.3.tgz#cad9bffc07b045cdc283df2cb65c18747acbf76d"
integrity sha512-PR5H/2vaD8fSq0H/UB9inNbc8KDcVmW6fYAfSWkkn+OAdhTTMVKqXXrZuZBWyFfSD5Ze7VN6acr4hrOQm2bmrA==
Expand All @@ -3872,6 +3889,16 @@
"@swc/helpers" "^0.5.0"
clsx "^2.0.0"

"@react-aria/visually-hidden@3.2.0":
version "3.2.0"
resolved "https://registry.yarnpkg.com/@react-aria/visually-hidden/-/visually-hidden-3.2.0.tgz#740730368c8572de397c9d82ff5700fd7e034907"
integrity sha512-eqLfU4ISWyRb8UM1YFRnxXdjNpjQNixj0sHT8usWJNuQrZt0ebDdu/Kv2Ir3VUYr+GldoeKGYMDFHKwFLll1Hg==
dependencies:
"@babel/runtime" "^7.6.2"
"@react-aria/interactions" "^3.2.0"
"@react-aria/utils" "^3.2.0"
clsx "^1.1.1"

"@react-aria/visually-hidden@3.8.16":
version "3.8.16"
resolved "https://registry.yarnpkg.com/@react-aria/visually-hidden/-/visually-hidden-3.8.16.tgz#524684c6d26e3e86c83921974a5df4d3e3b05486"
Expand Down Expand Up @@ -3899,6 +3926,26 @@
"@react-spring/shared" "~9.3.0"
"@react-spring/types" "~9.3.0"

"@react-spring/konva@~9.3.0":
version "9.3.2"
resolved "https://registry.yarnpkg.com/@react-spring/konva/-/konva-9.3.2.tgz#726d567c68bdd4b74c8683764c662fae08321910"
integrity sha512-LLpmj6bj7Z2LYZDM75JkQ+dNasvdH56+th7VXcoMcOouAcogfI+iJ5tIFFz4yI2f2oTJzy/RkjeovmHMYIP+KQ==
dependencies:
"@react-spring/animated" "~9.3.0"
"@react-spring/core" "~9.3.0"
"@react-spring/shared" "~9.3.0"
"@react-spring/types" "~9.3.0"

"@react-spring/native@~9.3.0":
version "9.3.2"
resolved "https://registry.yarnpkg.com/@react-spring/native/-/native-9.3.2.tgz#0d2e4e9f3383e70c7568a5dd94937794bdc669f8"
integrity sha512-UQS07N639JIEJBGNGiFre6el6Sk5QEcOQeyBFyA7JmT4ewpRH7mM6JQ7Sd3DNduplsFmypIsWg+9+lmE2d52Rw==
dependencies:
"@react-spring/animated" "~9.3.0"
"@react-spring/core" "~9.3.0"
"@react-spring/shared" "~9.3.0"
"@react-spring/types" "~9.3.0"

"@react-spring/rafz@~9.3.0":
version "9.3.2"
resolved "https://registry.yarnpkg.com/@react-spring/rafz/-/rafz-9.3.2.tgz#0cbd296cd17bbf1e7e49d3b3616884e026d5fb67"
Expand All @@ -3912,6 +3959,16 @@
"@react-spring/rafz" "~9.3.0"
"@react-spring/types" "~9.3.0"

"@react-spring/three@~9.3.0":
version "9.3.2"
resolved "https://registry.yarnpkg.com/@react-spring/three/-/three-9.3.2.tgz#e4321c1253077661b1a3de74d8a38a167368ef23"
integrity sha512-nZHHjOl4GksoOFNTwvP4h5bACm5OymCUsR3nejWFigqCPep8prUHaawX4kZRwfUbWTYgkp15yM5hy7BkWNN16A==
dependencies:
"@react-spring/animated" "~9.3.0"
"@react-spring/core" "~9.3.0"
"@react-spring/shared" "~9.3.0"
"@react-spring/types" "~9.3.0"

"@react-spring/types@~9.3.0":
version "9.3.2"
resolved "https://registry.yarnpkg.com/@react-spring/types/-/types-9.3.2.tgz#0277d436e50d7a824897dd7bb880f4842fbcd0fe"
Expand All @@ -3927,6 +3984,26 @@
"@react-spring/shared" "~9.3.0"
"@react-spring/types" "~9.3.0"

"@react-spring/web@~9.3.0":
version "9.3.2"
resolved "https://registry.yarnpkg.com/@react-spring/web/-/web-9.3.2.tgz#07620c17bf50b5b0b8bbf9cd8f1312d13778b207"
integrity sha512-zzM95rqanap6s0udRCoI4gerONjQjyI6I0h23UZ0X36w5sXmuzv/tBtjGPbsASo377EGM7tRIg9po1KHwb6yQg==
dependencies:
"@react-spring/animated" "~9.3.0"
"@react-spring/core" "~9.3.0"
"@react-spring/shared" "~9.3.0"
"@react-spring/types" "~9.3.0"

"@react-spring/zdog@~9.3.0":
version "9.3.2"
resolved "https://registry.yarnpkg.com/@react-spring/zdog/-/zdog-9.3.2.tgz#e25307cda0c7171119f8f536f10ce25ef607c372"
integrity sha512-E8MtTG4kNBcW/sEu0Im7L2FZXmhZDfeHSNbaL35cebfBlL5iI6+Pdlr7A/RPJ2pCUUKJRLlxYu3DVTuaqwf6hQ==
dependencies:
"@react-spring/animated" "~9.3.0"
"@react-spring/core" "~9.3.0"
"@react-spring/shared" "~9.3.0"
"@react-spring/types" "~9.3.0"

"@react-stately/utils@^3.10.4":
version "3.10.4"
resolved "https://registry.yarnpkg.com/@react-stately/utils/-/utils-3.10.4.tgz#310663a834b67048d305e1680ed258130092fe51"
Expand Down Expand Up @@ -7228,7 +7305,7 @@
dependencies:
"@typescript-eslint/utils" "5.62.0"

"@typescript-eslint/parser@^5.5.0", "@typescript-eslint/parser@^5.60.1":
"@typescript-eslint/parser@^5.5.0", "@typescript-eslint/parser@^5.56.0", "@typescript-eslint/parser@^5.60.1":
version "5.62.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.62.0.tgz#1b63d082d849a2fcae8a569248fbe2ee1b8a56c7"
integrity sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==
Expand Down Expand Up @@ -15542,6 +15619,87 @@ hastscript@^6.0.0:
property-information "^5.0.0"
space-separated-tokens "^1.0.0"

"hds-2-core@npm:hds-core@2.17.1":
version "2.17.1"
resolved "https://registry.yarnpkg.com/hds-core/-/hds-core-2.17.1.tgz#3ed9dd22de0db1d1454b32311cdf3fdc6463b0c4"
integrity sha512-Ii9hHyrGofstuy58qMg+lTqwhj/jjaIOwJsieeFJ36C6Ewv6qdvkEP3wvaGW/38hIycoWosCTLMCSqQ5XRvF5A==

"hds-2-react@npm:hds-react@2.17.1":
version "2.17.1"
resolved "https://registry.yarnpkg.com/hds-react/-/hds-react-2.17.1.tgz#4c60b322676a9edb1657812c4cabb99a98989190"
integrity sha512-Gcqr2NtVs8Vh35fZArGFwzQ2wvsjhX64q+ijHeFzdozYLZzQ47f6YD8NlpG2qnZvfMsZdUqKdMcg1+/jmHgQ5A==
dependencies:
"@babel/runtime" "7.17.9"
"@emotion/styled-base" "^11.0.0"
"@hookform/resolvers" "^2.9.11"
"@juggle/resize-observer" "3.2.0"
"@popperjs/core" "2.11.5"
"@react-aria/visually-hidden" "3.2.0"
"@types/cookie" "^0.4.1"
"@typescript-eslint/parser" "^5.56.0"
cookie "^0.4.1"
crc-32 "1.2.0"
date-fns "2.16.1"
downshift "6.0.6"
hds-core "2.17.1"
kashe "1.0.4"
lodash "^4.17.21"
memoize-one "5.2.1"
react-hook-form "^7.43.3"
react-merge-refs "1.1.0"
react-popper "2.2.5"
react-spring "9.3.0"
react-use-measure "2.0.1"
react-virtual "2.10.4"
uuid "^9.0.0"
yup "^1.0.2"

"hds-3-core@npm:hds-core@3.11.0":
version "3.11.0"
resolved "https://registry.yarnpkg.com/hds-core/-/hds-core-3.11.0.tgz#27d357da72752a402d97aa7904b3491be09e3225"
integrity sha512-405+8VHW4N3/y5ESWGOv6vUIbgp/DCYjQVpdVLsWg6RowrUwNk9VvU6N2ZpEP8HM3ujJYu/bcIQ6zzwvAOFMCA==

"hds-3-react@npm:hds-react@3.11.0":
version "3.11.0"
resolved "https://registry.yarnpkg.com/hds-react/-/hds-react-3.11.0.tgz#064018eb67520fd88223085ea6a629d79c332275"
integrity sha512-n3JiEX1K9xWqwEi7VvZvDj4+wnpMNCZX9mmOdsK8h9ZYGHS49vPnvYLXs3hlX/Ljw1XGsgX3vtQlOO69C1iu2g==
dependencies:
"@apollo/client" "^3.10.1"
"@babel/runtime" "7.17.9"
"@emotion/styled-base" "^11.0.0"
"@hookform/resolvers" "^2.9.11"
"@juggle/resize-observer" "3.2.0"
"@popperjs/core" "2.11.5"
"@react-aria/visually-hidden" "3.8.16"
"@react-spring/web" "9.3.0"
"@types/cookie" "^0.4.1"
"@typescript-eslint/parser" "^6.19.0"
await-to-js "^3.0.0"
cookie "^0.4.1"
crc-32 "1.2.0"
date-fns "2.16.1"
downshift "6.0.6"
graphql "^16.8.1"
hds-core "3.11.0"
jwt-decode "^3.1.2"
kashe "1.0.4"
lodash "^4.17.21"
memoize-one "5.2.1"
oidc-client-ts "^2.4.1"
postcss "^8.4.21"
react-hook-form "^7.43.3"
react-merge-refs "1.1.0"
react-popper "2.2.5"
react-use-measure "2.0.1"
react-virtual "2.10.4"
uuid "^9.0.0"
yup "^1.0.2"

hds-core@2.17.1:
version "2.17.1"
resolved "https://registry.yarnpkg.com/hds-core/-/hds-core-2.17.1.tgz#3ed9dd22de0db1d1454b32311cdf3fdc6463b0c4"
integrity sha512-Ii9hHyrGofstuy58qMg+lTqwhj/jjaIOwJsieeFJ36C6Ewv6qdvkEP3wvaGW/38hIycoWosCTLMCSqQ5XRvF5A==

he@1.2.0, he@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
Expand Down Expand Up @@ -23694,7 +23852,7 @@ qs@6.11.0:
dependencies:
side-channel "^1.0.4"

qs@6.13.0:
qs@6.13.0, qs@^6.4.0:
version "6.13.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.13.0.tgz#6ca3bd58439f7e245655798997787b0d88a51906"
integrity sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==
Expand All @@ -23708,13 +23866,6 @@ qs@^6.10.0, qs@^6.11.0:
dependencies:
side-channel "^1.0.4"

qs@^6.4.0:
version "6.13.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.13.0.tgz#6ca3bd58439f7e245655798997787b0d88a51906"
integrity sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==
dependencies:
side-channel "^1.0.6"

query-string@^6.14.1:
version "6.14.1"
resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.14.1.tgz#7ac2dca46da7f309449ba0f86b1fd28255b0c86a"
Expand Down Expand Up @@ -24192,6 +24343,18 @@ react-sizeme@^3.0.1:
shallowequal "^1.1.0"
throttle-debounce "^3.0.1"

react-spring@9.3.0:
version "9.3.0"
resolved "https://registry.yarnpkg.com/react-spring/-/react-spring-9.3.0.tgz#4d71eecbfd4f0823bf67e5943d2b0fb77f3e26ad"
integrity sha512-zxhMUCM4ha22724q1CshmbzKUfqdUp2HyA4P72+A0xVF/9bgaFuMukI8C8/Rjfdqw6sGg3hZNvmY9Z8n4cqWmg==
dependencies:
"@react-spring/core" "~9.3.0"
"@react-spring/konva" "~9.3.0"
"@react-spring/native" "~9.3.0"
"@react-spring/three" "~9.3.0"
"@react-spring/web" "~9.3.0"
"@react-spring/zdog" "~9.3.0"

react-syntax-highlighter@^13.5.3:
version "13.5.3"
resolved "https://registry.yarnpkg.com/react-syntax-highlighter/-/react-syntax-highlighter-13.5.3.tgz#9712850f883a3e19eb858cf93fad7bb357eea9c6"
Expand Down

0 comments on commit 2408e7c

Please sign in to comment.