Skip to content

Commit

Permalink
Fix postInstall script (#1577)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #1577

D32366885 (97cb978) added a `postInstall` script for building the temporary patched package we use for `gen-flow-files`.  However, this was added as a production install script when the `devDependencies` are not available.  It should only be used at build time so move to `postbuild.js` script.

Reviewed By: butlersrepos

Differential Revision: D33871387

fbshipit-source-id: e9be7c3d14ad7d74883e90bbe15db257f4973d9d
  • Loading branch information
drarmstr authored and facebook-github-bot committed Jan 31, 2022
1 parent 708fcfe commit 1dad138
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

**_Add new changes here as they land_**

## 0.6 ()
## 0.6.1 (2022-01-29)

- Fix postInstall script (#1577)

## 0.6 (2022-01-28)

- React 18
- Leverage new React 18 APIs for improved safety and optimizations. (#1488)
Expand All @@ -28,11 +32,10 @@
- Fix transitive selector refresh for some cases (#1409)
- Fix some corner cases with async selectors and multiple stores (#1568)
- Atom Effects
- Run atom effects when atoms are initialized from a set during a transaction from `useRecoilTransaction_UNSTABLE()` (#1466)
- Run atom effects when atoms are initialized from a set during a transaction from `useRecoilTransaction_UNSTABLE()` (#1466, #1569)
- Atom effects are cleaned up when initialized by a Snapshot which is released. (#1511, #1532)
- Unsubscribe `onSet()` handlers in atom effects when atoms are cleaned up. (#1509)
- Call `onSet()` when atoms are initialized with `<RecoilRoot initializeState={...} >` (#1519, #1511)
- Set `trigger` to `'set'` when initialized from a set in a Recoil transaction. (#1569)
- Avoid extra re-renders in some cases when a component uses a different atom/selector. (#825)
- `<RecoilRoot>` will only call `initializeState()` once during the initial render. (#1372)
- Lazily compute the properties of `useGetRecoilValueInfo_UNSTABLE()` and `Snapshot#getInfo_UNSTABLE()` results (#1549)
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "recoil",
"version": "0.6.0",
"version": "0.6.1",
"description": "Recoil - A state management library for React",
"main": "cjs/recoil.js",
"module": "es/recoil.js",
Expand All @@ -17,7 +17,6 @@
"license": "MIT",
"scripts": {
"prepare": "install-peers",
"postinstall": "cd ./node_modules/gen-flow-files && yarn install && yarn build",
"build": "rollup -c && node scripts/postbuild.js",
"test": "jest packages/*",
"format": "prettier --write \"./**/*.{js,md,json}\"",
Expand Down
11 changes: 7 additions & 4 deletions scripts/postbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ console.log('Copying index.d.ts for TypeScript support...');
fs.copyFile('./typescript/index.d.ts', './index.d.ts', logErrors);

console.log('Generating Flow type files...');
exec('npx gen-flow-files packages/recoil --out-dir cjs', err => {
logErrors(err);
fs.rename('cjs/Recoil_index.js.flow', 'cjs/recoil.js.flow', logErrors);
});
exec(
'cd ./node_modules/gen-flow-files && yarn install && yarn build && cd ../.. && npx gen-flow-files packages/recoil --out-dir cjs',
err => {
logErrors(err);
fs.rename('cjs/Recoil_index.js.flow', 'cjs/recoil.js.flow', logErrors);
},
);

0 comments on commit 1dad138

Please sign in to comment.