Skip to content

Commit

Permalink
Merge pull request #100 from uber/modern
Browse files Browse the repository at this point in the history
Modernize the tooling
  • Loading branch information
tajo authored Nov 28, 2023
2 parents 1b507f5 + 4237e53 commit 67495f9
Show file tree
Hide file tree
Showing 79 changed files with 9,229 additions and 14,445 deletions.
34 changes: 0 additions & 34 deletions .eslintrc.js

This file was deleted.

21 changes: 21 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"react/prop-types": "off",
"react/react-in-jsx-scope": "off"
},
"settings": {
"react": {
"version": "detect"
}
}
}
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Learn how to add code owners here:
# https://help.github.com/en/articles/about-code-owners
* @chasestarr @tajo @sandgraham
* @chasestarr @tajo
62 changes: 62 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: CI

on:
push:
branches: ["main"]
pull_request:
types: [opened, synchronize]

jobs:
build:
name: Build and Test
runs-on: ${{ matrix.os }}
timeout-minutes: 15
env:
CI: true
strategy:
matrix:
os: [ubuntu-latest]
node-version: [18.x, 20.x]
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 2

- uses: pnpm/[email protected]
with:
version: 8.7.1

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Install playwright
run: pnpm exec playwright install --with-deps

- name: Eslint
run: pnpm lint

- name: Typescript
run: pnpm typecheck

- name: Build
run: pnpm build

- name: Unit tests
run: pnpm test

- name: E2e tests
run: pnpm test:e2e

- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ node_modules
.vscode
.idea
dist
build
compiled
.awcache
.rpt2_cache
docs
storybook-static
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm exec lint-staged
4 changes: 4 additions & 0 deletions .ladle/config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import('@ladle/react').UserConfig} */
export default {
stories: "examples/**/*.stories.{js,jsx,ts,tsx,mdx}",
};
7 changes: 7 additions & 0 deletions .ladle/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script>
window.global = window;
window.process = { cwd: () => '', browser: true };
window.assert = () => {};
window.assert.ok = () => {};
window.Buffer = { isBuffer: () => {}, [Symbol.hasInstance]: () => {} };
</script>
31 changes: 31 additions & 0 deletions .ladle/vite-plugin-node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* eslint-env node */

import { builtinModules } from "node:module";
import nodeLibsBrowser from "node-libs-browser";

function NodeBuiltinsPolyfillPlugin() {
return {
name: "vite:node-builtins-polyfill",
config() {
const aliasEntries = [];
for (let moduleName of builtinModules) {
const polyfillPath = nodeLibsBrowser[moduleName];
if (polyfillPath) {
aliasEntries.push({
// eslint-disable-next-line
find: new RegExp(`^${moduleName}\/?$`), // handle "string_decoder/" import
replacement: polyfillPath,
});
}
}

return {
resolve: {
alias: aliasEntries,
},
};
},
};
}

export default NodeBuiltinsPolyfillPlugin;
7 changes: 7 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"*.{js,ts,tsx,css,scss,postcss,md,json}": [
"prettier --write --plugin-search-dir=.",
"prettier --check --plugin-search-dir=."
],
"*.{js,ts,tsx}": "eslint"
}
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pnpm-lock.yaml
pnpm-workspace.yaml
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": true,
"singleQuote": false,
"trailingComma": "all"
}
6 changes: 0 additions & 6 deletions .prettierrc.js

This file was deleted.

21 changes: 0 additions & 21 deletions .storybook/config.js

This file was deleted.

4 changes: 0 additions & 4 deletions .storybook/webpack.config.js

This file was deleted.

15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Uber Technologies, Inc.
Copyright (c) Uber Technologies, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 0 additions & 6 deletions LICENSE-HEAD

This file was deleted.

Loading

0 comments on commit 67495f9

Please sign in to comment.