Skip to content

Commit b7868d2

Browse files
authored
Merge pull request #3574 from JedWatson/v3.0.0
v3.0.0
2 parents 6fa3591 + 0b3caff commit b7868d2

File tree

171 files changed

+4847
-2454
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+4847
-2454
lines changed

.babelrc

Lines changed: 0 additions & 9 deletions
This file was deleted.

.changeset/5877155c/changes.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"releases": [{ "name": "react-select", "type": "major" }],
3+
"dependents": [
4+
{
5+
"name": "@react-select/docs",
6+
"type": "patch",
7+
"dependencies": ["react-select"]
8+
}
9+
]
10+
}

.changeset/5877155c/changes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- Upgrade emotion dependency from 9.x to 10.x [#3321](https://github.com/JedWatson/react-select/pull/3321)
2+
- Normalize Values [#3416](https://github.com/JedWatson/react-select/pull/3416)
3+
- Separate entrypoints for Async, Creatable and makeAnimated [#3541](https://github.com/JedWatson/react-select/pull/3541)
4+
- UMD builds deprecated
5+
- required react peer-dependecy of 16.8

.changeset/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@atlaskit/build-releases`, a build tool that works with `bolt` to help you release components from a mono-repository. You can find the full documentation for it [here](https://www.npmjs.com/package/@atlaskit/build-releases)
4+
5+
To help you get started though, here are some things you should know about this folder:
6+
7+
## Changesets are automatically generated
8+
9+
Changesets are generated by the `build-releases changeset` command, though it may have been given a new name within your repository. As long as you are following a changeset release flow, you shouldn't have any problems.
10+
11+
## Each changeset is its own folder
12+
13+
We use hashes by default for these folder names to avoid collisions when generating them, but there's no harm that will come from renaming them.
14+
15+
## Changesets are automatically removed
16+
17+
When `build-releases version` or equivalent command is run, all the changeset folders are removed. This is so we only ever use a changeset once. This makes this a very bad place to store any other information.
18+
19+
## Changesets come in two parts
20+
21+
You should treat these parts quite differently:
22+
23+
- `changes.md` is a file you should feel free to edit as much as you want. It will be prepended to your changelog when you next run your version command.
24+
- `changes.json` is a file that includes information about releases, what should be versioned by the version command. We strongly recommend against editing this directly, as you may make a new changeset that puts your bolt repository into an invalid state.
25+
26+
## I want to edit the information in a `changes.json` - how do I do it safely?
27+
28+
The best option is to make a new changeset using the changeset command, copy over the `changes.md`, then delete the old changeset.
29+
30+
## Can I rename the folder for my changeset?
31+
32+
Absolutely! We need unique hashes to make changesets play nicely with git, but changing your folder from our hash to your own name isn't going to cause any problems.
33+
34+
## Can I manually delete changesets?
35+
36+
You can, but you should be aware this will remove the intent to release communicated by the changeset, and should be done with caution.

.changeset/config.js

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
'use strict';
2+
require('dotenv').config();
3+
/*
4+
Hey, welcome to the changeset config! This file has been generated
5+
for you with the default configs we use, and some comments around
6+
what options mean, so that it's easy to customise your workflow.
7+
8+
You should update this as you need to craft your workflow.
9+
10+
Config provided by a CI command takes precedence over the contents of this file.
11+
12+
If a config option isn't present here, we will fall back to the defaults.
13+
*/
14+
15+
const changesetOptions = {
16+
// If true, we will automatically commit the changeset when the command is run
17+
commit: false,
18+
};
19+
20+
// This function takes information about a changeset to generate an entry for it in your
21+
// changelog. We provide the full changeset object as well as the version.
22+
// It may be a good idea to replace the commit hash with a link to the commit.
23+
24+
/* the default shape is:
25+
- [patch] ABCDEFG:
26+
27+
A summary message you wrote, indented
28+
*/
29+
30+
function makeQuery(commitShas) {
31+
return `
32+
query {
33+
${commitShas
34+
.map(
35+
(commitSha, i) =>
36+
`a${i}: search(
37+
type: ISSUE
38+
query: "sha:${commitSha}+repo:JedWatson/react-select"
39+
first: 1
40+
) {
41+
edges {
42+
node {
43+
... on PullRequest {
44+
number
45+
author {
46+
login
47+
}
48+
}
49+
}
50+
}
51+
}`
52+
)
53+
.join('\n')}}
54+
`;
55+
}
56+
57+
const fetch = require('node-fetch');
58+
const DataLoader = require('dataloader');
59+
60+
const GHDataLoader = new DataLoader(async commitShas => {
61+
if (!process.env.GITHUB_TOKEN) {
62+
throw new Error(
63+
'Please create a GitHub personal access token at https://github.com/settings/tokens/new and add it to a .env file in the root of the repository'
64+
);
65+
}
66+
let data = await fetch(
67+
`https://api.github.com/graphql?access_token=${process.env.GITHUB_TOKEN}`,
68+
{
69+
method: 'POST',
70+
body: JSON.stringify({ query: makeQuery(commitShas) }),
71+
}
72+
).then(x => x.json());
73+
74+
// this is mainly for the case where there's an authentication problem
75+
if (!data.data) {
76+
throw new Error(
77+
'An error occurred when fetching data from GitHub\n' +
78+
JSON.stringify(data)
79+
);
80+
}
81+
return Object.values(data.data).map(({ edges }) => {
82+
if (
83+
edges[0] &&
84+
edges[0].node &&
85+
typeof edges[0].node.number === 'number' &&
86+
edges[0].node.author &&
87+
typeof edges[0].node.author.login === 'string'
88+
) {
89+
return {
90+
username: edges[0].node.author.login,
91+
number: edges[0].node.number,
92+
};
93+
}
94+
return null;
95+
});
96+
});
97+
98+
function getLinkedCommit(commitSha) {
99+
return `[${commitSha}](https://github.com/JedWatson/react-select/commit/${commitSha})`;
100+
}
101+
102+
const getReleaseLine = async (changeset, versionType) => {
103+
const indentedSummary = changeset.summary
104+
.split('\n')
105+
.map(l => ` ${l}`.trimRight())
106+
.join('\n');
107+
let data = await GHDataLoader.load(changeset.commit);
108+
if (data !== null) {
109+
let { number, username } = data;
110+
return `- [${versionType}] ${getLinkedCommit(
111+
changeset.commit
112+
)} [#${number}](https://github.com/JedWatson/react-select/pulls/${number}) Thanks [@${username}](https://github.com/${username}):\n\n${indentedSummary}`;
113+
}
114+
return `- [${versionType}] ${getLinkedCommit(
115+
changeset.commit
116+
)}:\n\n${indentedSummary}`;
117+
};
118+
119+
// This function takes information about what dependencies we are updating in the package.
120+
// It provides an array of related changesets, as well as the dependencies updated.
121+
122+
/*
123+
- Updated dependencies: [ABCDEFG]:
124+
- Updated dependencies: [HIJKLMN]:
125+
126+
127+
*/
128+
const getDependencyReleaseLine = async (changesets, dependenciesUpdated) => {
129+
if (dependenciesUpdated.length === 0) return '';
130+
131+
const changesetLinks = changesets.map(
132+
changeset =>
133+
`- Updated dependencies [${getLinkedCommit(changeset.commit)}]:`
134+
);
135+
136+
const updatedDepenenciesList = dependenciesUpdated.map(
137+
dependency => ` - ${dependency.name}@${dependency.version}`
138+
);
139+
140+
return [...changesetLinks, ...updatedDepenenciesList].join('\n');
141+
};
142+
143+
const versionOptions = {
144+
// If true, we will automatically commit the version updating when the command is run
145+
commit: false,
146+
// Adds a skipCI flag to the commit - only valid if `commit` is also true.
147+
skipCI: false,
148+
// Do not modify the `changelog.md` files for packages that are updated
149+
noChangelog: false,
150+
// A function that returns a string. It takes in options about a change. This allows you to customise your changelog entries
151+
getReleaseLine,
152+
// A function that returns a string. It takes in options about when a pacakge is updated because
153+
getDependencyReleaseLine,
154+
};
155+
156+
const publishOptions = {
157+
// This sets whether unpublished packages are public by default. We err on the side of caution here.
158+
public: true,
159+
};
160+
161+
module.exports = {
162+
versionOptions,
163+
changesetOptions,
164+
publishOptions,
165+
};

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ dist/*
55
flow-typed/*
66
lib/*
77
node_modules/*
8+
**/node_modules/*

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module.exports = {
1414
argsIgnorePattern: '^event$',
1515
ignoreRestSiblings: true,
1616
vars: 'all',
17+
varsIgnorePattern: 'jsx|emotionJSX'
1718
},
1819
],
1920
curly: [2, 'multi-line'],

.flowconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[ignore]
2-
./lib/.*
3-
./dist/.*
42
.*/node_modules/cypress/.*
3+
4+
[untyped]
55
.*/node_modules/@atlaskit/tooltip/dist/cjs/components/Marshal.js.flow
66
.*/node_modules/@atlaskit/layer-manager/dist/cjs/components/FocusLock/index.js.flow
77
.*/node_modules/@atlaskit/layer-manager/dist/cjs/components/gateway/components/Gateway.js.flow

HISTORY.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
# React-Select
2+
3+
## v3.0.0 / ????
4+
### Breaking
5+
* Upgrade emotion dependency from 9.x to 10.x [#3321](https://github.com/JedWatson/react-select/pull/3321)
6+
* Normalize Values [#]
7+
* Separate entrypoints for Async, Creatable and makeAnimated [#3541](https://github.com/JedWatson/react-select/pull/3541)
8+
* Animated components exports now removed, these can be retrieved from a call to makeAnimated();
9+
* UMD builds deprecated
10+
* required react peer-dependecy of 16.8
11+
212
## v2.4.4 / 2019-05-27
313
### BugFixes
414
* [#3540] Fixed active styles previously being applied to disabled options. Thanks [@risenforces](https://github.com/risenforces)

babel.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
plugins: ['emotion', '@babel/plugin-proposal-class-properties'],
3+
presets: ['@babel/preset-env', '@babel/preset-react', '@babel/preset-flow'],
4+
};

0 commit comments

Comments
 (0)