Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infra: Switch monorepo tooling to wireit and pnpm #2345

Merged
merged 145 commits into from
Jul 22, 2022
Merged
Show file tree
Hide file tree
Changes from 141 commits
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
6743889
Add basic pnpm.
ryan-roemer Jun 30, 2022
d071e0f
Temp add back workspaces
ryan-roemer Jun 30, 2022
ce12479
Replace lots of yarn
ryan-roemer Jun 30, 2022
76fd83b
Come up with new victory-vendor solution
ryan-roemer Jun 30, 2022
1e183e4
Now, really fix victory-vendor
ryan-roemer Jun 30, 2022
e8de6d5
Ignore docs artifacts
ryan-roemer Jun 30, 2022
dea3097
Fix to relative import
ryan-roemer Jun 30, 2022
1cf9409
More lint fixes
ryan-roemer Jun 30, 2022
f384713
Prettier
ryan-roemer Jun 30, 2022
97f0132
Fix missing dependency
ryan-roemer Jun 30, 2022
25f3eac
Add missing dependency
ryan-roemer Jul 1, 2022
38d8bea
Start working on scripts
ryan-roemer Jul 1, 2022
5ebae8e
Update lockfile
ryan-roemer Jul 1, 2022
16a20a8
Start adding build stuff
ryan-roemer Jul 1, 2022
99d53bc
Add helper script
ryan-roemer Jul 1, 2022
af3aad2
WIP: start wireit configs everywhere
ryan-roemer Jul 1, 2022
79b7561
WIP: More pkg changes
ryan-roemer Jul 1, 2022
c043de8
More notes for script
ryan-roemer Jul 1, 2022
a96cffd
Everything is fixed for build
ryan-roemer Jul 1, 2022
ddb7294
More script tweaks.
ryan-roemer Jul 1, 2022
ffef826
More work on lint
ryan-roemer Jul 1, 2022
e184906
Get lint of root going
ryan-roemer Jul 1, 2022
a30d812
Fix lint
ryan-roemer Jul 1, 2022
9581a51
Add sync packages to scripts and fix lint one
ryan-roemer Jul 1, 2022
6f21822
Add format
ryan-roemer Jul 2, 2022
ae59d60
Hook up check:ci
ryan-roemer Jul 2, 2022
8212093
Add missing vendor depency in victory-core.
ryan-roemer Jul 2, 2022
c0c4dea
better sync
ryan-roemer Jul 2, 2022
8fe3bf0
Add notes and jest
ryan-roemer Jul 2, 2022
5e9fe94
Add jest to check:ci
ryan-roemer Jul 2, 2022
4615a04
More notes
ryan-roemer Jul 2, 2022
3796617
Add jest:native
ryan-roemer Jul 2, 2022
0f629b2
Add jest:root
ryan-roemer Jul 2, 2022
d1c739a
Add missing dep
ryan-roemer Jul 2, 2022
3666ac9
Other useful notes
ryan-roemer Jul 2, 2022
067b1d7
Start abstracting
ryan-roemer Jul 3, 2022
81ce93c
WIP: Move up sideEffects. Abstract script
ryan-roemer Jul 3, 2022
3dfe620
More abstraction
ryan-roemer Jul 3, 2022
91375ab
Add devDeps to jest task gen
ryan-roemer Jul 3, 2022
51f7dc0
Fix formatting
ryan-roemer Jul 3, 2022
957264c
Add missing devDeps
ryan-roemer Jul 3, 2022
3919e88
More missing devDeps
ryan-roemer Jul 3, 2022
18054e4
Add sync:pkgs check
ryan-roemer Jul 3, 2022
0f66dba
More nuanced deps, add subtasks to native/vendor, fix missing deps.
ryan-roemer Jul 4, 2022
9ca9c05
More missing deps
ryan-roemer Jul 4, 2022
b535a68
Hack/fix jest deps
ryan-roemer Jul 4, 2022
bf26737
format
ryan-roemer Jul 4, 2022
e0b8786
Missing test deps
ryan-roemer Jul 4, 2022
27b4705
chore(build): added 'clean' script
Jul 4, 2022
163a982
chore(build): simplified `rimraf` script
Jul 4, 2022
c7a45d4
chore(build): removed `victory-` dependencies from our root package
Jul 4, 2022
d3ac05f
chore(build): added TypeScript build scripts
Jul 4, 2022
e54a985
chore(build): added wireit config for `victory-core`; added self-refe…
Jul 4, 2022
d6966c4
chore(build): added types:check to sync-pkgs
Jul 5, 2022
cda1b07
chore(build): sync'd all packages
Jul 5, 2022
2efe5f6
chore(build): skip files that haven't changed
Jul 5, 2022
48bac6c
chore(build): restored root dependencies
Jul 5, 2022
b61d3ed
chore(build): restored "core" to pkg sync
Jul 5, 2022
c8df9dc
chore(build): ensure we generate types for devDependencies
Jul 5, 2022
3d0653b
chore(build): updated some internal devDependencies to `*`
Jul 5, 2022
4a66cd6
chore(build): fixed some type errors
Jul 5, 2022
30a63b1
chore(build): include jest-dom types
Jul 5, 2022
2f413ae
chore(build): added `sync:tsconfig` script
Jul 5, 2022
6c95a50
chore(build): added dummy "types:check" scripts
Jul 5, 2022
7c8c87b
chore(build): updated typecheck outputs
Jul 5, 2022
3e7ead9
chore(build): Ensure tsc is pretty
Jul 5, 2022
296bbed
chore(build): ignore TS build errors
Jul 5, 2022
d1a807a
chore(build): added `types:create:pkgs` script
Jul 5, 2022
3f88916
chore(build): added `types:create` dependency chains
Jul 5, 2022
d86a06d
chore(build): include `victory` in crossDeps
Jul 6, 2022
508d31f
chore(build): simplified the TypeScript compile: copy output from es …
Jul 6, 2022
be6174c
chore(build): sync'd packages
Jul 6, 2022
c01ee04
chore(build): added `types:create:pkgs` script
Jul 6, 2022
8385f05
chore(build): added `sync` script
Jul 6, 2022
441ff03
chore(build): allow self-referencing dependencies
Jul 6, 2022
fee05a6
chore(build): added jest-dom types
Jul 6, 2022
8a7ac05
chore(build): allow self-referencing dependencies
Jul 6, 2022
8a4bc60
chore(build): added jest-dom types
Jul 6, 2022
cee9e43
chore(build): fixed test
Jul 6, 2022
d31fee1
chore(build): fixed wireit config for types:check
Jul 6, 2022
56f0094
chore(build): reduce eslint warnings
Jul 6, 2022
c96becf
chore(build): update lock
Jul 6, 2022
53a3f5a
chore(build): check for sync'd tsconfig in CI
Jul 6, 2022
fe45e18
Various minor fixes and add CI
ryan-roemer Jul 6, 2022
5217a9e
chore(build): ensure `lint` has access to dependency types
Jul 7, 2022
6827924
chore(build): temporarily enable branch checks
Jul 7, 2022
6987037
chore(build): removed `--verbose` from `sync:tsconfig`
Jul 7, 2022
deeb487
chore(build): simplified `check:ci` script
Jul 7, 2022
16e94eb
chore(build): ignore missing-types error
Jul 7, 2022
0c7623d
chore(build): added `check:debug` script for testing
Jul 7, 2022
9631a3b
chore(build): added simple types for `victory-voronoi/helper-methods`
Jul 7, 2022
f5d710c
chore(build): ensure `lint` has access to dependency types
Jul 7, 2022
3f70089
chore(build): eliminate extra 'lint' dependencies
Jul 7, 2022
1d37012
chore(build): made param optional, based on usage
Jul 7, 2022
3bb4290
chore(build): include all "root devDeps" for all builds
Jul 7, 2022
21fa5b1
chore(build): updated internal deps to "*"
Jul 7, 2022
dffb70b
Merge pull request #2349 from FormidableLabs/infra/pnpm-wireit-typesc…
scottrippey Jul 7, 2022
5e6ae28
chore(build): generate wireit config from scratch
Jul 7, 2022
f76d9ff
chore(build): added "THESE SCRIPTS ARE GENERATED" warnings
Jul 7, 2022
86299fd
chore(build): manually updated victory-native wireit config
Jul 8, 2022
651e96b
chore(build): build both cjs and esm for `victory-native`
Jul 8, 2022
f269f3b
chore(build): prettier-ignore the scripts folder
Jul 8, 2022
c0d76fc
chore(build): run CI checks against all `infra/**` branches
Jul 8, 2022
be4c759
chore(build): isolated the prettier-ignore section
Jul 8, 2022
2af5126
chore(build): added missing devDependency on `victory-bar`
Jul 8, 2022
b786f64
chore(build): updated lockfile
Jul 8, 2022
1c58df6
Merge pull request #2354 from FormidableLabs/infra/pnpm-wireit--generate
scottrippey Jul 11, 2022
b7ee26f
Update script comments and remove unused field
ryan-roemer Jul 14, 2022
5aa867e
chore(build): use `glob` to resolve stories
Jul 15, 2022
8a7b2f7
Fix storybook with aliases
ryan-roemer Jul 16, 2022
04da1da
Add deps for storybook
ryan-roemer Jul 16, 2022
7ac67a6
Better task format for storybook
ryan-roemer Jul 16, 2022
9098ee5
Update chromatic CI
ryan-roemer Jul 16, 2022
ee4857f
Clean up storybook main
ryan-roemer Jul 16, 2022
efc3e85
Add more files to storybook build
ryan-roemer Jul 16, 2022
b12528d
Fix lint files
ryan-roemer Jul 16, 2022
1a572d1
Fix files for storybook:build
ryan-roemer Jul 16, 2022
44b6a94
Refactor build name
ryan-roemer Jul 16, 2022
54abddf
Add start, start:ts
ryan-roemer Jul 16, 2022
3bdae50
Rename and notes
ryan-roemer Jul 17, 2022
6499ad8
Add notes
ryan-roemer Jul 17, 2022
27e76d6
More notes
ryan-roemer Jul 17, 2022
3bd0a01
More notes
ryan-roemer Jul 17, 2022
ebaeabc
Remove build from check task
ryan-roemer Jul 17, 2022
92589d6
Switch to watch and concurrently for start
ryan-roemer Jul 18, 2022
176f038
Prettier fix and script
ryan-roemer Jul 18, 2022
9ad2f2a
Merge upstream
ryan-roemer Jul 18, 2022
9c6eeec
Various clean up and root task organization.
ryan-roemer Jul 18, 2022
ff1cace
Minor docs
ryan-roemer Jul 18, 2022
41cdf44
Add lint:fix support
ryan-roemer Jul 18, 2022
f665666
Add helper notes for pkg tasks, abstract lint + fix
ryan-roemer Jul 18, 2022
5f7659c
Add format fixing
ryan-roemer Jul 18, 2022
ca5fe88
Various cleanup
ryan-roemer Jul 18, 2022
3d8ed6f
Remove lerna
ryan-roemer Jul 19, 2022
1078562
Refactor and normalize test setup
ryan-roemer Jul 19, 2022
56dc9e4
Format fix
ryan-roemer Jul 19, 2022
246aac7
Add packageLocks to wireit configs
ryan-roemer Jul 19, 2022
6b4ed9b
Add watch section
ryan-roemer Jul 19, 2022
493ec34
More watch comments
ryan-roemer Jul 19, 2022
135aa94
Various notes cleanup
ryan-roemer Jul 20, 2022
72b474f
Finish off chromatic tasks.
ryan-roemer Jul 20, 2022
5ba8da7
Do concurrently in raw mode
ryan-roemer Jul 21, 2022
e554726
Patch rn-demo
gksander Jul 22, 2022
a6a2c5b
Exclude node_modules where it might creep in and add parallel notes.
ryan-roemer Jul 22, 2022
794b5be
Clean up todos
ryan-roemer Jul 22, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ artifacts
tmp
ryan-roemer marked this conversation as resolved.
Show resolved Hide resolved
demo/rn
**/*.d.ts
.wireit
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ module.exports = {
},
],
"no-invalid-this": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-invalid-this": ["error"],

"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
Expand Down
42 changes: 23 additions & 19 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,42 @@ jobs:
with:
fetch-depth: 0

- uses: actions/setup-node@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
# TODO: Upgrade Node version.
# Node18 currently hits `Error: error:0308010C:digital envelope routines::unsupported`
# https://github.com/storybookjs/storybook/issues/16555
# When we upgrade to webpack5 this should go away.
node-version: 16.x

- name: Get Yarn Cache Directory Path
id: cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
# Wireit cache
- uses: google/wireit@setup-github-actions-caching/v1

- name: Use Yarn Cache
uses: actions/cache@v2
id: cache
- uses: pnpm/action-setup@v2.2.2
with:
path: ${{ steps.cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
version: 7

- name: Set Yarn to Ignore Engines
run: yarn config set ignore-engines true
- name: Get pnpm store directory
id: pnpm-cache
run: echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"

- name: Installation
run: yarn --prefer-offline --frozen-lockfile --non-interactive
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Build Package Libs
run: yarn nps build-package-libs
- name: Install dependencies
run: pnpm install

- name: Build Storybook
run: yarn build-storybook
run: pnpm run storybook:build

- name: Publish to Chromatic
uses: chromaui/action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}

- name: Remove Yarn Config to Ignore Engines
run: yarn config delete ignore-engines
48 changes: 29 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,41 @@ jobs:
node-version: [14.x, 16.x, 18.x]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Get Yarn Cache Directory Path
id: cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
# Wireit cache
- uses: google/wireit@setup-github-actions-caching/v1

- name: Use Yarn Cache
uses: actions/cache@v2
id: cache
- uses: pnpm/action-setup@v2.2.2
with:
path: ${{ steps.cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('./yarn.lock') }}

- name: Set Yarn to Ignore Engines
run: yarn config set ignore-engines true
version: 7

- name: Installation ${{ matrix.node-version }}
run: yarn --prefer-offline --frozen-lockfile --non-interactive
- name: Get pnpm store directory
id: pnpm-cache
run: echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"

- name: Check Code ${{ matrix.node-version }}
uses: GabrielBB/xvfb-action@v1
- name: Setup pnpm cache
uses: actions/cache@v3
with:
run: yarn nps check.ci
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install

- name: Remove Yarn Config to Ignore Engines
run: yarn config delete ignore-engines
- name: Check all package.json's and tsconfig.json's are in sync.
run: |
pnpm sync
git diff --no-ext-diff --quiet --exit-code

- name: Build libraries and distributions ${{ matrix.node-version }}
run: pnpm build

- name: Check Code ${{ matrix.node-version }}
run: pnpm check:ci
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ dist
lib
es
node_modules
.pnpm-debug.log*
npm-debug.log*
lerna-debug.log*
yarn-error.log*
Expand All @@ -46,6 +47,10 @@ build-storybook.log*
artifacts
tmp

# Wireit + caches
.wireit
.eslintcache

# Ignore all yarn2+
.yarn/*
.yarnrc*
Expand Down
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# TODO(dependencies): Remove this and properly deal with all peerDeps
# https://github.com/FormidableLabs/victory/issues/2236
strict-peer-dependencies=false
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ lib-vendor
es
packages/victory-vendor/d3-*
node_modules
.pnpm-debug.log*
npm-debug.log*
lerna-debug.log*
yarn-error.log*
Expand All @@ -15,4 +16,6 @@ tsconfig.json
tsconfig.*.json
storybook-static
public
artifacts
.expo
.wireit
23 changes: 20 additions & 3 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,36 @@
var path = require("path");
/* globals __dirname:false */
const path = require("path");
const glob = require("glob");
const ROOT = path.resolve(__dirname, "..");
const PKGS = path.resolve(ROOT, "packages");
const STORIES = path.resolve(ROOT, "stories");

module.exports = {
webpackFinal: async (config) => {
// Read all the victory packages and alias.
glob.sync(path.join(PKGS, "victory*/package.json"))
.forEach((pkgPath) => {
const key = path.dirname(path.relative(PKGS, pkgPath));
config.resolve.alias[key] = path.resolve(path.dirname(pkgPath));
});

return config;
},
addons: [
"@storybook/addon-options/register",
{
name: "@storybook/addon-storysource",
options: {
rule: {
test: [/\.stories\.(jsx?|tsx?)$/],
include: [path.resolve(__dirname, "../stories")],
include: [STORIES],
},
loaderOptions: {
prettierConfig: { printWidth: 80, singleQuote: false },
},
},
},
],
stories: ["../**/*.stories.(js|jsx|ts|tsx)"],
// Use glob to locate the stories, because it ignores our circular dependencies.
stories: glob.sync("../**/*.stories.@(js|jsx|ts|tsx)", { cwd: __dirname }),
};
Loading