Skip to content

Commit 837a2ec

Browse files
author
iexitdev
committed
Use Pro stubs for public publish docs
1 parent 207f6af commit 837a2ec

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ jobs:
7979

8080
- name: Docs
8181
run: npm run docs:build
82+
env:
83+
CHART_KIT_PRO_DOCS_STUBS: "true"
8284

8385
- name: React Native CLI example
8486
run: npm run example:rn-cli:typecheck

scripts/typecheck-doc-examples.mjs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ const ambientHandlers = [
8080
];
8181
const ambientObjects = ["chartConfig", "viewport"];
8282
const ambientDeclarations = "";
83+
const useProDocsStubs = process.env.CHART_KIT_PRO_DOCS_STUBS === "true";
8384

8485
const pathExists = async (filePath) => {
8586
try {
@@ -288,7 +289,15 @@ const parseTsConfig = () => {
288289
paths: {
289290
...(parsed.options.paths ?? {}),
290291
"react-native-chart-kit": ["src/index.ts"],
291-
"react-native-chart-kit/v2": ["packages/react-native/src/index.ts"]
292+
"react-native-chart-kit/v2": ["packages/react-native/src/index.ts"],
293+
...(useProDocsStubs
294+
? {
295+
"@chart-kit/pro": ["apps/site/src/previews/proStub.tsx"],
296+
"@chart-kit/pro/react-native": [
297+
"apps/site/src/previews/proStub.tsx"
298+
]
299+
}
300+
: {})
292301
},
293302
skipLibCheck: true,
294303
strict: false

0 commit comments

Comments
 (0)