Skip to content

Commit

Permalink
Merge pull request #5703 from algolia/feat/import-algoliasearch-helper
Browse files Browse the repository at this point in the history
chore(packages): migrate `algoliasearch-helper` to monorepo
  • Loading branch information
dhayab authored Jul 11, 2023
2 parents 9911906 + 021a80f commit 104a55e
Show file tree
Hide file tree
Showing 240 changed files with 41,226 additions and 63 deletions.
28 changes: 28 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ workflows:
branches:
only:
- master
- helper docs:
requires:
- build
filters:
branches:
only:
- master
- e2e tests:
context: fx-libraries
requires:
Expand All @@ -80,6 +87,7 @@ workflows:
- unit tests
- examples
- legacy algoliasearch
- helper docs
- e2e tests
filters:
branches:
Expand Down Expand Up @@ -136,6 +144,7 @@ jobs:
- persist_to_workspace:
root: *workspace_root
paths:
- packages/algoliasearch-helper/dist
- packages/instantsearch.js/es
- packages/instantsearch.js/cjs
- packages/instantsearch.js/dist
Expand Down Expand Up @@ -189,6 +198,9 @@ jobs:
name: Update dependencies
command: |
./scripts/legacy/downgrade-algoliasearch-dependency.js
- run:
name: Unit & Integration tests
command: yarn run test:v3
- run:
name: Type Checking
command: yarn run type-check:v3
Expand Down Expand Up @@ -246,6 +258,22 @@ jobs:
paths:
- website/examples

helper docs:
<<: *defaults
steps:
- checkout
- *attach_workspace
- *install_yarn_version
- *restore_yarn_cache
- *run_yarn_install
- run:
name: Build helper documentation
command: yarn workspace algoliasearch-helper run doc
- persist_to_workspace:
root: *workspace_root
paths:
- website/algoliasearch-helper-js

e2e tests:
<<: *defaults
resource_class: large
Expand Down
55 changes: 54 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ const config = {
},
},
{
files: ['*.js'],
files: ['*.js', '*.d.ts'],
rules: {
'@typescript-eslint/explicit-member-accessibility': 'off',
},
Expand Down Expand Up @@ -390,6 +390,59 @@ const config = {
'packages/react-instantsearch-hooks-router-nextjs/tsconfig.json',
},
},
{
files: ['packages/algoliasearch-helper/**/*.js'],
rules: {
// Helper uses CommonJS for now
'import/no-commonjs': 'off',
strict: 'off',
// Helper uses ES5 for now
'no-var': 'off',
'vars-on-top': 'off',
'object-shorthand': 'off',
'prefer-template': 'off',
'prefer-spread': 'off',
'prefer-rest-params': 'off',
},
},
{
// The only TypeScript files in the Helper package are declaration files and a test file.
files: [
'packages/algoliasearch-helper/**/*.d.ts',
'packages/algoliasearch-helper/test/types.ts',
],
rules: {
// TypeScript declaration file
'no-dupe-class-members': 'off',
'no-new': 'off',
'no-warning-comments': 'off',
'no-shadow': 'off',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/method-signature-style': 'off',
},
},
{
files: ['packages/algoliasearch-helper/documentation-src/**/*.js'],
rules: {
'no-console': 'off',
'valid-jsdoc': 'off',
},
},
{
files: ['packages/algoliasearch-helper/test/**/*.js'],
rules: {
'no-console': 'off',
'jest/no-done-callback': 'off',
'jest/no-conditional-expect': 'off',
},
env: {
jest: true,
},
globals: {
test: true,
beforeAll: true,
},
},
],
};

Expand Down
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Introduced prettier
cc83731fc794a45d05b915e7419c59f25eb812c5
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ build/

# Generated files
/docs
/website/algoliasearch-helper-js/*
/website/examples/*
/website/stories/*
/website/specs/*
Expand Down
12 changes: 10 additions & 2 deletions bundlesize.config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
{
"files": [
{
"path": "packages/algoliasearch-helper/dist/algoliasearch.helper.js",
"maxSize": "38.5 kB"
},
{
"path": "packages/algoliasearch-helper/dist/algoliasearch.helper.min.js",
"maxSize": "12 kB"
},
{
"path": "./packages/instantsearch.js/dist/instantsearch.production.min.js",
"maxSize": "74.50 kB"
Expand All @@ -26,11 +34,11 @@
},
{
"path": "packages/react-instantsearch-hooks/dist/umd/ReactInstantSearchHooks.min.js",
"maxSize": "45.20 kB"
"maxSize": "46.25 kB"
},
{
"path": "packages/react-instantsearch-hooks-web/dist/umd/ReactInstantSearchHooksDOM.min.js",
"maxSize": "55.50 kB"
"maxSize": "56 kB"
},
{
"path": "packages/react-instantsearch-dom/dist/umd/ReactInstantSearchDOM.min.js",
Expand Down
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const config = {
'<rootDir>/packages/*/dist*',
'<rootDir>/tests/e2e/*',
'<rootDir>/examples/',
'<rootDir>/packages/algoliasearch-helper',
'<rootDir>/packages/create-instantsearch-app',
'<rootDir>/packages/react-instantsearch-hooks-router-nextjs',
'/__utils__/',
Expand Down
3 changes: 2 additions & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
command=""" \
yarn build:ci && \
yarn website:storybook && \
yarn website:examples --concurrency=1
yarn website:examples --concurrency=1 && \
yarn workspace algoliasearch-helper doc
"""
publish="website"

Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
"test:e2e": "yarn test:e2e:local",
"test:e2e:local": "wdio scripts/wdio/local.conf.js",
"test:e2e:saucelabs": "wdio scripts/wdio/saucelabs.conf.js",
"test:v3": "lerna run test:v3",
"release": "shipjs prepare",
"prepare": "lerna run prepare",
"prepare": "lerna run prepare && patch-package",
"prepare-vue3": "./scripts/prepare-vue3.js"
},
"devDependencies": {
Expand Down Expand Up @@ -131,6 +132,7 @@
"jscodeshift": "0.7.0",
"jsdom-global": "3.0.2",
"lerna": "6.0.3",
"patch-package": "6.2.2",
"places.js": "1.17.1",
"prettier": "2.4.1",
"prop-types": "15.6.2",
Expand Down
5 changes: 5 additions & 0 deletions packages/algoliasearch-helper/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist/
documentation-src/
documentation/
scripts/rollup.esm.config.js
*.ts
1 change: 1 addition & 0 deletions packages/algoliasearch-helper/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
documentation-src/partials
Loading

0 comments on commit 104a55e

Please sign in to comment.