Skip to content

Commit

Permalink
refactor(docs): use local file to get examples version
Browse files Browse the repository at this point in the history
  • Loading branch information
chanceaclark committed Aug 19, 2024
1 parent 08e7c3e commit fbe979e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/polite-swans-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bigcommerce/docs': patch
---

Uses the package.json version from the `@bigcommerce/examples` package instead of relying on a dependency from the docs `package.json`.
5 changes: 3 additions & 2 deletions packages/docs/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@ const withTM = require('next-transpile-modules')([
]);

const bdPkg = require('../big-design/package.json');
const examplesPkg = require('../examples/package.json');

const pkg = require('./package.json');

const isProduction = process.env.NODE_ENV === 'production';
const isDev = !isProduction;
const URL_PREFIX = '/big-design';
const examplesVersion = pkg.devDependencies['@bigcommerce/examples'].replace('^', '');
const EXAMPLES_VERSION = examplesPkg.version;

module.exports = withTM({
basePath: isProduction ? URL_PREFIX : '',
output: 'export',
env: {
CODE_SANDBOX_URL: `https://codesandbox.io/s/github/bigcommerce/big-design/tree/%40bigcommerce/examples%40${examplesVersion}/packages/examples`,
CODE_SANDBOX_URL: `https://codesandbox.io/s/github/bigcommerce/big-design/tree/%40bigcommerce/examples%40${EXAMPLES_VERSION}/packages/examples`,
URL_PREFIX: isProduction ? URL_PREFIX : '',
BD_VERSION: bdPkg.version,
},
Expand Down
1 change: 0 additions & 1 deletion packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
},
"devDependencies": {
"@bigcommerce/configs": "workspace:^",
"@bigcommerce/examples": "^1.0.3",
"@styled/typescript-styled-plugin": "^1.0.1",
"@types/gtag.js": "^0.0.20",
"@types/node": "^20.12.7",
Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fbe979e

Please sign in to comment.