Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
Co-Authored-By: heswell <[email protected]>
  • Loading branch information
joshwooding and heswell committed Mar 7, 2022
0 parents commit 5c464d7
Show file tree
Hide file tree
Showing 1,269 changed files with 114,568 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
10 changes: 10 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"linked": [],
"access": "restricted",
"baseBranch": "playground",
"updateInternalDependencies": "patch",
"ignore": []
}
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# https://editorconfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 80
trim_trailing_whitespace = true

[*.{md,mdx}]
max_line_length = 0
trim_trailing_whitespace = false

[COMMIT_EDITMSG]
max_line_length = 0

[*.css]
# We don't want css variables to wrap to break Chrome dev tool
max_line_length = 200
26 changes: 26 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/packages/*/build
/packages/*/dist-cjs/
/packages/*/dist-es/
/packages/*/dist-types/

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
Empty file added .git-blame-ignore-revs
Empty file.
23 changes: 23 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "Build"
on: push

jobs:
build-core:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "14"
cache: "yarn"
- name: Install dependencies
run: yarn
- run: yarn run build
- name: Check Core bundle size
run: node ./scripts/bundleSize.js ./dist/brandname-core
shell: bash
# - name: Check Lab bundle size
# run: node ./scripts/bundleSize.js ./dist/brandname-lab
# shell: bash
12 changes: 12 additions & 0 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: "Performance"
on: push
jobs:
lighthouse:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Audit URLs using Lighthouse
uses: treosh/lighthouse-ci-action@v7
with:
urls: "https://ui-toolkit.pages.dev/"
uploadArtifacts: true # save results as an action artifacts
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release

on:
push:
branches:
- release

permissions:
contents: write
pull-requests: write

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "14"
cache: "yarn"
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build
- name: Create Release Pull Request
id: changesets
uses: changesets/action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69 changes: 69 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: "Test"
on: push

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "14"
cache: "yarn"
- name: Install dependencies
run: yarn
# Enable lint when all errors are fixed
# - run: yarn run lint
- run: yarn run prettier:ci
unit-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "14"
cache: "yarn"
- name: Install dependencies
run: yarn
- run: yarn run test --watchAll=false
cypress-run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "14"
cache: "yarn"
- name: Install dependencies
run: yarn
- name: Build packages
run: yarn run build
- name: Cypress Core Components
uses: cypress-io/github-action@v2
with:
install: false
command: yarn run test:core-components
- name: Cypress Lab Components
uses: cypress-io/github-action@v2
with:
install: false
command: yarn run test:lab-components
type-checks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "14"
cache: "yarn"
- name: Install dependencies
run: yarn
- run: yarn run typecheck
48 changes: 48 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Identify the release and plugin bundles as binary content.
# This way Git won't bother showing massive diffs when each time you subsequently add or update them
/.yarn/releases/** binary
/.yarn/plugins/** binary

# testing
/coverage
.nyc_output

# production
/packages/*/build
/packages/*/dist-cjs/
/packages/*/dist-es/
/packages/*/dist-types/

dist
storybook-static

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
.eslintcache

npm-debug.log*
yarn-debug.log*
yarn-error.log*

# IDEs
.idea/*
!.idea/runConfigurations
.vscode/launch.json
/.VSCodeCounter
*.iml
12 changes: 12 additions & 0 deletions .idea/runConfigurations/_template__of_JavaScriptTestRunnerJest.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 65 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import type { StorybookConfig } from "@storybook/react/types";
import type { UserConfig } from "vite";
import { mergeConfig } from "vite";
import PkgConfig from "vite-plugin-package-config";
import OptimizationPersist from "vite-plugin-optimize-persist";
import { cssVariableDocgen } from "css-variable-docgen-plugin";

type ViteFinalOptions = {
configType: "DEVELOPMENT" | "PRODUCTION";
};

interface ExtendedConfig extends Omit<StorybookConfig, "core"> {
core?: StorybookConfig["core"] | "storybook-builder-vite";
viteFinal?: (
config: UserConfig,
options: ViteFinalOptions
) => Promise<UserConfig>;
}

const config: ExtendedConfig = {
framework: "@storybook/react",
stories: ["../packages/*/stories/**/*.stories.@(js|jsx|ts|tsx|mdx)"],
staticDirs: ["../docs/public"],
addons: [
"@storybook/addon-links",
{
name: "@storybook/addon-essentials",
options: {
// We don't want the backgrounds addon as our own withThemeBackground works with theme switch to apply background
backgrounds: false,
},
},
"./theme-switch/preset", //👈 Custom theme switch on the toolbar
// Keep in mind this is not v1 yet. Might encounter bugs. It's from atlassian labs, so not too much concern.
// Temporarily disable this due to run time error "Cannot read property 'context' of undefined" from Topbar
// 'storybook-addon-performance/register',
],
core: {
builder: "storybook-builder-vite",
},
features: {
postcss: false,
// modernInlineRender: true,
storyStoreV7: true,
buildStoriesJson: true,
// babelModeV7: true,
},
async viteFinal(config) {
// customize the Vite config here

const customConfig: UserConfig = {
plugins: [
PkgConfig({
packageJsonPath: "optimizedDeps.json",
}),
OptimizationPersist(),
cssVariableDocgen(),
],
};

return mergeConfig(customConfig, config);
},
};

module.exports = config;
1 change: 1 addition & 0 deletions .storybook/manager-header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<link rel="shortcut icon" href="/favicon.ico" />
Loading

0 comments on commit 5c464d7

Please sign in to comment.