Skip to content

Commit

Permalink
Zui Monorepo (#2818)
Browse files Browse the repository at this point in the history
This PR moves all of the packages in zealot into the zui repo.

The structure of this repo is now as follows:

apps
└── zui
└── Zui-insiders
packages
├── e2e-tests
├── sample-data
├── zed-js
├── zed-node
├── zed-wasm
└── zui-test-data
It's managed by nx.

The yarn commands to start, test, and build are all still the same.

This will make our development cycle much faster, while enabling us to release separate packages to npm.
  • Loading branch information
jameskerr authored Jul 29, 2023
1 parent e1da723 commit 897e03e
Show file tree
Hide file tree
Showing 1,694 changed files with 16,344 additions and 1,655 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
46 changes: 46 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@typescript-eslint/no-unused-vars": ["error", {
"varsIgnorePattern": "^_",
"argsIgnorePattern": "^_"
}],
"@nrwl/nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
}
]
}
]
}
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"rules": {}
},
{
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
"env": {
"jest": true
},
"rules": {}
}
]
}
4 changes: 2 additions & 2 deletions .github/actions/build-zui/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ inputs:
required: true

runs:
using: "composite"
using: 'composite'
steps:
- name: Install rpm
if: runner.os == 'Linux'
Expand Down Expand Up @@ -61,5 +61,5 @@ runs:
- name: Check notorization with gatekeeper
if: runner.os == 'macOS'
run: |
spctl --assess --type execute --verbose --ignore-cache --no-cache installers/mac/*.app
spctl --assess --type execute --verbose --ignore-cache --no-cache dist/apps/zui/mac/*.app
shell: bash
14 changes: 7 additions & 7 deletions .github/actions/upload-build-artifacts/action.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
name: Uploade Build Artifacts
description: Uploade artifacts for each platform
name: Upload Build Artifacts
description: Upload artifacts for each platform

runs:
using: "composite"
using: 'composite'
steps:
- uses: actions/upload-artifact@v3
with:
name: Mac Artifact
path: installers/*.dmg
path: dist/apps/zui/*.dmg

- uses: actions/upload-artifact@v3
with:
name: Windows Artifact
path: installers/*.exe
path: dist/apps/zui/*.exe

- uses: actions/upload-artifact@v3
with:
name: Debian Artifact
path: installers/*.deb
path: dist/apps/zui/*.deb

- uses: actions/upload-artifact@v3
with:
name: RPM Artifact
path: installers/*.rpm
path: dist/apps/zui/*.rpm
2 changes: 1 addition & 1 deletion .github/workflows/advance-zed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
# We need a token with permission to push.
token: ${{ secrets.ZQ_UPDATE_PAT }}
- uses: ./.github/actions/setup-zui
- run: yarn add zed@brimdata/zed#${{ env.zed_ref }}
- run: yarn workspace zui add zed@brimdata/zed#${{ env.zed_ref }}
- run: yarn lint
- run: yarn test
- run: yarn build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
push:
branches:
- "build/**"
- 'build/**'

jobs:
release:
Expand All @@ -22,7 +22,7 @@ jobs:
- name: Build Zui
uses: ./.github/actions/build-zui
with:
cmd: yarn electron-builder --publish never
cmd: yarn nx package zui --publish never
gh_token: ${{ secrets.GITHUB_TOKEN }}
# Windows
csc_key_password: ${{ secrets.WINDOWS_SIGNING_PASSPHRASE }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
set -x
case ${{ runner.os }} in
Linux )
yarn electron-builder --linux=deb --publish never
sudo apt install -y --no-install-recommends ./installers/*.deb
yarn nx package zui --linux=deb --publish never
sudo apt install -y --no-install-recommends ./dist/apps/zui/*.deb
;;
esac
51 changes: 51 additions & 0 deletions .github/workflows/insiders-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Create Insiders Dev Build

on:
workflow_dispatch:
inputs:
zui-branch:
description: 'Zui branch on which to base this Zui Insiders build'
default: 'main'
required: false
push:
branches:
- 'build/**'

jobs:
release:
name: Build
strategy:
matrix:
platform: [windows-2019, macos-12, ubuntu-20.04]

runs-on: ${{ matrix.platform }}
steps:
- name: Checkout Zui
uses: actions/checkout@v3

- name: Setup Zui
uses: ./.github/actions/setup-zui

- name: Inject package.json
run: yarn nx inject zui-insiders

- name: Disable yarn immutable installs
run: yarn config set enableImmutableInstalls false

- name: Build Zui
uses: ./.github/actions/build-zui
with:
cmd: yarn nx package zui --config electron-builder-insiders.json --publish never
gh_token: ${{ secrets.GITHUB_TOKEN }}
# Windows
csc_key_password: ${{ secrets.WINDOWS_SIGNING_PASSPHRASE }}
csc_link: ${{ secrets.WINDOWS_SIGNING_PFX_BASE64 }}
# Mac
apple_id: ${{ secrets.APPLEID_USER }}
apple_id_password: ${{ secrets.APPLEID_PASSWORD }}
apple_team_id: ${{ secrets.APPLE_TEAM_ID }}
cert_p12: ${{ secrets.APPLE_DEVELOPER_ID_CERT_P12_BASE64 }}
cert_passphrase: ${{ secrets.APPLE_DEVELOPER_ID_CERT_PASSPHRASE }}

- name: Upload Artifacts
uses: ./.github/actions/upload-build-artifacts
56 changes: 56 additions & 0 deletions .github/workflows/insiders-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Create Insiders Release

on:
workflow_dispatch:
# schedule:
# - cron: '15 20 * * *' # Every day at 8:15pm UTC

jobs:
release:
name: Build and Publish
strategy:
matrix:
platform: [windows-2019, macos-12, ubuntu-20.04]

runs-on: ${{ matrix.platform }}
steps:
- name: Checkout Zui
uses: actions/checkout@v3

- name: Setup Zui
uses: ./.github/actions/setup-zui

- name: Check if there have been any changes to publish
run: yarn nx updated-needed zui-insiders

- name: Inject package.json
run: yarn nx inject zui-insiders

- name: Disable yarn immutable installs
run: yarn config set enableImmutableInstalls false

- name: Build Zui
uses: ./.github/actions/build-zui
with:
cmd: yarn nx package zui --config electron-builder-insiders.json --publish always
gh_token: ${{ secrets.GITHUB_TOKEN }}
# Windows
csc_key_password: ${{ secrets.WINDOWS_SIGNING_PASSPHRASE }}
csc_link: ${{ secrets.WINDOWS_SIGNING_PFX_BASE64 }}
# Mac
apple_id: ${{ secrets.APPLEID_USER }}
apple_id_password: ${{ secrets.APPLEID_PASSWORD }}
apple_team_id: ${{ secrets.APPLE_TEAM_ID }}
cert_p12: ${{ secrets.APPLE_DEVELOPER_ID_CERT_P12_BASE64 }}
cert_passphrase: ${{ secrets.APPLE_DEVELOPER_ID_CERT_PASSPHRASE }}

- name: Inform Slack users of failure
uses: tiloio/[email protected]
if: ${{ failure() }}
with:
slack_web_hook_url: ${{ secrets.SLACK_WEBHOOK_BRIMLABS_TEST }}
slack_json: |
{
"username": "{{GITHUB_REPOSITORY}}",
"text": "Release failed: https://github.com/{{GITHUB_REPOSITORY}}/actions/runs/{{GITHUB_RUN_ID}}"
}
8 changes: 4 additions & 4 deletions .github/workflows/notify-docs-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ on:
branches:
- main
paths:
- 'docs/**'
- 'apps/zui/docs/**'

jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Send dispatch event
run: |
curl -XPOST -u "${{ secrets.PAT_USERNAME }}:${{ secrets.PAT_TOKEN }}" -H "Accept: application/vnd.github.v3+json" -H "Content-Type: application/json" https://api.github.com/repos/brimdata/zui-docs-site/dispatches --data '{"event_type":"zui-docs-update"}'
- name: Send dispatch event
run: |
curl -XPOST -u "${{ secrets.PAT_USERNAME }}:${{ secrets.PAT_TOKEN }}" -H "Accept: application/vnd.github.v3+json" -H "Content-Type: application/json" https://api.github.com/repos/brimdata/zui-docs-site/dispatches --data '{"event_type":"zui-docs-update"}'
9 changes: 3 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
push:
branches:
- "release/**"
- 'release/**'

jobs:
release:
Expand All @@ -22,7 +22,7 @@ jobs:
- name: Build Zui
uses: ./.github/actions/build-zui
with:
cmd: yarn electron-builder
cmd: yarn nx package zui
gh_token: ${{ secrets.GITHUB_TOKEN }}
# Windows
csc_key_password: ${{ secrets.WINDOWS_SIGNING_PASSPHRASE }}
Expand All @@ -35,7 +35,4 @@ jobs:
cert_passphrase: ${{ secrets.APPLE_DEVELOPER_ID_CERT_PASSPHRASE }}

- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{matrix.platform}}-installer
path: installers
uses: ./.github/actions/upload-build-artifacts
49 changes: 49 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
node_modules
out
dist
Expand All @@ -22,3 +23,51 @@ yalc.lock
!.yarn/versions
.next
tsconfig.tsbuildinfo

# compiled output
dist
tmp
/out-tsc
run

# dependencies
node_modules

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# System Files
.DS_Store
Thumbs.db

# Yarn
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.10.0
16.10.0
5 changes: 3 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dist
run
# Add files here to ignore them from prettier formatting
/dist
/coverage
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
Loading

0 comments on commit 897e03e

Please sign in to comment.