Skip to content

Commit

Permalink
Merge branch 'master' into lsp-ts
Browse files Browse the repository at this point in the history
  • Loading branch information
acao committed Oct 3, 2019
2 parents c3ad249 + f6b0e50 commit ea78946
Show file tree
Hide file tree
Showing 18 changed files with 681 additions and 678 deletions.
38 changes: 34 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
packages/graphiql/test/vendor
################################################################################
#
# First things first; we need to ignore our built files. To achive this, we
# have to do a bit of an ignore dance where we ignore everything, and then
# specifically un-ignore the source code, configuration files, etc.
#
# First: ignore FILES (not folders!)
/packages/**/*.js
/packages/**/*.jsx
/packages/**/*.ts
/packages/**/*.tsx
#
# Now un-ignore source code, tests, configuration, etc
!/packages/*/src/**
!/packages/*/test/**
!/packages/codemirror-graphql/resources/**
!/packages/examples/**
!.eslintrc.js
**/node_modules/**
**/flow-typed/**
**/dist/**
!babel.config.js
#
# End of the ignore dance.
#
################################################################################

# Regular eslintignore configuration follows.

# ESLint automatically ignores node_modules _in the root_, so we only need to specify nested node_modules
**/node_modules

# Build artifacts
**/flow-typed
**/dist

# Vendored files
/packages/graphiql/test/vendor
76 changes: 49 additions & 27 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,32 @@ module.exports = {
es6: true,
node: true,
jest: true,
mocha: true
mocha: true,
browser: true,
},

'extends': ['prettier'],
extends: ['prettier'],

globals: {
atom: false,
document: false,
window: false,
Map: true,
Set: true
Set: true,
},

rules: {
// Possible Errors (http://eslint.org/docs/rules/#possible-errors)
'no-cond-assign': 1,
'no-console': 1,
'no-constant-condition': [1, {checkLoops: false}],
'no-constant-condition': [1, { checkLoops: false }],
'no-control-regex': 1,
'no-debugger': 1,
'no-dupe-args': 1,
'no-dupe-keys': 1,
'no-duplicate-case': 1,
'no-empty-character-class': 1,
'no-empty': [1, {allowEmptyCatch: true}],
'no-empty': [1, { allowEmptyCatch: true }],
'no-ex-assign': 1,
'no-extra-boolean-cast': 1,
'no-extra-parens': 0,
Expand All @@ -79,12 +80,12 @@ module.exports = {
'array-callback-return': 0,
'block-scoped-var': 0,
'class-methods-use-this': 0,
'complexity': 0,
complexity: 0,
'consistent-return': 0,
'curly': 1,
curly: 1,
'default-case': 0,
'dot-notation': 1,
'eqeqeq': [1, 'allow-null'],
eqeqeq: [1, 'allow-null'],
'guard-for-in': 0,
'no-alert': 1,
'no-await-in-loop': 1,
Expand Down Expand Up @@ -119,7 +120,7 @@ module.exports = {
'no-octal': 1,
'no-param-reassign': 1,
'no-proto': 1,
'no-redeclare': [1, {builtinGlobals: true}],
'no-redeclare': [1, { builtinGlobals: true }],
'no-restricted-properties': 0,
'no-return-assign': 1,
'no-return-await': 1,
Expand All @@ -138,14 +139,14 @@ module.exports = {
'no-void': 1,
'no-warning-comments': 0,
'no-with': 1,
'radix': 1,
radix: 1,
'require-await': 0,
// 'require-await': 1,
'vars-on-top': 0,
'yoda': 1,
yoda: 1,

// Strict Mode (http://eslint.org/docs/rules/#strict-mode)
'strict': 0,
strict: 0,

// Variables (http://eslint.org/docs/rules/#variables)
'init-declarations': 0,
Expand All @@ -158,7 +159,7 @@ module.exports = {
'no-undef-init': 0,
'no-undef': 1,
'no-undefined': 0,
'no-unused-vars': [1, {args: 'none'}],
'no-unused-vars': [1, { args: 'none' }],
'no-use-before-define': 0,

// Node.js and CommonJS (http://eslint.org/docs/rules/#nodejs-and-commonjs)
Expand All @@ -174,7 +175,7 @@ module.exports = {
'no-sync': 0,

// Stylistic Issues (http://eslint.org/docs/rules/#stylistic-issues)
'camelcase': 0,
camelcase: 0,
'capitalized-comments': 0,
'consistent-this': 0,
'func-name-matching': 0,
Expand All @@ -183,7 +184,7 @@ module.exports = {
'id-blacklist': 0,
'id-length': 0,
'id-match': 0,
'indent': 0,
indent: 0,
'line-comment-position': 0,
'linebreak-style': 1,
'lines-around-comment': 0,
Expand Down Expand Up @@ -222,7 +223,11 @@ module.exports = {
'require-jsdoc': 0,
'sort-keys': 0,
'sort-vars': 0,
'spaced-comment': [1, 'always', {line: {exceptions: ['-']}, block: {balanced: true}}],
'spaced-comment': [
1,
'always',
{ line: { exceptions: ['-'] }, block: { balanced: true } },
],
'wrap-regex': 0,

// ECMAScript 6 (http://eslint.org/docs/rules/#ecmascript-6)
Expand All @@ -240,7 +245,7 @@ module.exports = {
'no-useless-rename': 1,
'no-var': 1,
'object-shorthand': 1,
'prefer-arrow-callback': [1, {allowNamedFunctions: true}],
'prefer-arrow-callback': [1, { allowNamedFunctions: true }],
'prefer-const': 1,
'prefer-numeric-literals': 0,
'prefer-rest-params': 0,
Expand All @@ -255,21 +260,38 @@ module.exports = {
'babel/no-invalid-this': 0,
'babel/object-curly-spacing': 0,

// dependencies (https://github.com/zertosh/eslint-plugin-dependencies)
'dependencies/case-sensitive': 1,
'dependencies/no-cycles': [0, {skip: ['/spec/', '/sample-[^/]+/']}],
'dependencies/no-unresolved': 0,
'dependencies/require-json-ext': 1,
// import (https://github.com/benmosher/eslint-plugin-import)
'import/no-unresolved': 1,
'import/no-cycle': 0,
'import/extensions': [
1,
{
json: 'always',
},
],

// prefer-object-spread (https://github.com/bryanrsmith/eslint-plugin-prefer-object-spread)
'prefer-object-spread/prefer-object-spread': 1,
},

plugins: [
'babel',
'dependencies',
'flowtype',
'prefer-object-spread',
plugins: ['babel', 'import', 'flowtype', 'prefer-object-spread'],

overrides: [
{
// Converted from 'dependencies' options in ancient config
files: ['**/spec/**', '**/sample-*/**'],
rules: {
'import/no-cycle': 0,
},
},
{
// Resources are typically our helper scripts; make life easier there
files: ['resources/*.js', 'packages/*/resources/*.js'],
rules: {
'no-console': 0,
'no-await-in-loop': 0,
},
},
],

overrides: [
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
language: node_js
node_js:
node_js:
- stable
- lts/*
before_install:
- npm config set spin false --global
install:
- yarn --ignore-scripts # ignore prepublish scripts
- yarn --frozen-lockfile --ignore-scripts # ignore prepublish scripts
after_success:
- codecov
cache: yarn
Expand Down
110 changes: 10 additions & 100 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,28 @@
Contributing to GraphiQL
========================
# Contributing

We want to make contributing to this project as easy and transparent as
possible. Hopefully this document makes the process for contributing clear and
answers any questions you may have. If not, feel free to open an
[Issue](https://github.com/facebook/graphql/issues).
[Issue](https://github.com/graphql/graphiql/issues).

## Issues

We use GitHub issues to track public bugs and requests. Please ensure your bug
description is clear and has sufficient instructions to be able to reproduce the
issue. The best way is to provide a reduced test case on jsFiddle or jsBin.

Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe
disclosure of security bugs. In those cases, please go through the process
outlined on that page and do not file a public issue.

## Pull Requests

All active development of GraphiQL happens on GitHub. We actively welcome
All active development of this project happens on GitHub. We actively welcome
your [pull requests](https://help.github.com/articles/creating-a-pull-request).

### Considered Changes

Since GraphiQL is used both internally at Facebook and by a broad group
externally, changes which are of obvious benefit are prioritized and changes
which are specific to only some usage of GraphiQL should first consider if they
may use the existing customization hooks or if they should expose a new
customization hook.

### Contributor License Agreement ("CLA")

In order to accept your pull request, we need you to submit a CLA. You only need
to do this once to work on any of Facebook's open source projects.

Complete your CLA here: <https://code.facebook.com/cla>
Since GraphiQL and related tools are used by a wide range of companies,
individuals and other projects, changes which are of obvious benefit are
prioritized and changes which are specific to only some usage of GraphiQL
should first consider if they may use the existing customization hooks or if
they should expose a new customization hook.

### Getting Started

Expand Down Expand Up @@ -66,87 +54,9 @@ Complete your CLA here: <https://code.facebook.com/cla>

Our commit messages are linted by `commitlint` following the angular changelog convention. You may end up losing a commit message or two if you don't follow this rule. We can add a prompt if people ask for it. This was designed for compatiblity with various git clients.

## Releasing

## Cutting New Releases

We chose a manual process which is pretty simple and flexible because of our conventional commit messages.

If you have NPM privileges, you have the ability to cut new releases of the packages herein.

### Requirements

You'll need:
- `GH_TOKEN` : a github user token as an environment variable
- `git` command line installed, obviously!
- to run `yarn adduser` first to ensure you're authenticated for publishing
- your npm 2FA should be enabled, and you should have your second factor device handy for publish
- your remote should be named `origin` for github, and should be the ssh url
- (coming soon) GPG key uploaded to account for signing

Note: Ideally we can avoid publishing from any branch but `master`, but we can always `--allow-branch mybranch` in case of an emergency for pre-releases. _Whenever you can, always publish from `master`_.

### Prereleases

```sh
yarn version:prerelease graphiql,codemirror-graphql
```

Or

```sh
yarn version:prerelease *
```

for all packages.

It will automatically create and prompt you for each of the pre-release versions that reflect the conventional pattern from the commit log - so some packages may end up pre-alpha, others may be pre-minor, etc.

For example, if you made a change to `graphql-language-service-utils` there would be a new version for every single package. But if you made a change to `graphiql` in the commits since the last publish, there should only be a new pre-release version for `graphiql` when you run this command.

You can also `--amend` a previous release before publishing.

Once this is complete, run `publish:prerelease` to complete this process, so that we can ensure we use pre-release tags. And then you'll of course authenticate again with your 2FA device.


### Graduating Prereleases

Now, after creating and publishing some pre-release versions, if you want to graduate them you can do so with a command that works in very much the same way as above.

```sh
yarn version:graduate *
```

Would graduate all pre-alphas to patch releases, pre-minors to minor releases, etc.

You can also give a comma seperated list of packages, or just a single one, as with `prereleases`

```sh
yarn version:graduate codemirror-graphql
```

then you can run

```sh
yarn run publish:graduate
```

And authenticate with 2FA


### Full Releases

```sh
yarn version:release
```

Will automatically detect and generate changelog/etc with appropriate versions and entries for all subpackage, no need to supply package names or an asterisk

Then you can run
```sh
lerna publish
```

And authenticate with 2FA
Please see [the RELEASING.md document](./RELEASING.md).

## License

Expand Down

0 comments on commit ea78946

Please sign in to comment.