Move canon-docs to docs-ui
Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
@@ -7,7 +7,7 @@
|
||||
**/.git/**
|
||||
**/public/**
|
||||
**/microsite/**
|
||||
**/canon-docs/**
|
||||
**/docs-ui/**
|
||||
**/templates/**
|
||||
**/sample-templates/**
|
||||
playwright.config.ts
|
||||
|
||||
@@ -4,7 +4,7 @@ on:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
sync-canon-docs:
|
||||
sync-docs-ui:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Harden Runner
|
||||
@@ -26,11 +26,11 @@ jobs:
|
||||
with:
|
||||
cache-prefix: ${{ runner.os }}-v20.x
|
||||
|
||||
- name: Checkout backstage/canon-docs
|
||||
- name: Checkout backstage/docs-ui
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
repository: backstage/canon-docs
|
||||
path: canon-external-docs
|
||||
repository: backstage/docs-ui
|
||||
path: bui-external-docs
|
||||
token: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }}
|
||||
|
||||
- name: Configure Git
|
||||
@@ -39,22 +39,22 @@ jobs:
|
||||
git config --global user.name 'Github Canon Docs workflow'
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: canon-docs
|
||||
working-directory: docs-ui
|
||||
run: yarn install
|
||||
|
||||
- name: Build Canon Docs
|
||||
working-directory: canon-docs
|
||||
- name: Build Docs UI
|
||||
working-directory: docs-ui
|
||||
run: |
|
||||
yarn build
|
||||
|
||||
- name: Replace contents of canon-external-docs repo with docs build output
|
||||
working-directory: canon-external-docs
|
||||
- name: Replace contents of bui-external-docs repo with docs build output
|
||||
working-directory: bui-external-docs
|
||||
run: |
|
||||
git rm -rf .
|
||||
cp -R ../canon-docs/dist/. .
|
||||
cp -R ../docs-ui/dist/. .
|
||||
|
||||
- name: Commit to canon-storybook repo
|
||||
working-directory: canon-external-docs
|
||||
working-directory: bui-external-docs
|
||||
run: |
|
||||
git add .
|
||||
git commit -am "Canon Docs build for backstage/backstage@${{ github.sha }}"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
.yarn
|
||||
dist
|
||||
microsite
|
||||
canon-docs/.next
|
||||
canon-docs/public
|
||||
canon-docs/out
|
||||
docs-ui/.next
|
||||
docs-ui/public
|
||||
docs-ui/out
|
||||
packages/ui/css
|
||||
coverage
|
||||
*.hbs
|
||||
|
||||
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
@@ -5,7 +5,7 @@ const chokidar = require('chokidar');
|
||||
|
||||
// Configuration
|
||||
const config = {
|
||||
canonPath: '../../packages/canon',
|
||||
UIPath: '../../packages/ui',
|
||||
publicPath: '../public',
|
||||
files: [
|
||||
{
|
||||
@@ -23,13 +23,13 @@ const config = {
|
||||
|
||||
class CSSSync {
|
||||
constructor() {
|
||||
this.canonPath = path.resolve(__dirname, config.canonPath);
|
||||
this.UIPath = path.resolve(__dirname, config.UIPath);
|
||||
this.publicPath = path.resolve(__dirname, config.publicPath);
|
||||
this.isWatching = process.argv.includes('--watch');
|
||||
}
|
||||
|
||||
async syncFile(fileConfig) {
|
||||
const sourcePath = path.join(this.canonPath, fileConfig.source);
|
||||
const sourcePath = path.join(this.UIPath, fileConfig.source);
|
||||
const destPath = path.join(this.publicPath, fileConfig.destination);
|
||||
|
||||
try {
|
||||
@@ -93,7 +93,7 @@ class CSSSync {
|
||||
|
||||
// Watch all source files
|
||||
const watchPaths = config.files.map(file =>
|
||||
path.join(this.canonPath, file.source),
|
||||
path.join(this.UIPath, file.source),
|
||||
);
|
||||
|
||||
const watcher = chokidar.watch(watchPaths, {
|
||||
@@ -103,7 +103,7 @@ class CSSSync {
|
||||
|
||||
watcher.on('change', async filePath => {
|
||||
console.log(
|
||||
`\n🔄 Change detected: ${path.relative(this.canonPath, filePath)}`,
|
||||
`\n🔄 Change detected: ${path.relative(this.UIPath, filePath)}`,
|
||||
);
|
||||
|
||||
// Find which file changed and sync it
|
||||
@@ -127,8 +127,8 @@ class CSSSync {
|
||||
}
|
||||
|
||||
async run() {
|
||||
console.log('🎨 Canon CSS Sync Tool\n');
|
||||
console.log(`📂 Canon path: ${this.canonPath}`);
|
||||
console.log('🎨 BUI CSS Sync Tool\n');
|
||||
console.log(`📂 BUI path: ${this.UIPath}`);
|
||||
console.log(`📂 Public path: ${this.publicPath}\n`);
|
||||
|
||||
// Initial sync
|
||||
|
Before Width: | Height: | Size: 702 B After Width: | Height: | Size: 702 B |
|
Before Width: | Height: | Size: 350 KiB After Width: | Height: | Size: 350 KiB |