mirror of
https://github.com/BillyOutlast/posthog.com.git
synced 2026-02-04 03:11:21 +01:00
Build clean up (#7788)
* clean up some build errors * removed unused shortcodes * remove import gen script * dont source non-team member profiles
This commit is contained in:
@@ -220,7 +220,7 @@
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "node ./scripts/mdxImportGen && git add src/mdxGlobalComponents.js && lint-staged"
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"workspaces": [
|
||||
|
||||
@@ -14,6 +14,13 @@ export const sourceNodes: GatsbyNode['sourceNodes'] = async (
|
||||
while (true) {
|
||||
let profileQuery = qs.stringify(
|
||||
{
|
||||
filters: {
|
||||
teams: {
|
||||
id: {
|
||||
$notNull: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
pagination: {
|
||||
page,
|
||||
pageSize: 100,
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
const baseDir = './src/components'
|
||||
const mdxIgnore = fs.readFileSync(path.join(baseDir, './.mdxignore'), 'utf8')
|
||||
const componentsToIgnore = new Set(mdxIgnore.split('\n'))
|
||||
|
||||
const getComponentsInDir = (dir, components = []) => {
|
||||
const dirContents = fs.readdirSync(dir)
|
||||
let subdirectories = []
|
||||
let indexFileInDir = false
|
||||
for (let f of dirContents) {
|
||||
if (fs.lstatSync(`${dir}/${f}`).isDirectory() && !componentsToIgnore.has(f)) {
|
||||
subdirectories.push(f)
|
||||
continue
|
||||
}
|
||||
if (!indexFileInDir && f.includes('index') && !f.includes('css')) {
|
||||
indexFileInDir = true
|
||||
}
|
||||
}
|
||||
if (!subdirectories || indexFileInDir) {
|
||||
return [...components, dir]
|
||||
}
|
||||
for (let subdir of subdirectories) {
|
||||
components = getComponentsInDir(`${dir}/${subdir}`, components)
|
||||
}
|
||||
return components
|
||||
}
|
||||
|
||||
const generateFile = () => {
|
||||
let imports = '// AUTO GENERATED FILE \n\n'
|
||||
let componentNames = []
|
||||
for (let component of getComponentsInDir(baseDir)) {
|
||||
const destructuredPath = component.split('/')
|
||||
const relativePath = './' + destructuredPath.slice(2).join('/')
|
||||
const componentName = destructuredPath[destructuredPath.length - 1]
|
||||
imports += `import { ${componentName} } from '${relativePath}'\n`
|
||||
componentNames.push(componentName)
|
||||
}
|
||||
imports += '\nexport const shortcodes = {\n\t' + componentNames.join(',\n\t') + '\n}'
|
||||
fs.writeFileSync('./src/mdxGlobalComponents.js', imports)
|
||||
}
|
||||
|
||||
generateFile()
|
||||
@@ -15,12 +15,12 @@ export default function InternalSidebarLink({ url, name, depth, onClick, classNa
|
||||
<span>
|
||||
<Link
|
||||
offset={compact ? -70 : breakpoints.md ? -56 : -108}
|
||||
style={style}
|
||||
style={{ ...style, ...{ paddingLeft: `${(depth || 0) + 1}rem` } }}
|
||||
smooth
|
||||
duration={300}
|
||||
to={url}
|
||||
hashSpy
|
||||
className={`relative block py-1 pl-[calc(1rem_+_${depth}rem)] pr-4 text-primary dark:text-primary-dark hover:bg-accent dark:hover:bg-accent-dark leading-tight font-medium hover:text-primary dark:hover:text-primary-dark cursor-pointer ${className} ${
|
||||
className={`relative block py-1 pr-4 text-primary dark:text-primary-dark hover:bg-accent dark:hover:bg-accent-dark leading-tight font-medium hover:text-primary dark:hover:text-primary-dark cursor-pointer ${className} ${
|
||||
depth === 0 ? 'font-semibold' : ''
|
||||
}`}
|
||||
spy
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import React from 'react'
|
||||
import { StaticImage } from 'gatsby-plugin-image'
|
||||
import { Link } from 'gatsby'
|
||||
import { quickLinks as productAnalyticsLinks } from '../../pages/docs/product-analytics'
|
||||
import { quickLinks as featureFlagsLinks } from '../../pages/docs/feature-flags'
|
||||
import { quickLinks as experimentsLinks } from '../../pages/docs/experiments'
|
||||
import { quickLinks as sessionRecordingLinks } from '../../pages/docs/session-replay'
|
||||
@@ -45,7 +44,7 @@ export const NextStep: React.FC<NextStepProps> = ({ title, url, links, children
|
||||
|
||||
export const ProductAnalytics = () => {
|
||||
return (
|
||||
<NextStep title="Product Analytics" url="/docs/product-analytics" links={productAnalyticsLinks}>
|
||||
<NextStep title="Product Analytics" url="/docs/product-analytics" links={[]}>
|
||||
<StaticImage
|
||||
alt=""
|
||||
placeholder="none"
|
||||
|
||||
@@ -1,121 +0,0 @@
|
||||
// AUTO GENERATED FILE
|
||||
|
||||
import { ArrayCTA } from './components/ArrayCTA'
|
||||
import { BasicHedgehogImage } from './components/BasicHedgehogImage'
|
||||
import { BorderWrapper } from './components/BorderWrapper'
|
||||
import { CallToAction } from './components/CallToAction'
|
||||
import { Caption } from './components/Caption'
|
||||
import { Images } from './components/Careers/Images'
|
||||
import { ComparisonTable } from './components/ComparisonTable'
|
||||
import { CompensationCalculator } from './components/CompensationCalculator'
|
||||
import { ContentViewer } from './components/ContentViewer'
|
||||
import { Drawer } from './components/Drawer'
|
||||
import { lib } from './components/Edition/lib'
|
||||
import { Emoji } from './components/Emoji'
|
||||
import { FeatureAvailability } from './components/FeatureAvailability'
|
||||
import { FormulaScreenshot } from './components/FormulaScreenshot'
|
||||
import { GDPRForm } from './components/GDPRForm'
|
||||
import { HiddenSection } from './components/HiddenSection'
|
||||
import { HubSpotForm } from './components/HubSpotForm'
|
||||
import { ImageDrop } from './components/ImageDrop'
|
||||
import { KeyboardShortcut } from './components/KeyboardShortcut'
|
||||
import { LPCTA } from './components/LPCTA'
|
||||
import { Label } from './components/Label'
|
||||
import { List } from './components/List'
|
||||
import { OverflowXSection } from './components/OverflowXSection'
|
||||
import { Quote } from './components/Pricing/Quote'
|
||||
import { PrivateLink } from './components/PrivateLink'
|
||||
import { AbTesting } from './components/Product/AbTesting'
|
||||
import { FeatureFlags } from './components/Product/FeatureFlags'
|
||||
import { ProductAnalytics } from './components/Product/ProductAnalytics'
|
||||
import { ProductOS } from './components/Product/ProductOS'
|
||||
import { SessionReplay } from './components/Product/SessionReplay'
|
||||
import { Surveys } from './components/Product/Surveys'
|
||||
import { ProductScreenshot } from './components/ProductScreenshot'
|
||||
import { Competitor } from './components/Products/Competitor'
|
||||
import { CustomerCard } from './components/Products/CustomerCard'
|
||||
import { DocsLinks } from './components/Products/DocsLinks'
|
||||
import { FAQ } from './components/Products/FAQ'
|
||||
import { Feature } from './components/Products/Feature'
|
||||
import { Marquee } from './components/Products/Marquee'
|
||||
import { MobileSlides } from './components/Products/MobileSlides'
|
||||
import { PairsWith } from './components/Products/PairsWith'
|
||||
import { Question } from './components/Products/Question'
|
||||
import { SmoothScroll } from './components/Products/SmoothScroll'
|
||||
import { Subfeature } from './components/Products/Subfeature'
|
||||
import { TextCard } from './components/Products/TextCard'
|
||||
import { TutorialCard } from './components/Products/TutorialCard'
|
||||
import { QuickLinks } from './components/QuickLinks'
|
||||
import { Quote2 } from './components/Quote2'
|
||||
import { RoadmapForm } from './components/RoadmapForm'
|
||||
import { RoadmapSelect } from './components/RoadmapSelect'
|
||||
import { Select } from './components/Select'
|
||||
import { Signatures } from './components/Signatures'
|
||||
import { SlackPage } from './components/SlackPage'
|
||||
import { Squeak } from './components/Squeak'
|
||||
import { StarRepoButton } from './components/StarRepoButton'
|
||||
import { Startups } from './components/Startups'
|
||||
import { TeamSelect } from './components/TeamSelect'
|
||||
import { TracksCTA } from './components/TracksCTA'
|
||||
import { ZendeskTicket } from './components/ZendeskTicket'
|
||||
|
||||
export const shortcodes = {
|
||||
ArrayCTA,
|
||||
BasicHedgehogImage,
|
||||
BorderWrapper,
|
||||
CallToAction,
|
||||
Caption,
|
||||
Images,
|
||||
ComparisonTable,
|
||||
CompensationCalculator,
|
||||
ContentViewer,
|
||||
Drawer,
|
||||
lib,
|
||||
Emoji,
|
||||
FeatureAvailability,
|
||||
FormulaScreenshot,
|
||||
GDPRForm,
|
||||
HiddenSection,
|
||||
HubSpotForm,
|
||||
ImageDrop,
|
||||
KeyboardShortcut,
|
||||
LPCTA,
|
||||
Label,
|
||||
List,
|
||||
OverflowXSection,
|
||||
Quote,
|
||||
PrivateLink,
|
||||
AbTesting,
|
||||
FeatureFlags,
|
||||
ProductAnalytics,
|
||||
ProductOS,
|
||||
SessionReplay,
|
||||
Surveys,
|
||||
ProductScreenshot,
|
||||
Competitor,
|
||||
CustomerCard,
|
||||
DocsLinks,
|
||||
FAQ,
|
||||
Feature,
|
||||
Marquee,
|
||||
MobileSlides,
|
||||
PairsWith,
|
||||
Question,
|
||||
SmoothScroll,
|
||||
Subfeature,
|
||||
TextCard,
|
||||
TutorialCard,
|
||||
QuickLinks,
|
||||
Quote2,
|
||||
RoadmapForm,
|
||||
RoadmapSelect,
|
||||
Select,
|
||||
Signatures,
|
||||
SlackPage,
|
||||
Squeak,
|
||||
StarRepoButton,
|
||||
Startups,
|
||||
TeamSelect,
|
||||
TracksCTA,
|
||||
ZendeskTicket,
|
||||
}
|
||||
35
src/mdxGlobalComponents.ts
Normal file
35
src/mdxGlobalComponents.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { ArrayCTA } from './components/ArrayCTA'
|
||||
import { BasicHedgehogImage } from './components/BasicHedgehogImage'
|
||||
import { BorderWrapper } from './components/BorderWrapper'
|
||||
import { CallToAction } from './components/CallToAction'
|
||||
import { Caption } from './components/Caption'
|
||||
import { ComparisonTable } from './components/ComparisonTable'
|
||||
import { CompensationCalculator } from './components/CompensationCalculator'
|
||||
import { Emoji } from './components/Emoji'
|
||||
import { FeatureAvailability } from './components/FeatureAvailability'
|
||||
import { FormulaScreenshot } from './components/FormulaScreenshot'
|
||||
import { GDPRForm } from './components/GDPRForm'
|
||||
import { OverflowXSection } from './components/OverflowXSection'
|
||||
import { Quote } from './components/Pricing/Quote'
|
||||
import { PrivateLink } from './components/PrivateLink'
|
||||
import { ProductScreenshot } from './components/ProductScreenshot'
|
||||
import { StarRepoButton } from './components/StarRepoButton'
|
||||
|
||||
export const shortcodes = {
|
||||
ArrayCTA,
|
||||
BasicHedgehogImage,
|
||||
BorderWrapper,
|
||||
CallToAction,
|
||||
Caption,
|
||||
ComparisonTable,
|
||||
CompensationCalculator,
|
||||
Emoji,
|
||||
FeatureAvailability,
|
||||
FormulaScreenshot,
|
||||
GDPRForm,
|
||||
OverflowXSection,
|
||||
Quote,
|
||||
PrivateLink,
|
||||
ProductScreenshot,
|
||||
StarRepoButton,
|
||||
}
|
||||
Reference in New Issue
Block a user