mirror of
				https://github.com/mathuo/dockview
				synced 2025-10-31 20:28:06 +00:00 
			
		
		
		
	chore: deploy scripts
This commit is contained in:
		
							parent
							
								
									c044af68e9
								
							
						
					
					
						commit
						0943ff8f4b
					
				
							
								
								
									
										90
									
								
								.github/workflows/codeql-analysis.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										90
									
								
								.github/workflows/codeql-analysis.yml
									
									
									
									
										vendored
									
									
								
							| @ -3,60 +3,60 @@ | ||||
| # | ||||
| # You may wish to alter this file to override the set of languages analyzed, | ||||
| # or to provide custom queries or build logic. | ||||
| name: "CodeQL" | ||||
| name: 'CodeQL' | ||||
| 
 | ||||
| on: | ||||
|   # push: | ||||
|   #   branches: [master] | ||||
|   # pull_request: | ||||
|   #   # The branches below must be a subset of the branches above | ||||
|   #   branches: [master] | ||||
|   schedule: | ||||
|     - cron: "0 4 * * *" | ||||
|     # push: | ||||
|     #   branches: [master] | ||||
|     # pull_request: | ||||
|     #   # The branches below must be a subset of the branches above | ||||
|     #   branches: [master] | ||||
|     schedule: | ||||
|         - cron: '0 4 * * *' | ||||
| 
 | ||||
| jobs: | ||||
|   analyze: | ||||
|     name: Analyze | ||||
|     runs-on: ubuntu-latest | ||||
|     analyze: | ||||
|         name: Analyze | ||||
|         runs-on: ubuntu-latest | ||||
| 
 | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         # Override automatic language detection by changing the below list | ||||
|         # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] | ||||
|         language: ["javascript"] | ||||
|         # Learn more... | ||||
|         # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection | ||||
|         strategy: | ||||
|             fail-fast: false | ||||
|             matrix: | ||||
|                 # Override automatic language detection by changing the below list | ||||
|                 # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] | ||||
|                 language: ['javascript'] | ||||
|                 # Learn more... | ||||
|                 # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection | ||||
| 
 | ||||
|     steps: | ||||
|       - name: Checkout repository | ||||
|         uses: actions/checkout@v2 | ||||
|         steps: | ||||
|             - name: Checkout repository | ||||
|               uses: actions/checkout@v2 | ||||
| 
 | ||||
|       # Initializes the CodeQL tools for scanning. | ||||
|       - name: Initialize CodeQL | ||||
|         uses: github/codeql-action/init@v1 | ||||
|         with: | ||||
|           languages: ${{ matrix.language }} | ||||
|           # If you wish to specify custom queries, you can do so here or in a config file. | ||||
|           # By default, queries listed here will override any specified in a config file. | ||||
|           # Prefix the list here with "+" to use these queries and those in the config file. | ||||
|           # queries: ./path/to/local/query, your-org/your-repo/queries@main | ||||
|             # Initializes the CodeQL tools for scanning. | ||||
|             - name: Initialize CodeQL | ||||
|               uses: github/codeql-action/init@v1 | ||||
|               with: | ||||
|                   languages: ${{ matrix.language }} | ||||
|                   # If you wish to specify custom queries, you can do so here or in a config file. | ||||
|                   # By default, queries listed here will override any specified in a config file. | ||||
|                   # Prefix the list here with "+" to use these queries and those in the config file. | ||||
|                   # queries: ./path/to/local/query, your-org/your-repo/queries@main | ||||
| 
 | ||||
|       # Autobuild attempts to build any compiled languages  (C/C++, C#, or Java). | ||||
|       # If this step fails, then you should remove it and run the build manually (see below) | ||||
|       - name: Autobuild | ||||
|         uses: github/codeql-action/autobuild@v1 | ||||
|             # Autobuild attempts to build any compiled languages  (C/C++, C#, or Java). | ||||
|             # If this step fails, then you should remove it and run the build manually (see below) | ||||
|             - name: Autobuild | ||||
|               uses: github/codeql-action/autobuild@v1 | ||||
| 
 | ||||
|       # ℹ️ Command-line programs to run using the OS shell. | ||||
|       # 📚 https://git.io/JvXDl | ||||
|             # ℹ️ Command-line programs to run using the OS shell. | ||||
|             # 📚 https://git.io/JvXDl | ||||
| 
 | ||||
|       # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines | ||||
|       #    and modify them (or add more) to build your code if your project | ||||
|       #    uses a compiled language | ||||
|             # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines | ||||
|             #    and modify them (or add more) to build your code if your project | ||||
|             #    uses a compiled language | ||||
| 
 | ||||
|       #- run: | | ||||
|       #   make bootstrap | ||||
|       #   make release | ||||
|             #- run: | | ||||
|             #   make bootstrap | ||||
|             #   make release | ||||
| 
 | ||||
|       - name: Perform CodeQL Analysis | ||||
|         uses: github/codeql-action/analyze@v1 | ||||
|             - name: Perform CodeQL Analysis | ||||
|               uses: github/codeql-action/analyze@v1 | ||||
|  | ||||
							
								
								
									
										42
									
								
								.github/workflows/deploy-docs.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								.github/workflows/deploy-docs.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,42 @@ | ||||
| name: Deploy Docs | ||||
| 
 | ||||
| # on: | ||||
| #   schedule: | ||||
| #     - cron:  '0 3 * * *' # every day at 3 am UTC | ||||
| 
 | ||||
| on: [push] | ||||
| 
 | ||||
| jobs: | ||||
|     deploy-nightly-demo-app: | ||||
|         runs-on: ubuntu-latest | ||||
|         steps: | ||||
|             - name: Checkout 🛎️ | ||||
|               uses: actions/checkout@v2.3.1 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly. | ||||
|               with: | ||||
|                   persist-credentials: false | ||||
| 
 | ||||
|             - name: Use Node.js | ||||
|               uses: actions/setup-node@v1 | ||||
|               with: | ||||
|                   node-version: '16.x' | ||||
| 
 | ||||
|             - uses: actions/cache@v2 | ||||
|               with: | ||||
|                   path: ~/.npm | ||||
|                   key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} | ||||
|                   restore-keys: | | ||||
|                       ${{ runner.os }}-node- | ||||
| 
 | ||||
|             - run: yarn | ||||
|             - run: npm run bootstrap-no-hoist | ||||
|             - run: npm run build | ||||
|             - run: npm run test | ||||
|             - run: npm run deploy-docs | ||||
|             - name: Deploy 🚀 | ||||
|               uses: JamesIves/github-pages-deploy-action@3.7.1 | ||||
|               with: | ||||
|                   GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||
|                   BRANCH: gh-pages # The branch the action should deploy to. | ||||
|                   FOLDER: docs # The folder the action should deploy. | ||||
|                   TARGET_FOLDER: docs | ||||
|                   CLEAN: true # Automatically remove deleted files from the deploy branch | ||||
							
								
								
									
										64
									
								
								.github/workflows/deploy-nightly.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										64
									
								
								.github/workflows/deploy-nightly.yml
									
									
									
									
										vendored
									
									
								
							| @ -1,40 +1,40 @@ | ||||
| name: Deploy Nightly Demo App | ||||
| 
 | ||||
| on: | ||||
|   schedule: | ||||
|     - cron:  '0 3 * * *' # every day at 3 am UTC | ||||
|     schedule: | ||||
|         - cron: '0 3 * * *' # every day at 3 am UTC | ||||
| 
 | ||||
| jobs: | ||||
|   deploy-nightly-demo-app: | ||||
|     runs-on: ubuntu-latest | ||||
|     steps: | ||||
|       - name: Checkout 🛎️ | ||||
|         uses: actions/checkout@v2.3.1 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly. | ||||
|         with: | ||||
|           persist-credentials: false | ||||
|     deploy-nightly-demo-app: | ||||
|         runs-on: ubuntu-latest | ||||
|         steps: | ||||
|             - name: Checkout 🛎️ | ||||
|               uses: actions/checkout@v2.3.1 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly. | ||||
|               with: | ||||
|                   persist-credentials: false | ||||
| 
 | ||||
|       - name: Use Node.js | ||||
|         uses: actions/setup-node@v1 | ||||
|         with: | ||||
|             node-version: '12.x' | ||||
|             - name: Use Node.js | ||||
|               uses: actions/setup-node@v1 | ||||
|               with: | ||||
|                   node-version: '16.x' | ||||
| 
 | ||||
|       - uses: actions/cache@v2 | ||||
|         with: | ||||
|           path: ~/.npm | ||||
|           key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||||
|           restore-keys: | | ||||
|               ${{ runner.os }}-node- | ||||
|             - uses: actions/cache@v2 | ||||
|               with: | ||||
|                   path: ~/.npm | ||||
|                   key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} | ||||
|                   restore-keys: | | ||||
|                       ${{ runner.os }}-node- | ||||
| 
 | ||||
|       - run: npm ci | ||||
|       - run: npm run bootstrap-no-hoist | ||||
|       - run: npm run build | ||||
|       - run: npm run test | ||||
|       - run: npm run package-all | ||||
|       - name: Deploy 🚀 | ||||
|         uses: JamesIves/github-pages-deploy-action@3.7.1 | ||||
|         with: | ||||
|           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||
|           BRANCH: gh-pages # The branch the action should deploy to. | ||||
|           FOLDER: output # The folder the action should deploy. | ||||
|           TARGET_FOLDER: output | ||||
|           CLEAN: true # Automatically remove deleted files from the deploy branch | ||||
|             - run: yarn | ||||
|             - run: npm run bootstrap-no-hoist | ||||
|             - run: npm run build | ||||
|             - run: npm run test | ||||
|             - run: npm run package-all | ||||
|             - name: Deploy 🚀 | ||||
|               uses: JamesIves/github-pages-deploy-action@3.7.1 | ||||
|               with: | ||||
|                   GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||
|                   BRANCH: gh-pages # The branch the action should deploy to. | ||||
|                   FOLDER: output # The folder the action should deploy. | ||||
|                   TARGET_FOLDER: output | ||||
|                   CLEAN: true # Automatically remove deleted files from the deploy branch | ||||
|  | ||||
							
								
								
									
										52
									
								
								.github/workflows/main.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										52
									
								
								.github/workflows/main.yml
									
									
									
									
										vendored
									
									
								
							| @ -3,32 +3,32 @@ name: CI | ||||
| on: [push] | ||||
| 
 | ||||
| jobs: | ||||
|   build: | ||||
|     runs-on: ubuntu-latest | ||||
|     build: | ||||
|         runs-on: ubuntu-latest | ||||
| 
 | ||||
|     steps: | ||||
|       - uses: actions/checkout@v2 | ||||
|         # might be required for sonar to work correctly | ||||
|         with: | ||||
|           fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||||
|       - name: Use Node.js | ||||
|         uses: actions/setup-node@v1 | ||||
|         with: | ||||
|           node-version: "16.x" | ||||
|         steps: | ||||
|             - uses: actions/checkout@v2 | ||||
|               # might be required for sonar to work correctly | ||||
|               with: | ||||
|                   fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||||
|             - name: Use Node.js | ||||
|               uses: actions/setup-node@v1 | ||||
|               with: | ||||
|                   node-version: '16.x' | ||||
| 
 | ||||
|       - uses: actions/cache@v2 | ||||
|         with: | ||||
|           path: ~/.npm | ||||
|           key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||||
|           restore-keys: | | ||||
|             ${{ runner.os }}-node- | ||||
|             - uses: actions/cache@v2 | ||||
|               with: | ||||
|                   path: ~/.npm | ||||
|                   key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} | ||||
|                   restore-keys: | | ||||
|                       ${{ runner.os }}-node- | ||||
| 
 | ||||
|       - run: npm ci | ||||
|       - run: npm run bootstrap | ||||
|       - run: npm run build | ||||
|       - run: npm run test:cov | ||||
|       - name: SonarCloud Scan | ||||
|         uses: SonarSource/sonarcloud-github-action@master | ||||
|         env: | ||||
|           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | ||||
|           SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||||
|             - run: yarn | ||||
|             - run: npm run bootstrap | ||||
|             - run: npm run build | ||||
|             - run: npm run test:cov | ||||
|             - name: SonarCloud Scan | ||||
|               uses: SonarSource/sonarcloud-github-action@master | ||||
|               env: | ||||
|                   GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | ||||
|                   SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||||
|  | ||||
| @ -4,7 +4,7 @@ | ||||
|   ], | ||||
|   "npmClient": "yarn", | ||||
|   "useWorkspaces": true, | ||||
|   "version": "1.3.0", | ||||
|   "version": "1.3.1", | ||||
|   "command": { | ||||
|     "publish": { | ||||
|       "message": "chore(release): publish %s" | ||||
|  | ||||
| @ -10,6 +10,7 @@ | ||||
|     "lint": "eslint packages/**/src/** --ext .ts,.tsx,.js,.jsx", | ||||
|     "package": "node scripts/package.js", | ||||
|     "package-all": "npm run build-demo && npm run docs && node scripts/package.js", | ||||
|     "deploy-docs": "lerna run build --scope dockview-docs && lerna run export --scope dockview-docs && node scripts/package-docs.js", | ||||
|     "build": "lerna run build --scope dockview", | ||||
|     "build-demo": "lerna run build --scope dockview-demo", | ||||
|     "docs": "lerna run docs --scope dockview", | ||||
|  | ||||
| @ -8,12 +8,6 @@ const withTM = transpile(['dockview', 'dockview-demo'], { | ||||
|     resolveSymlinks: true, | ||||
| }); | ||||
| 
 | ||||
| import path from 'path'; | ||||
| 
 | ||||
| import { URL } from 'url'; // in Browser, the URL in native accessible on window
 | ||||
| 
 | ||||
| const __dirname = new URL('.', import.meta.url).pathname; | ||||
| 
 | ||||
| const withMDX = mdx({ | ||||
|     extension: /\.mdx$/, | ||||
|     options: { | ||||
| @ -33,6 +27,9 @@ const withMDX = mdx({ | ||||
| 
 | ||||
| export default withTM( | ||||
|     withMDX({ | ||||
|         basePath: '/dockview/docs', | ||||
|         assetPrefix: '/dockview/docs/', | ||||
|         //
 | ||||
|         reactStrictMode: true, | ||||
|         pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'], | ||||
|         experimental: { | ||||
|  | ||||
| @ -6,7 +6,8 @@ | ||||
|     "dev": "next dev", | ||||
|     "build": "next build", | ||||
|     "start": "next start", | ||||
|     "lint": "next lint" | ||||
|     "lint": "next lint", | ||||
|     "export": "next export" | ||||
|   }, | ||||
|   "dependencies": { | ||||
|     "@mdx-js/loader": "^2.1.1", | ||||
|  | ||||
| @ -206,7 +206,7 @@ export class SplitviewComponent | ||||
|         this.splitview.moveView(from, to); | ||||
|     } | ||||
| 
 | ||||
|     setVisible(panel: SplitviewPanel, visible: boolean) { | ||||
|     setVisible(panel: SplitviewPanel, visible: boolean): void { | ||||
|         const index = this.panels.indexOf(panel); | ||||
|         this.splitview.setViewVisible(index, visible); | ||||
|     } | ||||
| @ -228,7 +228,7 @@ export class SplitviewComponent | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     removePanel(panel: SplitviewPanel, sizing?: Sizing) { | ||||
|     removePanel(panel: SplitviewPanel, sizing?: Sizing): void { | ||||
|         const disposable = this._panels.get(panel.id); | ||||
| 
 | ||||
|         if (!disposable) { | ||||
| @ -411,7 +411,7 @@ export class SplitviewComponent | ||||
|         this._onDidLayoutfromJSON.fire(); | ||||
|     } | ||||
| 
 | ||||
|     dispose() { | ||||
|     dispose(): void { | ||||
|         for (const [_, value] of this._panels.entries()) { | ||||
|             value.disposable.dispose(); | ||||
|             value.value.dispose(); | ||||
|  | ||||
							
								
								
									
										8
									
								
								scripts/package-docs.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								scripts/package-docs.js
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,8 @@ | ||||
| const fs = require('fs-extra'); | ||||
| const path = require('path'); | ||||
| 
 | ||||
| const output = path.join(__dirname, '../'); | ||||
| 
 | ||||
| const docsDir = path.join(__dirname, '../packages/dockview-docs/out'); | ||||
| 
 | ||||
| fs.copySync(docsDir, path.join(output, 'docs')); | ||||
| @ -10,6 +10,6 @@ const storybookAppDir = path.join( | ||||
|     '../packages/dockview-demo/storybook-static' | ||||
| ); | ||||
| 
 | ||||
| fs.copySync(docsDir, path.join(output, 'docs')); | ||||
| fs.copySync(docsDir, path.join(output, 'typedocs')); | ||||
| fs.copySync(webpackAppDir, path.join(output, 'build')); | ||||
| fs.copySync(storybookAppDir, path.join(output, 'storybook-static')); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user