-
Notifications
You must be signed in to change notification settings - Fork 531
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: migrate to a monorepo (#5162)
* move examples * move everything * CI: workspace trial * put places in root to make sure everything builds fine * harmonise babel version between example and root * ci: e2e only requires examples * netlify: redirects * avoids horrible mismatch between algoliasearch versions * codesandbox only build published * order deps the same * codesandbox hardcode package (it publishes private ones otherwise) * RIP shared mocks used inside (es and src types aren't the same) * lower concurrency for examples * fix typo, run in root * correct redirects * ie compatible e2e tests * re-introduce v3 test * correct lockfile * netlify swap order of redirects, prevent infinite redirect * colocate packages * fix jest ignore * update contributing * private testutils * update readme * replicate readme in root * correct doctoc script * localised version update script * independent versioning * order packages * wip * changelog via lerna * clean * wip * wip * ignore changelog * wip * */* * update shipjs to alpha * yes * right prepare * remove wrong stuff * request newest, possibly bug in shipjs * remove non-working diff * fix undefined * lower concurrency * ok this is needed after all * chore: remove unused config file * move all jest together * removing that part again for now, later only we'll actively use it * move to tests * move dependencies * chore: latest released * no concurrency on netlify, it's too much change it overloads
- Loading branch information
Showing
644 changed files
with
5,824 additions
and
13,302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,132 +1,198 @@ | ||
aliases: | ||
- &install_yarn_version | ||
name: Install specific Yarn version | ||
command: | | ||
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.13.0 | ||
echo 'export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"' >> $BASH_ENV | ||
- &restore_yarn_cache | ||
name: Restore Yarn cache | ||
keys: | ||
- yarn-{{ .Branch }}-packages-{{ checksum "yarn.lock" }} | ||
|
||
- &save_yarn_cache | ||
name: Save Yarn cache | ||
key: yarn-{{ .Branch }}-packages-{{ checksum "yarn.lock" }} | ||
paths: | ||
- ~/.cache/yarn | ||
version: 2 | ||
|
||
- &run_yarn_install | ||
name: Install dependencies | ||
command: yarn install | ||
references: | ||
workspace_root: &workspace_root | ||
~/instantsearch | ||
attach_workspace: &attach_workspace | ||
attach_workspace: | ||
at: *workspace_root | ||
install_yarn_version: &install_yarn_version | ||
run: | ||
name: Install specific Yarn version | ||
command: | | ||
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.13.0 | ||
echo 'export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"' >> $BASH_ENV | ||
restore_yarn_cache: &restore_yarn_cache | ||
restore_cache: | ||
name: Restore Yarn cache | ||
keys: | ||
- yarn-packages-{{ checksum "yarn.lock" }} | ||
save_yarn_cache: &save_yarn_cache | ||
save_cache: | ||
name: Save Yarn cache | ||
key: yarn-packages-{{ checksum "yarn.lock" }} | ||
paths: | ||
- ~/.cache/yarn | ||
run_yarn_install: &run_yarn_install | ||
run: | ||
name: Install dependencies | ||
command: yarn install --frozen-lockfile | ||
|
||
defaults: &defaults | ||
working_directory: ~/instantsearchjs | ||
working_directory: ~/instantsearch | ||
docker: | ||
- image: cimg/node:14.17.0 | ||
|
||
version: 2 | ||
workflows: | ||
version: 2 | ||
ci: | ||
jobs: | ||
- build | ||
- lint: | ||
requires: | ||
- build | ||
- unit tests: | ||
requires: | ||
- build | ||
- legacy algoliasearch: | ||
requires: | ||
- build | ||
- examples: | ||
requires: | ||
- build | ||
- e2e tests: | ||
requires: | ||
- examples | ||
- release if needed: | ||
requires: | ||
- build | ||
- lint | ||
- unit tests | ||
- examples | ||
- legacy algoliasearch | ||
- e2e tests | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
scheduled release: | ||
triggers: | ||
- schedule: | ||
cron: '0 9 * * 2' | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
jobs: | ||
- prepare release | ||
|
||
|
||
jobs: | ||
'build and size': | ||
build: | ||
<<: *defaults | ||
steps: | ||
- checkout | ||
- run: *install_yarn_version | ||
- restore_cache: *restore_yarn_cache | ||
- run: *run_yarn_install | ||
- save_cache: *save_yarn_cache | ||
- *attach_workspace | ||
- *install_yarn_version | ||
- *restore_yarn_cache | ||
- *run_yarn_install | ||
- *save_yarn_cache | ||
- run: | ||
name: Build library | ||
command: | | ||
yarn run build:umd | ||
yarn run build:cjs | ||
yarn run build:es | ||
yarn run build --ignore='example-*' | ||
- run: | ||
name: Test packages size | ||
command: yarn run test:size | ||
- run: | ||
name: Type Export | ||
command: yarn run build:types | ||
- run: | ||
name: Test Exports | ||
command: yarn run test:exports | ||
- persist_to_workspace: | ||
root: *workspace_root | ||
paths: | ||
- packages/instantsearch.js/es | ||
- packages/instantsearch.js/cjs | ||
- packages/instantsearch.js/dist | ||
|
||
lint: | ||
<<: *defaults | ||
steps: | ||
- checkout | ||
- run: *install_yarn_version | ||
- restore_cache: *restore_yarn_cache | ||
- run: *run_yarn_install | ||
- save_cache: *save_yarn_cache | ||
- *attach_workspace | ||
- *install_yarn_version | ||
- *restore_yarn_cache | ||
- *run_yarn_install | ||
- run: | ||
name: Lint & Code styles | ||
command: yarn run lint | ||
- run: | ||
name: Type Checking | ||
command: yarn run type-check | ||
|
||
'type check algoliasearch v3': | ||
legacy algoliasearch: | ||
<<: *defaults | ||
steps: | ||
- checkout | ||
- run: *install_yarn_version | ||
- restore_cache: *restore_yarn_cache | ||
- run: *run_yarn_install | ||
- save_cache: *save_yarn_cache | ||
- *attach_workspace | ||
- *install_yarn_version | ||
- *restore_yarn_cache | ||
- *run_yarn_install | ||
- run: | ||
name: Update dependencies | ||
command: | | ||
yarn remove @algolia/client-search | ||
yarn add @types/[email protected] [email protected] | ||
./scripts/legacy/downgrade-algoliasearch-dependency.js | ||
- run: | ||
name: Type Checking | ||
command: yarn run type-check:v3 | ||
|
||
'unit tests': | ||
unit tests: | ||
<<: *defaults | ||
steps: | ||
- checkout | ||
- run: *install_yarn_version | ||
- restore_cache: *restore_yarn_cache | ||
- run: *run_yarn_install | ||
- save_cache: *save_yarn_cache | ||
- *attach_workspace | ||
- *install_yarn_version | ||
- *restore_yarn_cache | ||
- *run_yarn_install | ||
- run: | ||
name: Unit tests | ||
command: yarn run test --maxWorkers=4 | ||
- store_test_results: | ||
path: junit/jest/ | ||
|
||
'e2e tests': | ||
examples: | ||
<<: *defaults | ||
steps: | ||
- checkout | ||
- run: *install_yarn_version | ||
- restore_cache: *restore_yarn_cache | ||
- run: *run_yarn_install | ||
- save_cache: *save_yarn_cache | ||
- *attach_workspace | ||
- *install_yarn_version | ||
- *restore_yarn_cache | ||
- *run_yarn_install | ||
- run: | ||
name: Build example | ||
command: yarn run website:build e-commerce | ||
name: Build examples | ||
command: yarn run website:examples --concurrency=1 | ||
- persist_to_workspace: | ||
root: *workspace_root | ||
paths: | ||
- website/examples | ||
|
||
e2e tests: | ||
<<: *defaults | ||
steps: | ||
- checkout | ||
- *attach_workspace | ||
- *install_yarn_version | ||
- *restore_yarn_cache | ||
- *run_yarn_install | ||
- run: | ||
name: End-2-End tests | ||
command: yarn run test:e2e:saucelabs | ||
- store_test_results: | ||
path: junit/wdio/ | ||
|
||
'release if needed': | ||
release if needed: | ||
<<: *defaults | ||
steps: | ||
- checkout | ||
- run: *install_yarn_version | ||
- restore_cache: *restore_yarn_cache | ||
- run: *run_yarn_install | ||
- save_cache: *save_yarn_cache | ||
- *attach_workspace | ||
- *install_yarn_version | ||
- *restore_yarn_cache | ||
- *run_yarn_install | ||
- run: | ||
name: Trigger a release if the latest commit is a release commit | ||
command: | | ||
yarn shipjs trigger | ||
'prepare release': | ||
prepare release: | ||
<<: *defaults | ||
steps: | ||
- checkout | ||
|
@@ -139,30 +205,4 @@ jobs: | |
command: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "InstantSearch" | ||
yarn run release --yes --no-browse | ||
workflows: | ||
version: 2 | ||
ci: | ||
jobs: | ||
- build and size | ||
- unit tests | ||
- lint | ||
- type check algoliasearch v3 | ||
- e2e tests | ||
- 'release if needed': | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
- next | ||
'scheduled release': | ||
triggers: | ||
- schedule: | ||
cron: '0 9 * * 2' | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
jobs: | ||
- prepare release | ||
yarn run shipjs prepare --yes --no-browse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"sandboxes": ["instantsearchjs-es-template-pcw1k"], | ||
"buildCommand": "build", | ||
"buildCommand": "build --no-private", | ||
"packages": ["packages/instantsearch.js"], | ||
"node": "14" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
/cjs | ||
/es | ||
**/cjs | ||
**/es | ||
**/dist | ||
|
||
/website | ||
dist | ||
.cache | ||
node_modules/ | ||
|
||
# TODO: don't ignore these examples once they're updated | ||
/examples/calendar-widget | ||
/examples/media | ||
/examples/tourism | ||
.cache | ||
.parcel-cache | ||
**/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,29 @@ | ||
node_modules/ | ||
!scripts/docs/ | ||
|
||
.eslintcache | ||
.parcel-cache | ||
|
||
npm-debug.log | ||
yarn-error.log | ||
|
||
.DS_Store | ||
|
||
.env | ||
|
||
# Bundle build files | ||
/dist | ||
/cjs | ||
/es | ||
/packages/instantsearch.js/dist | ||
/packages/instantsearch.js/cjs | ||
/packages/instantsearch.js/es | ||
|
||
# Generated files | ||
/docs | ||
/website/examples | ||
/website/stories | ||
/storybook/dist/* | ||
|
||
# Unneeded changelogs | ||
examples/*/*/CHANGELOG.md | ||
tests/*/CHANGELOG.md | ||
|
||
# Test output | ||
/junit |
Oops, something went wrong.