From a78d594542814eb2f9393f4c747e29608a90d70a Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Fri, 6 May 2022 15:45:05 +0300 Subject: [PATCH 1/2] added integration --- www/docs/docusaurus.config.js | 6 ++++++ www/docs/package.json | 1 + www/docs/yarn.lock | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/www/docs/docusaurus.config.js b/www/docs/docusaurus.config.js index 8944b88e84..9e9e2c5296 100644 --- a/www/docs/docusaurus.config.js +++ b/www/docs/docusaurus.config.js @@ -23,6 +23,12 @@ module.exports = { systemvars: true, // Set to true if you would rather load all system variables as well (useful for CI purposes) }, ], + [ + "docusaurus-plugin-segment", + { + apiKey: process.env.SEGMENT_API_KEY + } + ] ], themeConfig: { colorMode: { diff --git a/www/docs/package.json b/www/docs/package.json index b5d7c5e27a..f0de8815fd 100644 --- a/www/docs/package.json +++ b/www/docs/package.json @@ -23,6 +23,7 @@ "@svgr/webpack": "6.2.1", "algoliasearch-helper": "^3.8.2", "clsx": "^1.1.1", + "docusaurus-plugin-segment": "^1.0.3", "docusaurus2-dotenv": "^1.4.0", "file-loader": "^6.2.0", "lodash": "^4.17.21", diff --git a/www/docs/yarn.lock b/www/docs/yarn.lock index 2558b23f9c..6f63e596e0 100644 --- a/www/docs/yarn.lock +++ b/www/docs/yarn.lock @@ -1798,6 +1798,25 @@ resolved "https://registry.yarnpkg.com/@mdx-js/util/-/util-1.6.22.tgz#219dfd89ae5b97a8801f015323ffa4b62f45718b" integrity sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA== +"@ndhoule/each@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@ndhoule/each/-/each-2.0.1.tgz#bbed372a603e0713a3193c706a73ddebc5b426a9" + integrity sha1-u+03KmA+BxOjGTxwanPd68W0Jqk= + dependencies: + "@ndhoule/keys" "^2.0.0" + +"@ndhoule/keys@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@ndhoule/keys/-/keys-2.0.0.tgz#3d64ae677c65a261747bf3a457c62eb292a4e0ce" + integrity sha1-PWSuZ3xlomF0e/OkV8YuspKk4M4= + +"@ndhoule/map@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@ndhoule/map/-/map-2.0.1.tgz#f5ca0a47424ea67f46e2a6d499b9e9bc886aefa8" + integrity sha1-9coKR0JOpn9G4qbUmbnpvIhq76g= + dependencies: + "@ndhoule/each" "^2.0.1" + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -1824,6 +1843,13 @@ resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.21.tgz#5de5a2385a35309427f6011992b544514d559aa1" integrity sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g== +"@segment/snippet@^4.13.2": + version "4.15.3" + resolved "https://registry.yarnpkg.com/@segment/snippet/-/snippet-4.15.3.tgz#ac829ec4570b249f559756293f4736e434885de7" + integrity sha512-75kVTYaQGYMkwVjJvCLLOlzxV8jCDxvKG68U88joo/rBx95SIXETcjUmIXF6A7SFRCgz83B+zrZbo+JYsmHkig== + dependencies: + "@ndhoule/map" "^2.0.1" + "@sideway/address@^4.1.3": version "4.1.3" resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.3.tgz#d93cce5d45c5daec92ad76db492cc2ee3c64ab27" @@ -3628,6 +3654,13 @@ dns-txt@^2.0.2: dependencies: buffer-indexof "^1.0.0" +docusaurus-plugin-segment@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/docusaurus-plugin-segment/-/docusaurus-plugin-segment-1.0.3.tgz#d32ec8ace8625837dee650f853bc89ae2221206a" + integrity sha512-9DqebTx9TqjujCnB22qEeCm8NGJUAH7VAKLAa20/CyfSSrs+khTQI0FmzEALtiCqKNO1D3GWm3VvE4gqbuGqnw== + dependencies: + "@segment/snippet" "^4.13.2" + docusaurus2-dotenv@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/docusaurus2-dotenv/-/docusaurus2-dotenv-1.4.0.tgz#9ab900e29de9081f9f1f28f7224ff63760385641" From 51bd461dcec4a9667ec95db4d37f07850b7b662e Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Fri, 6 May 2022 15:53:48 +0300 Subject: [PATCH 2/2] add segment for API reference --- www/reference/gatsby-config.js | 8 ++++++++ www/reference/package.json | 1 + www/reference/yarn.lock | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/www/reference/gatsby-config.js b/www/reference/gatsby-config.js index 90d5467b25..89feafe9af 100644 --- a/www/reference/gatsby-config.js +++ b/www/reference/gatsby-config.js @@ -65,6 +65,14 @@ module.exports = { allowList: ["ALGOLIA_API_KEY"], }, }, + { + resolve: `gatsby-plugin-segment-js`, + options: { + prodKey: process.env.SEGMENT_API_KEY, + devKey: process.env.SEGMENT_API_KEY_DEV, + trackPage: true, + } + }, // `gatsby-plugin-preact`, // { // resolve: `gatsby-source-openapi-aggregate`, diff --git a/www/reference/package.json b/www/reference/package.json index 1f0b25af62..0ccf61aa02 100644 --- a/www/reference/package.json +++ b/www/reference/package.json @@ -28,6 +28,7 @@ "gatsby-plugin-env-variables": "^2.1.0", "gatsby-plugin-preact": "^5.9.0", "gatsby-plugin-react-helmet": "^3.3.12", + "gatsby-plugin-segment-js": "^3.7.1", "gatsby-plugin-theme-ui": "^0.10.1", "gatsby-remark-autolink-headers": "^4.6.0", "gatsby-source-filesystem": "^3.9.0", diff --git a/www/reference/yarn.lock b/www/reference/yarn.lock index 3bf9eec530..3768a3367a 100644 --- a/www/reference/yarn.lock +++ b/www/reference/yarn.lock @@ -5425,6 +5425,11 @@ gatsby-plugin-react-helmet@^3.3.12: dependencies: "@babel/runtime" "^7.12.5" +gatsby-plugin-segment-js@^3.7.1: + version "3.7.1" + resolved "https://registry.yarnpkg.com/gatsby-plugin-segment-js/-/gatsby-plugin-segment-js-3.7.1.tgz#3432d59be0e45ee82f36a42cff060af220a0dd68" + integrity sha512-zAsjRrF77Kih7YRUJVp84thnODbzjDE44H6ePtdQfLVyPWiJj3IpS/WAwyRg9Cu3+FciFAT8WEjfJ2I02V0sUw== + gatsby-plugin-theme-ui@^0.10.1: version "0.10.1" resolved "https://registry.yarnpkg.com/gatsby-plugin-theme-ui/-/gatsby-plugin-theme-ui-0.10.1.tgz#d1ac7f4f1c4bf187694110a8670f0bb3ff470ad2"