Skip to content

Commit

Permalink
integrate helper into monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
dhayab committed Jul 10, 2023
1 parent c2c01e2 commit 3602f35
Show file tree
Hide file tree
Showing 39 changed files with 2,704 additions and 10,597 deletions.
43 changes: 43 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 @@ -193,6 +202,24 @@ jobs:
name: Type Checking
command: yarn run type-check:v3

algoliasearch v3:
<<: *defaults
steps:
- checkout
- *attach_workspace
- *install_yarn_version
- *restore_yarn_cache
- *run_yarn_install
- run:
name: Install algoliasearch v3
command: yarn add --dev [email protected] @types/[email protected]
- run:
name: Unit & Integration tests
command: yarn workspace algoliasearch-helper run test --maxWorkers=4
- run:
name: Type checking
command: yarn workspace algoliasearch-helper tsc

vue v3:
<<: *defaults
steps:
Expand Down Expand Up @@ -246,6 +273,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
File renamed without changes.
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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"test:e2e:local": "wdio scripts/wdio/local.conf.js",
"test:e2e:saucelabs": "wdio scripts/wdio/saucelabs.conf.js",
"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 +131,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
99 changes: 0 additions & 99 deletions packages/algoliasearch-helper/.circleci/config.yml

This file was deleted.

7 changes: 0 additions & 7 deletions packages/algoliasearch-helper/.codesandbox/ci.json

This file was deleted.

48 changes: 0 additions & 48 deletions packages/algoliasearch-helper/.eslintrc.js

This file was deleted.

Loading

0 comments on commit 3602f35

Please sign in to comment.