From b9b523863c8314953745a1abcf27e86e7d2eac67 Mon Sep 17 00:00:00 2001 From: Charles de Dreuille Date: Fri, 10 Jan 2025 11:36:15 +0000 Subject: [PATCH] Cleanup after feedbacks Signed-off-by: Charles de Dreuille --- .github/workflows/sync_canon.yml | 2 +- canon-docs/.gitignore | 34 +---------------------------- canon-docs/README.md | 37 +++++++------------------------- canon-docs/next.config.mjs | 1 + canon-docs/package.json | 4 +--- canon-docs/tsconfig.json | 8 ++++++- 6 files changed, 19 insertions(+), 67 deletions(-) diff --git a/.github/workflows/sync_canon.yml b/.github/workflows/sync_canon.yml index ea4f0ebb45..e630a418d4 100644 --- a/.github/workflows/sync_canon.yml +++ b/.github/workflows/sync_canon.yml @@ -47,7 +47,7 @@ jobs: working-directory: canon-external-docs run: | git rm -rf . - cp -R ../canon-docs/out/. . + cp -R ../canon-docs/dist/. . - name: Commit to canon-storybook repo working-directory: canon-external-docs diff --git a/canon-docs/.gitignore b/canon-docs/.gitignore index fd3dbb571a..efc7e8ec3f 100644 --- a/canon-docs/.gitignore +++ b/canon-docs/.gitignore @@ -1,36 +1,4 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js -.yarn/install-state.gz - -# testing -/coverage - # next.js /.next/ -/out/ - -# production -/build - -# misc -.DS_Store -*.pem - -# debug -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# local env files -.env*.local - -# vercel -.vercel - -# typescript -*.tsbuildinfo +/dist/ next-env.d.ts diff --git a/canon-docs/README.md b/canon-docs/README.md index e215bc4ccf..d91076c4cd 100644 --- a/canon-docs/README.md +++ b/canon-docs/README.md @@ -1,36 +1,15 @@ -This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). +# Canon Docs -## Getting Started +Canon is our internal UI library built for Backstage. We built this website to document the library and its components. You can view this website [here](https://canon.backstage.io). -First, run the development server: +## How to run locally + +This website is built with Next.js and it is hosted on Github pages. To run it locally, you can run the following command: ```bash -npm run dev -# or -yarn dev -# or -pnpm dev -# or -bun dev +yarn start ``` -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. +## Deployment -You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. - -This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. - -## Learn More - -To learn more about Next.js, take a look at the following resources: - -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. - -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! - -## Deploy on Vercel - -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. - -Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. +Deployments are done automatically when a PR is merged into the `master` branch. We host the website using Github pages. diff --git a/canon-docs/next.config.mjs b/canon-docs/next.config.mjs index 4177bd8408..ca221d9a8c 100644 --- a/canon-docs/next.config.mjs +++ b/canon-docs/next.config.mjs @@ -4,6 +4,7 @@ const nextConfig = { pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'], output: 'export', assetPrefix: '/', + distDir: 'dist', images: { unoptimized: true, }, diff --git a/canon-docs/package.json b/canon-docs/package.json index dcfca3c2ba..824a645f99 100644 --- a/canon-docs/package.json +++ b/canon-docs/package.json @@ -4,10 +4,8 @@ "private": true, "scripts": { "build": "next build", - "dev": "next dev", - "dev-all": "concurrently \"next dev\" \"yarn watch-css\"", "lint": "next lint", - "start": "next start", + "start": "concurrently \"next dev\" \"yarn watch-css\"", "watch-css": "node scripts/watch-css.js" }, "dependencies": { diff --git a/canon-docs/tsconfig.json b/canon-docs/tsconfig.json index 7b28589304..2baa7cde8f 100644 --- a/canon-docs/tsconfig.json +++ b/canon-docs/tsconfig.json @@ -21,6 +21,12 @@ "@/*": ["./src/*"] } }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "include": [ + "next-env.d.ts", + "**/*.ts", + "**/*.tsx", + ".next/types/**/*.ts", + "dist/types/**/*.ts" + ], "exclude": ["node_modules"] }