Skip to content

Commit

Permalink
Merge branch 'main' into DT-1740-reset-reapply-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
rossedfort committed Sep 26, 2024
2 parents 88c4ae2 + a0123c6 commit afaa5c3
Show file tree
Hide file tree
Showing 604 changed files with 21,901 additions and 12,838 deletions.
4 changes: 4 additions & 0 deletions .env.local-temporal
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
VITE_TEMPORAL_PORT="7134"
VITE_API="http://localhost:8081"
VITE_MODE="development"
VITE_TEMPORAL_UI_BUILD_TARGET="local"
5 changes: 2 additions & 3 deletions .github/actions/checkout-and-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ runs:
using: 'composite'
steps:
- name: Setup pnpm
uses: pnpm/action-setup@v2.4.0
uses: pnpm/action-setup@v4.0.0
with:
run_install: false
version: 8.6.0
- name: Install Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/bump-package-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Bump Package Version

on:
workflow_dispatch:
branches:
- main
inputs:
bump:
required: true
Expand All @@ -20,12 +18,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Node setup
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- name: Prepare checkout token
id: generate_token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
with:
app_id: ${{ secrets.TEMPORAL_CICD_APP_ID }}
private_key: ${{ secrets.TEMPORAL_CICD_PRIVATE_KEY }}

- name: Configure Git
run: |
git config --local user.name 'Temporal Data (cicd)'
Expand All @@ -37,8 +42,8 @@ jobs:
version=`git describe --abbrev=0 --tags`
branch="releases/$version"
git checkout -b $branch
git remote set-url origin "https://x-access-token:${{ secrets.COMMANDER_DATA_TOKEN }}@github.com/${{ github.repository }}"
git remote set-url origin "https://x-access-token:${{ steps.generate_token.outputs.token }}@github.com/${{ github.repository }}"
git push origin $branch
gh pr create -B main -H $branch --title "bump version in package.json to $version" --body "release version $version"
env:
GH_TOKEN: ${{ secrets.COMMANDER_DATA_TOKEN }}
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
28 changes: 28 additions & 0 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 'Chromatic'

on:
push:
branches: [main]
pull_request:
branches: [main, 'codefreeze-*']

jobs:
chromatic:
name: Run Chromatic
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout and Setup Node
uses: ./.github/actions/checkout-and-setup
- name: Run Chromatic
uses: chromaui/action@latest
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
autoAcceptChanges: 'main'
exitZeroOnChanges: true
exitOnceUploaded: true
onlyChanged: true
skip: 'dependabot/**'
6 changes: 3 additions & 3 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Checkout and Setup Node
uses: ./.github/actions/checkout-and-setup
- name: Lint
run: pnpm run --if-present lint:ci
check-types:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Checkout and Setup Node
uses: ./.github/actions/checkout-and-setup
- name: Check Types
run: pnpm run check
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Checkout and Setup Node
uses: ./.github/actions/checkout-and-setup
- name: Run Unit Tests
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Checkout and Setup Node
uses: ./.github/actions/checkout-and-setup
- name: Install Playwright Browsers
Expand All @@ -39,7 +39,7 @@ jobs:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- name: Checkout and Setup Node
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
if: startsWith(github.head_ref, 'releases/') && github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Checkout and Setup Node
uses: ./.github/actions/checkout-and-setup
- name: Build package
Expand All @@ -24,6 +24,13 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prepare checkout token
id: generate_token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
with:
app_id: ${{ secrets.TEMPORAL_CICD_APP_ID }}
private_key: ${{ secrets.TEMPORAL_CICD_PRIVATE_KEY }}

- name: Create Release
run: |
version=`cat ./package.json | jq -r .version`
Expand All @@ -32,4 +39,4 @@ jobs:
echo "creating release: $tag"
gh release create $tag --generate-notes
env:
GH_TOKEN: ${{ secrets.COMMANDER_DATA_TOKEN }}
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
17 changes: 17 additions & 0 deletions .github/workflows/storybook-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Storybook Tests
on: deployment_status
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
if: github.event.deployment_status.state == 'success'
steps:
- uses: actions/checkout@v4
- name: Checkout and Setup Node
uses: ./.github/actions/checkout-and-setup
- name: Install Playwright
run: pnpm exec playwright install --with-deps
- name: Run Storybook tests
run: pnpm stories:test
env:
TARGET_URL: '${{ github.event.deployment_status.target_url }}'
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- name: Checkout and setup Node
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/update-ui-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,35 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- name: Checkout and Setup Node
uses: ./.github/actions/checkout-and-setup

- uses: actions/setup-go@v3
- name: Prepare checkout token
id: generate_token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
with:
go-version-file: server/go.mod
cache: true
cache-dependency-path: server/go.sum
app_id: ${{ secrets.TEMPORAL_CICD_APP_ID }}
private_key: ${{ secrets.TEMPORAL_CICD_PRIVATE_KEY }}

- uses: actions/setup-go@v4
with:
go-version: '1.23'
- name: Setup Protoc
uses: arduino/setup-protoc@v1
with:
version: '3.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout UI Server
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: temporalio/ui-server
path: ui-server
ref: main
token: ${{ secrets.COMMANDER_DATA_TOKEN }}
token: ${{ steps.generate_token.outputs.token }}

- name: Build UI
run: pnpm build:server
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ server/ui/assets
/playwright/.cache/
/dist
/audits
go.work
go.work.sum
3 changes: 0 additions & 3 deletions .storybook/dark-mode.css

This file was deleted.

5 changes: 4 additions & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import type { StorybookConfig } from '@storybook/sveltekit';

const config: StorybookConfig = {
stories: ['../src/lib/holocene/**/*.stories.@(ts|svelte)'],
stories: ['../src/**/*.stories.@(ts|svelte)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'@storybook/addon-svelte-csf',
'@storybook/addon-a11y',
'@storybook/addon-themes',
'@chromatic-com/storybook',
],
framework: '@storybook/sveltekit',
};
Expand Down
49 changes: 29 additions & 20 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,46 @@
import type { Preview } from '@storybook/svelte';

import { withThemeByDataAttribute } from '@storybook/addon-themes';

import '../src/app.css';
import './dark-mode.css';

import DarkMode, { useDarkMode } from '../src/lib/utilities/dark-mode';
import i18next from 'i18next';

import { i18nNamespaces } from '../src/lib/i18n';
import resources from '../src/lib/i18n/locales';

i18next.init({
fallbackLng: 'en',
load: 'languageOnly',
ns: i18nNamespaces,
defaultNS: 'common',
detection: {
order: ['querystring', 'localStorage', 'navigator'],
caches: ['localStorage'],
lookupQuerystring: 'lng',
lookupLocalStorage: 'locale',
},
resources,
});

const preview: Preview = {
decorators: [
(_, { globals }) => {
useDarkMode.set(globals.theme === 'dark');
return { Component: DarkMode };
},
withThemeByDataAttribute({
defaultTheme: 'light',
themes: {
light: 'light',
dark: 'dark',
},
attributeName: 'data-theme',
}),
],
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
backgrounds: {
disable: true,
},
controls: {
exclude: /^id|name|class|data-\w+|on\w+/,
matchers: {
color: /(background|color)$/i,
date: /Date$/,
Expand All @@ -26,18 +49,4 @@ const preview: Preview = {
},
};

export const globalTypes = {
theme: {
name: 'Toggle Theme',
description: 'Global theme for components',
defaultValue: 'light',
toolbar: {
icon: 'circlehollow',
items: ['light', 'dark'],
showName: true,
dynamicTitle: true,
},
},
};

export default preview;
23 changes: 23 additions & 0 deletions .storybook/test-runner.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import type { TestRunnerConfig } from '@storybook/test-runner';
import { getStoryContext } from '@storybook/test-runner';
import { injectAxe, checkA11y } from 'axe-playwright';

const config: TestRunnerConfig = {
async preVisit(page) {
await injectAxe(page);
},
async postVisit(page, context) {
const storyContext = await getStoryContext(page, context);
if (storyContext.parameters?.a11y?.disable) {
return;
}
await checkA11y(page, '#storybook-root', {
detailedReport: true,
detailedReportOptions: {
html: true,
},
});
},
};

export default config;
6 changes: 6 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
]
}
],
"function-no-unknown": [
true,
{
"ignoreFunctions": ["theme"]
}
],
"custom-property-pattern": null,
"declaration-block-no-redundant-longhand-properties": [
true,
Expand Down
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
"tailwindCSS.experimental.classRegex": [
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
]
],
"files.associations": {
"*.css": "tailwindcss"
}
}
Loading

0 comments on commit afaa5c3

Please sign in to comment.