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