Skip to content

Commit 4bea07b

Browse files
authoredAug 17, 2021
feat(typescript): expose types at regular build (#4832)
* feat(typescript): expose types at regular build This moves away from -experimental and to stable. Note that, like every type change, this could be a breaking change, as manually defined definitions will now merge with the ones provided by InstantSearch. In almost all cases manual definitions or changes made are no longer needed, if you do however see any problems, please open an issue or pull request with reproduction. * add cjs build again
1 parent d201322 commit 4bea07b

9 files changed

+8
-46
lines changed
 

‎.circleci/config.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ jobs:
3737
- save_cache: *save_yarn_cache
3838
- run:
3939
name: Build library
40-
command: yarn run build
40+
command: |
41+
yarn run build:umd
42+
yarn run build:cjs
43+
yarn run build:es
4144
- run:
4245
name: Test packages size
4346
command: yarn run test:size

‎.eslintignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/cjs
22
/es
3-
/scripts/build/.temp
43
/website
54
dist
65
.cache

‎.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ yarn-error.log
1010
/dist
1111
/cjs
1212
/es
13-
/scripts/build/.temp
1413

1514
# Generated files
1615
/docs

‎package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
"scripts": {
2323
"start": "yarn run dev",
2424
"dev": "yarn run storybook",
25-
"build": "yarn run build:cjs && yarn run build:es && yarn run build:umd",
25+
"build": "yarn run build:cjs && yarn run build:es && yarn run build:umd && yarn run build:types",
2626
"build:umd": "rm -rf dist && BABEL_ENV=umd rollup --config scripts/rollup/config.js",
2727
"build:cjs": "rm -rf cjs && BABEL_ENV=cjs babel src --extensions '.js,.ts,.tsx' --out-dir cjs/ --ignore 'src/index.es.ts','**/__tests__','**/__mocks__' --quiet",
2828
"build:es": "rm -rf es && BABEL_ENV=es babel src --extensions '.js,.ts,.tsx' --out-dir es/ --ignore 'src/index.es.ts','**/__tests__','**/__mocks__' --quiet && BABEL_ENV=es babel src/index.es.ts --out-file es/index.js --quiet",
29-
"build:types": "./scripts/build/types.js",
29+
"build:types": "./scripts/typescript/extract.js",
3030
"doctoc": "doctoc --no-title --maxlevel 3 README.md CONTRIBUTING.md",
3131
"storybook": "start-storybook --quiet --port 6006 --ci --static-dir .storybook/static",
3232
"storybook:build": "build-storybook --quiet --output-dir website/stories --static-dir .storybook/static",

‎scripts/release/build-experimental-typescript.js

-29
This file was deleted.

‎scripts/build/api-extractor.json ‎scripts/typescript/api-extractor.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
33

44
"projectFolder": "../../",
5+
56
"mainEntryPointFilePath": "<projectFolder>/es/index.d.ts",
7+
68
"dtsRollup": {
79
"enabled": false
810
},
@@ -32,10 +34,6 @@
3234
"addToApiReportFile": true
3335
},
3436

35-
"ae-internal-missing-underscore": {
36-
"logLevel": "none"
37-
},
38-
3937
"ae-missing-release-tag": {
4038
"logLevel": "none"
4139
}
File renamed without changes.

‎ship.config.js

-8
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@ module.exports = {
2222
pullRequestTeamReviewers: ['instantsearch-for-websites'],
2323
buildCommand: ({ version }) =>
2424
`NODE_ENV=production VERSION=${version} yarn build`,
25-
afterPublish: ({ exec, version, releaseTag }) => {
26-
if (releaseTag === 'latest' && version.startsWith('4.')) {
27-
exec('./scripts/release/build-experimental-typescript.js');
28-
exec(
29-
`yarn publish --no-git-tag-version --non-interactive --tag experimental-typescript`
30-
);
31-
}
32-
},
3325
slack: {
3426
// disable slack notification for `prepared` lifecycle.
3527
// Ship.js will send slack message only for `releaseSuccess`.

0 commit comments

Comments
 (0)
Please sign in to comment.