chore: deploy scripts

This commit is contained in:
mathuo 2022-05-02 22:40:44 +01:00
parent c044af68e9
commit 0943ff8f4b
No known key found for this signature in database
GPG Key ID: C6EEDEFD6CA07281
12 changed files with 600 additions and 518 deletions

View File

@ -3,7 +3,7 @@
#
# 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:
@ -12,7 +12,7 @@ on:
# # The branches below must be a subset of the branches above
# branches: [master]
schedule:
- cron: "0 4 * * *"
- cron: '0 4 * * *'
jobs:
analyze:
@ -24,7 +24,7 @@ jobs:
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ["javascript"]
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

42
.github/workflows/deploy-docs.yml vendored Normal file
View 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

View File

@ -16,16 +16,16 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
node-version: '16.x'
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- run: yarn
- run: npm run bootstrap-no-hoist
- run: npm run build
- run: npm run test

View File

@ -14,16 +14,16 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "16.x"
node-version: '16.x'
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- run: yarn
- run: npm run bootstrap
- run: npm run build
- run: npm run test:cov

View File

@ -4,7 +4,7 @@
],
"npmClient": "yarn",
"useWorkspaces": true,
"version": "1.3.0",
"version": "1.3.1",
"command": {
"publish": {
"message": "chore(release): publish %s"

View File

@ -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",

View File

@ -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: {

View File

@ -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",

View File

@ -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
View 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'));

View File

@ -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'));

837
yarn.lock

File diff suppressed because it is too large Load Diff