From c7f2645d3fbaf7fc3c33d88ccb1b462c00652e0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chalifour?= Date: Thu, 9 Jul 2020 10:54:38 +0200 Subject: [PATCH 01/20] feat(docsearch): introduce DocSearch.js v3 (#56) --- babel.config.js | 27 +++++++++++++++++++++++++++ package.json | 36 ++++++++++++++++++++++++++++++++++++ rollup.config.js | 24 ++++++++++++++++++++++++ src/docsearch.tsx | 21 +++++++++++++++++++++ src/index.ts | 1 + tsconfig.declaration.json | 8 ++++++++ tsconfig.json | 3 +++ 7 files changed, 120 insertions(+) create mode 100644 babel.config.js create mode 100644 package.json create mode 100644 rollup.config.js create mode 100644 src/docsearch.tsx create mode 100644 src/index.ts create mode 100644 tsconfig.declaration.json create mode 100644 tsconfig.json diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 00000000..ec916c22 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,27 @@ +/* eslint-disable import/no-commonjs */ + +module.exports = (api) => { + const isTest = api.env('test'); + const modules = isTest ? 'commonjs' : false; + const targets = {}; + + if (isTest) { + targets.node = true; + } else { + targets.browsers = ['last 2 versions', 'ie >= 11']; + } + + return { + presets: [ + '@babel/preset-typescript', + [ + '@babel/preset-env', + { + modules, + targets, + }, + ], + ], + plugins: [['@babel/plugin-transform-react-jsx']], + }; +}; diff --git a/package.json b/package.json new file mode 100644 index 00000000..f562bbd8 --- /dev/null +++ b/package.json @@ -0,0 +1,36 @@ +{ + "name": "@docsearch/js", + "version": "1.0.0-alpha.21", + "license": "MIT", + "homepage": "https://github.com/algolia/autocomplete.js", + "repository": "algolia/autocomplete.js", + "author": { + "name": "Algolia, Inc.", + "url": "https://www.algolia.com" + }, + "sideEffects": false, + "files": [ + "dist/" + ], + "source": "src/index.ts", + "types": "dist/esm/index.d.ts", + "module": "dist/esm/index.js", + "main": "dist/umd/index.js", + "umd:main": "dist/umd/index.js", + "unpkg": "dist/umd/index.js", + "jsdelivr": "dist/umd/index.js", + "scripts": { + "build": "yarn build:clean && yarn build:umd && yarn build:esm", + "build:esm": "babel src --root-mode upward --extensions '.ts,.tsx' --out-dir dist/esm", + "build:esm:watch": "yarn build:esm --watch", + "build:umd": "rollup --config", + "build:types": "tsc -p ./tsconfig.declaration.json --outDir ./dist/esm", + "build:types:watch": "chokidar \"**/*.ts\" \"**/*.tsx\" --command \"yarn build:types\" --ignore \"dist\"", + "build:clean": "rm -rf ./dist", + "watch": "concurrently \"yarn build:esm:watch\" \"yarn build:types:watch\"" + }, + "dependencies": { + "@docsearch/react": "^1.0.0-alpha.21", + "preact": "^10.0.0" + } +} diff --git a/rollup.config.js b/rollup.config.js new file mode 100644 index 00000000..e36fda13 --- /dev/null +++ b/rollup.config.js @@ -0,0 +1,24 @@ +import json from '@rollup/plugin-json'; +import alias from '@rollup/plugin-alias'; + +import { sharedPlugins } from '../autocomplete-core/rollup.config'; + +export default { + input: 'src/index.ts', + output: { + file: 'dist/umd/index.js', + format: 'umd', + sourcemap: true, + name: 'docsearch', + }, + plugins: [ + json(), + alias({ + entries: [ + { find: 'react', replacement: 'preact/compat' }, + { find: 'react-dom', replacement: 'preact/compat' }, + ], + }), + ...sharedPlugins, + ], +}; diff --git a/src/docsearch.tsx b/src/docsearch.tsx new file mode 100644 index 00000000..7d36a846 --- /dev/null +++ b/src/docsearch.tsx @@ -0,0 +1,21 @@ +import React, { render } from 'preact/compat'; + +import { DocSearch } from '@docsearch/react'; + +function getHTMLElement( + value: string | HTMLElement, + environment: typeof window = window +): HTMLElement { + if (typeof value === 'string') { + return environment.document.querySelector(value)!; + } + + return value; +} + +export function docsearch(props) { + render( + , + getHTMLElement(props.container, props.environment) + ); +} diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 00000000..4f419249 --- /dev/null +++ b/src/index.ts @@ -0,0 +1 @@ +export { docsearch as default } from './docsearch'; diff --git a/tsconfig.declaration.json b/tsconfig.declaration.json new file mode 100644 index 00000000..9bd7baf2 --- /dev/null +++ b/tsconfig.declaration.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "noEmit": false, + "declaration": true, + "emitDeclarationOnly": true + } +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..41716a7d --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig" +} From f9398c45a50501b0cf7f16c0f3b7fb92f7d55b15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chalifour?= Date: Thu, 9 Jul 2020 11:11:10 +0200 Subject: [PATCH 02/20] feat(docsearch): attach `docsearch.js` user agent to vanilla renderer --- src/docsearch.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/docsearch.tsx b/src/docsearch.tsx index 7d36a846..24225d3a 100644 --- a/src/docsearch.tsx +++ b/src/docsearch.tsx @@ -1,6 +1,6 @@ import React, { render } from 'preact/compat'; -import { DocSearch } from '@docsearch/react'; +import { DocSearch, version } from '@docsearch/react'; function getHTMLElement( value: string | HTMLElement, @@ -15,7 +15,16 @@ function getHTMLElement( export function docsearch(props) { render( - , + { + searchClient.addAlgoliaAgent(`docsearch.js (${version})`); + + return props.transformSearchClient + ? props.transformSearchClient(searchClient) + : searchClient; + }} + />, getHTMLElement(props.container, props.environment) ); } From 715bc4f92592521b0096308dfa54d56b34186c37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chalifour?= Date: Thu, 9 Jul 2020 12:04:12 +0200 Subject: [PATCH 03/20] feat(docsearch): track `docsearch-react` UA --- src/docsearch.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docsearch.tsx b/src/docsearch.tsx index 24225d3a..902dc44c 100644 --- a/src/docsearch.tsx +++ b/src/docsearch.tsx @@ -18,7 +18,7 @@ export function docsearch(props) { { - searchClient.addAlgoliaAgent(`docsearch.js (${version})`); + searchClient.addAlgoliaAgent('docsearch.js', version); return props.transformSearchClient ? props.transformSearchClient(searchClient) From ba323140dcfa3fac6a493e47ac2566d8f5fc5665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chalifour?= Date: Thu, 9 Jul 2020 17:19:33 +0200 Subject: [PATCH 04/20] chore: release v1.0.0-alpha.22 (#57) --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index f562bbd8..8ed2891f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@docsearch/js", - "version": "1.0.0-alpha.21", + "version": "1.0.0-alpha.22", "license": "MIT", "homepage": "https://github.com/algolia/autocomplete.js", "repository": "algolia/autocomplete.js", @@ -30,7 +30,7 @@ "watch": "concurrently \"yarn build:esm:watch\" \"yarn build:types:watch\"" }, "dependencies": { - "@docsearch/react": "^1.0.0-alpha.21", + "@docsearch/react": "^1.0.0-alpha.22", "preact": "^10.0.0" } } From 4acf723becb8be4708cd5edd2b9ee675ff6d19c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chalifour?= Date: Tue, 21 Jul 2020 10:29:47 +0200 Subject: [PATCH 05/20] fix(docsearch): use Preact alias in Babel config --- babel.config.js | 14 +++++++++++++- rollup.config.js | 12 +----------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/babel.config.js b/babel.config.js index ec916c22..a614d94d 100644 --- a/babel.config.js +++ b/babel.config.js @@ -22,6 +22,18 @@ module.exports = (api) => { }, ], ], - plugins: [['@babel/plugin-transform-react-jsx']], + plugins: [ + ['@babel/plugin-transform-react-jsx'], + [ + 'module-resolver', + { + root: ['./src'], + alias: { + react: 'preact/compat', + 'react-dom': 'preact/compat', + }, + }, + ], + ], }; }; diff --git a/rollup.config.js b/rollup.config.js index e36fda13..05d3f3c9 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,5 +1,4 @@ import json from '@rollup/plugin-json'; -import alias from '@rollup/plugin-alias'; import { sharedPlugins } from '../autocomplete-core/rollup.config'; @@ -11,14 +10,5 @@ export default { sourcemap: true, name: 'docsearch', }, - plugins: [ - json(), - alias({ - entries: [ - { find: 'react', replacement: 'preact/compat' }, - { find: 'react-dom', replacement: 'preact/compat' }, - ], - }), - ...sharedPlugins, - ], + plugins: [json(), ...sharedPlugins], }; From d8da20026c725344c40622ca73b1ab0330538e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chalifour?= Date: Tue, 21 Jul 2020 10:42:58 +0200 Subject: [PATCH 06/20] chore(build): update shared Rollup config --- rollup.config.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 05d3f3c9..8ddcbc16 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,6 +1,4 @@ -import json from '@rollup/plugin-json'; - -import { sharedPlugins } from '../autocomplete-core/rollup.config'; +import { plugins } from '../../rollup.base.config'; export default { input: 'src/index.ts', @@ -10,5 +8,5 @@ export default { sourcemap: true, name: 'docsearch', }, - plugins: [json(), ...sharedPlugins], + plugins, }; From 481f2bc85f9d43c3a7efabe2ed0d2831e2b2c760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chalifour?= Date: Tue, 21 Jul 2020 11:01:02 +0200 Subject: [PATCH 07/20] chore(lint): sort imports --- src/docsearch.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/docsearch.tsx b/src/docsearch.tsx index 902dc44c..feecb84d 100644 --- a/src/docsearch.tsx +++ b/src/docsearch.tsx @@ -1,6 +1,5 @@ -import React, { render } from 'preact/compat'; - import { DocSearch, version } from '@docsearch/react'; +import React, { render } from 'preact/compat'; function getHTMLElement( value: string | HTMLElement, From f0c7f90c468fbadc0329d302f78a8c3db850f58d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chalifour?= Date: Wed, 22 Jul 2020 11:09:44 +0200 Subject: [PATCH 08/20] chore: release v1.0.0-alpha.23 (#58) --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 8ed2891f..b482d3df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@docsearch/js", - "version": "1.0.0-alpha.22", + "version": "1.0.0-alpha.23", "license": "MIT", "homepage": "https://github.com/algolia/autocomplete.js", "repository": "algolia/autocomplete.js", @@ -30,7 +30,7 @@ "watch": "concurrently \"yarn build:esm:watch\" \"yarn build:types:watch\"" }, "dependencies": { - "@docsearch/react": "^1.0.0-alpha.22", + "@docsearch/react": "^1.0.0-alpha.23", "preact": "^10.0.0" } } From 46faa98b341127c7c872fc55e104d68702054a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chalifour?= Date: Wed, 22 Jul 2020 17:32:50 +0200 Subject: [PATCH 09/20] chore: fix watch scripts --- package.json | 13 ++++++------- rollup.config.js | 19 ++++++++++++++++--- src/docsearch.tsx | 6 +++--- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index b482d3df..a17a24aa 100644 --- a/package.json +++ b/package.json @@ -20,14 +20,13 @@ "unpkg": "dist/umd/index.js", "jsdelivr": "dist/umd/index.js", "scripts": { - "build": "yarn build:clean && yarn build:umd && yarn build:esm", - "build:esm": "babel src --root-mode upward --extensions '.ts,.tsx' --out-dir dist/esm", - "build:esm:watch": "yarn build:esm --watch", - "build:umd": "rollup --config", - "build:types": "tsc -p ./tsconfig.declaration.json --outDir ./dist/esm", - "build:types:watch": "chokidar \"**/*.ts\" \"**/*.tsx\" --command \"yarn build:types\" --ignore \"dist\"", + "build": "yarn build:clean && yarn build:umd && yarn build:esm && yarn build:types", + "build:umd": "BUILD=umd rollup --config", + "build:esm": "BUILD=esm rollup --config", + "build:types": "tsc -p ./tsconfig.declaration.json --outFile ./dist/esm/index.d.ts", "build:clean": "rm -rf ./dist", - "watch": "concurrently \"yarn build:esm:watch\" \"yarn build:types:watch\"" + "on:change": "concurrently \"yarn build:esm\" \"yarn build:types\"", + "watch": "watch \"yarn on:change\" --ignoreDirectoryPattern \"/dist/\"" }, "dependencies": { "@docsearch/react": "^1.0.0-alpha.23", diff --git a/rollup.config.js b/rollup.config.js index 8ddcbc16..c0fd93d4 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,12 +1,25 @@ import { plugins } from '../../rollup.base.config'; -export default { - input: 'src/index.ts', - output: { +if (!process.env.BUILD) { + throw new Error('The `BUILD` environment variable is required to build.'); +} + +const output = { + umd: { file: 'dist/umd/index.js', format: 'umd', sourcemap: true, name: 'docsearch', }, + esm: { + file: 'dist/esm/index.js', + format: 'es', + sourcemap: true, + }, +}; + +export default { + input: 'src/index.ts', + output: output[process.env.BUILD], plugins, }; diff --git a/src/docsearch.tsx b/src/docsearch.tsx index feecb84d..24f97ea0 100644 --- a/src/docsearch.tsx +++ b/src/docsearch.tsx @@ -1,9 +1,9 @@ -import { DocSearch, version } from '@docsearch/react'; +import { DocSearch, DocSearchProps, version } from '@docsearch/react'; import React, { render } from 'preact/compat'; function getHTMLElement( value: string | HTMLElement, - environment: typeof window = window + environment: DocSearchProps['environment'] = window ): HTMLElement { if (typeof value === 'string') { return environment.document.querySelector(value)!; @@ -12,7 +12,7 @@ function getHTMLElement( return value; } -export function docsearch(props) { +export function docsearch(props: DocSearchProps) { render( Date: Thu, 23 Jul 2020 11:12:11 +0200 Subject: [PATCH 10/20] chore: release v1.0.0-alpha.24 (#60) --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a17a24aa..d91bfc0a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@docsearch/js", - "version": "1.0.0-alpha.23", + "version": "1.0.0-alpha.24", "license": "MIT", "homepage": "https://github.com/algolia/autocomplete.js", "repository": "algolia/autocomplete.js", @@ -29,7 +29,7 @@ "watch": "watch \"yarn on:change\" --ignoreDirectoryPattern \"/dist/\"" }, "dependencies": { - "@docsearch/react": "^1.0.0-alpha.23", + "@docsearch/react": "^1.0.0-alpha.24", "preact": "^10.0.0" } } From 5dc7ed288d0a8d3ae02c55a91b9bf3b1898444c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chalifour?= Date: Thu, 30 Jul 2020 13:34:00 +0200 Subject: [PATCH 11/20] chore: release v1.0.0-alpha.25 (#62) --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d91bfc0a..24d982bf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@docsearch/js", - "version": "1.0.0-alpha.24", + "version": "1.0.0-alpha.25", "license": "MIT", "homepage": "https://github.com/algolia/autocomplete.js", "repository": "algolia/autocomplete.js", @@ -29,7 +29,7 @@ "watch": "watch \"yarn on:change\" --ignoreDirectoryPattern \"/dist/\"" }, "dependencies": { - "@docsearch/react": "^1.0.0-alpha.24", + "@docsearch/react": "^1.0.0-alpha.25", "preact": "^10.0.0" } } From 2025a1b9a41473559239c68c3caeb1e54bb3f289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chalifour?= Date: Tue, 4 Aug 2020 10:09:09 +0200 Subject: [PATCH 12/20] chore: release v1.0.0-alpha.26 (#64) --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 24d982bf..eb0ffe23 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@docsearch/js", - "version": "1.0.0-alpha.25", + "version": "1.0.0-alpha.26", "license": "MIT", "homepage": "https://github.com/algolia/autocomplete.js", "repository": "algolia/autocomplete.js", @@ -29,7 +29,7 @@ "watch": "watch \"yarn on:change\" --ignoreDirectoryPattern \"/dist/\"" }, "dependencies": { - "@docsearch/react": "^1.0.0-alpha.25", + "@docsearch/react": "^1.0.0-alpha.26", "preact": "^10.0.0" } } From 5ccaead2d209dbd2a538b497786c2d5b11fa3f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chalifour?= Date: Fri, 7 Aug 2020 11:37:20 +0200 Subject: [PATCH 13/20] fix(docsearch): fix vanilla DocSearch types --- src/docsearch.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/docsearch.tsx b/src/docsearch.tsx index 24f97ea0..f0c0baa4 100644 --- a/src/docsearch.tsx +++ b/src/docsearch.tsx @@ -1,4 +1,8 @@ -import { DocSearch, DocSearchProps, version } from '@docsearch/react'; +import { + DocSearch, + DocSearchProps as DocSearchComponentProps, + version, +} from '@docsearch/react'; import React, { render } from 'preact/compat'; function getHTMLElement( @@ -12,6 +16,11 @@ function getHTMLElement( return value; } +interface DocSearchProps extends DocSearchComponentProps { + container: string | HTMLElement; + environment?: typeof window; +} + export function docsearch(props: DocSearchProps) { render( Date: Fri, 7 Aug 2020 11:50:16 +0200 Subject: [PATCH 14/20] chore: release v1.0.0-alpha.27 (#67) --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index eb0ffe23..5cb7a0d0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@docsearch/js", - "version": "1.0.0-alpha.26", + "version": "1.0.0-alpha.27", "license": "MIT", "homepage": "https://github.com/algolia/autocomplete.js", "repository": "algolia/autocomplete.js", @@ -29,7 +29,7 @@ "watch": "watch \"yarn on:change\" --ignoreDirectoryPattern \"/dist/\"" }, "dependencies": { - "@docsearch/react": "^1.0.0-alpha.26", + "@docsearch/react": "^1.0.0-alpha.27", "preact": "^10.0.0" } } From 8076889f826a5f4d53acdd6d8e38161b8562fafc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chalifour?= Date: Tue, 25 Aug 2020 14:18:30 +0200 Subject: [PATCH 15/20] docs: update repository documentation Closes #68 Closes #69 --- README.md | 15 +++++++++++++++ package.json | 5 +++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..363a6bb7 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# @docsearch/js + +JavaScript package for [DocSearch](http://docsearch.algolia.com/), the best search experience for docs. + +## Installation + +```sh +yarn add @docsearch/js@alpha +# or +npm install @docsearch/js@alpha +``` + +## Documentation + +[Read documentation →](https://autocomplete-experimental.netlify.app/docs/DocSearch) diff --git a/package.json b/package.json index 5cb7a0d0..98dabdaa 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,10 @@ { "name": "@docsearch/js", + "description": "JavaScript package for DocSearch, the best search experience for docs.", "version": "1.0.0-alpha.27", "license": "MIT", - "homepage": "https://github.com/algolia/autocomplete.js", - "repository": "algolia/autocomplete.js", + "homepage": "https://github.com/francoischalifour/autocomplete.js", + "repository": "francoischalifour/autocomplete.js", "author": { "name": "Algolia, Inc.", "url": "https://www.algolia.com" From 214b9eb9824773b1da9e4487bb68a68d482b3123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chalifour?= Date: Tue, 25 Aug 2020 15:32:35 +0200 Subject: [PATCH 16/20] docs: document all packages --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 363a6bb7..b52602bb 100644 --- a/README.md +++ b/README.md @@ -12,4 +12,4 @@ npm install @docsearch/js@alpha ## Documentation -[Read documentation →](https://autocomplete-experimental.netlify.app/docs/DocSearch) +[Read documentation →](https://autocomplete-experimental.netlify.app/docs/docsearch-js) From c2e5513c79dea522f473d94a37b412f806cd3fe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chalifour?= Date: Wed, 26 Aug 2020 10:18:05 +0200 Subject: [PATCH 17/20] chore(build): add banner to all builds --- rollup.config.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rollup.config.js b/rollup.config.js index c0fd93d4..93b1575d 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,4 +1,10 @@ import { plugins } from '../../rollup.base.config'; +import { checkIsReleaseReady } from '../scripts/checkIsReleaseReady'; +import { getBundleBanner } from '../scripts/getBundleBanner'; + +import pkg from './package.json'; + +checkIsReleaseReady(); if (!process.env.BUILD) { throw new Error('The `BUILD` environment variable is required to build.'); @@ -10,11 +16,13 @@ const output = { format: 'umd', sourcemap: true, name: 'docsearch', + banner: getBundleBanner(pkg), }, esm: { file: 'dist/esm/index.js', format: 'es', sourcemap: true, + banner: getBundleBanner(pkg), }, }; From 5bf91dd077c98633237b53ef0f6aab7aafdfe62d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chalifour?= Date: Wed, 26 Aug 2020 12:01:30 +0200 Subject: [PATCH 18/20] chore(css): add banners to DocSearch CSS bundles --- rollup.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 93b1575d..e180ac32 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,6 +1,6 @@ import { plugins } from '../../rollup.base.config'; -import { checkIsReleaseReady } from '../scripts/checkIsReleaseReady'; -import { getBundleBanner } from '../scripts/getBundleBanner'; +import { checkIsReleaseReady } from '../../scripts/checkIsReleaseReady'; +import { getBundleBanner } from '../../scripts/getBundleBanner'; import pkg from './package.json'; From b91fed2be44b23166288fb0886fbd5755614f861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chalifour?= Date: Wed, 26 Aug 2020 15:13:18 +0200 Subject: [PATCH 19/20] chore: release v1.0.0-alpha.28 (#76) --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 98dabdaa..4419da8f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@docsearch/js", "description": "JavaScript package for DocSearch, the best search experience for docs.", - "version": "1.0.0-alpha.27", + "version": "1.0.0-alpha.28", "license": "MIT", "homepage": "https://github.com/francoischalifour/autocomplete.js", "repository": "francoischalifour/autocomplete.js", @@ -30,7 +30,7 @@ "watch": "watch \"yarn on:change\" --ignoreDirectoryPattern \"/dist/\"" }, "dependencies": { - "@docsearch/react": "^1.0.0-alpha.27", + "@docsearch/react": "^1.0.0-alpha.28", "preact": "^10.0.0" } } From 0e90150e9c6f79d5f0deb8bef242fe60baa06cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chalifour?= Date: Wed, 26 Aug 2020 15:40:59 +0200 Subject: [PATCH 20/20] chore(release): don't check for NODE_ENV to set banner --- rollup.config.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index e180ac32..14b8a11d 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,11 +1,8 @@ import { plugins } from '../../rollup.base.config'; -import { checkIsReleaseReady } from '../../scripts/checkIsReleaseReady'; import { getBundleBanner } from '../../scripts/getBundleBanner'; import pkg from './package.json'; -checkIsReleaseReady(); - if (!process.env.BUILD) { throw new Error('The `BUILD` environment variable is required to build.'); }