Skip to content

Commit

Permalink
Release V1 (#1177)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilkisiela authored Aug 20, 2020
1 parent 806a329 commit 5fa95f4
Show file tree
Hide file tree
Showing 282 changed files with 11,631 additions and 15,037 deletions.
35 changes: 0 additions & 35 deletions .circleci/config.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .editorconfig

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Benchmark

on: [push]

jobs:
Benchmark:
name: Benchmark on node ${{ matrix.node_version }}
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [12, 14]
env:
CI: true

steps:
- uses: actions/checkout@v1

- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@master
with:
node-version: ${{ matrix.node_version }}

- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Yarn
uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.node_version }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node_version }}-yarn-
- name: Install
run: yarn

- name: Build
run: yarn build

- name: Benchmark
run: 'yarn benchmark:basic'
51 changes: 51 additions & 0 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Canary Release

on:
pull_request:
branches:
- master
jobs:
publish-canary:
name: Publish Canary
runs-on: ubuntu-latest
if: contains(github.actor, 'dependabot') == false && github.event.pull_request.head.repo.full_name == github.repository
steps:
- name: Checkout Master
uses: actions/checkout@v1
- name: Use Node
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Yarn
uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-14-15-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-14-15-yarn-
- name: Install Dependencies using Yarn
run: yarn install && git checkout yarn.lock
- name: Build
run: yarn build

- name: Release Canary
id: canary
uses: 'kamilkisiela/release-canary@master'
if: github.repository == 'ardatan/graphql-tools'
with:
npm-token: ${{ secrets.NODE_AUTH_TOKEN }}
npm-script: 'release:canary'
- name: Publish a message
if: steps.canary.outputs.released
uses: 'kamilkisiela/pr-comment@master'
with:
message: |
The latest changes of this PR are available as alpha in npm: `${{ steps.canary.outputs.version }}`
Quickly update your package.json by running:
npx match-version graphql-modules ${{ steps.canary.outputs.version }}
bot-token: ${{ secrets.GH_API_TOKEN }}
bot: 'theguild-bot'
github-token: ${{ secrets.GITHUB_TOKEN }}
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI

on: [push]

jobs:
Test:
name: Test on node ${{ matrix.node_version }}
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [12, 14]
env:
CI: true

steps:
- uses: actions/checkout@v1

- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@master
with:
node-version: ${{ matrix.node_version }}

- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Yarn
uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.node_version }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node_version }}-yarn-
- name: Install
run: yarn

- name: Build
run: yarn build

- name: Test
run: yarn test
62 changes: 32 additions & 30 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Coverage directory used by tools like istanbul
coverage

# Dependency directories
node_modules
.idea

# Optional npm cache directory
.npm

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# Builds
dist
build
out
temp
lerna-debug.log
packages/*/yarn.lock
packages/*/yarn-error.log
examples/*/yarn.lock
packages/*/yarn-error.log
yarn-error.log

.DS_Store

lib/core/metadata.js
lib/core/MetadataBlog.js

website/translated_docs
website/build/
website/yarn.lock
website/functions
website/node_modules
website/i18n/*

docs/api/**/*.md

test-results/
junit.xml

yarn.lock
package-lock.json

# IDE
.idea
.vscode

.bob
tsconfig.tsbuildinfo
2 changes: 2 additions & 0 deletions .pretterignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
**/dist
7 changes: 0 additions & 7 deletions .prettierrc

This file was deleted.

63 changes: 20 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,54 @@
[![modules](https://user-images.githubusercontent.com/25294569/64067074-ed185b80-cc2a-11e9-8f4d-5f1e19feaa0a.gif)](https://graphql-modules.com/)


[![npm version](https://badge.fury.io/js/%40graphql-modules%2Fcore.svg)](https://www.npmjs.com/package/@graphql-modules/core)
[![CircleCI](https://circleci.com/gh/Urigo/graphql-modules.svg?style=svg&circle-token=28155ce743e1a9ba25152b0b3395acfa5b152f41)](https://circleci.com/gh/Urigo/graphql-modules)
[![Discord Chat](https://img.shields.io/discord/625400653321076807)](https://discord.gg/xud7bH9)
[![npm version](https://badge.fury.io/js/graphql-modules.svg)](https://www.npmjs.com/package/graphql-modules)
![CI](https://github.com/Urigo/graphql-modules/workflows/CI/badge.svg)
[![Discord Chat](https://img.shields.io/discord/625400653321076807)](https://the-guild.dev/discord)
[![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg?maxAge=2592000)]()

**GraphQL Modules** is a toolset of libraries and guidelines dedicated to **create reusable, maintainable, testable and extendable modules** out of your GraphQL server.

- **[Website](https://graphql-modules.com/docs/introduction/getting-started)**
- **[Introducing GraphQL Modules - Feature based GraphQL Modules at scale](https://medium.com/the-guild/graphql-modules-feature-based-graphql-modules-at-scale-2d7b2b0da6da)**
- **[Why is True Modular Encapsulation So Important in Large-Scale GraphQL Projects? ](https://medium.com/the-guild/why-is-true-modular-encapsulation-so-important-in-large-scale-graphql-projects-ed1778b03600)**
- **[Why did we implement our own Dependency Injection library for GraphQL-Modules?](https://medium.com/the-guild/why-did-we-implement-our-own-dependency-injection-library-for-graphql-modules-f25a234a9762)**
- **[Scoped Providers in GraphQL-Modules Dependency Injection](https://medium.com/the-guild/scoped-providers-in-graphql-modules-dependency-injection-system-949cd2588e0)**
- **[Writing a GraphQL TypeScript project w/ GraphQL-Modules and GraphQL-Code-Generator](https://medium.com/the-guild/writing-strict-typed-graphql-typescript-project-w-graphql-modules-and-graphql-code-generator-c22f6caa17b8)**
- **[Authentication and Authorization in GraphQL (and how GraphQL-Modules can help)](https://medium.com/the-guild/authentication-and-authorization-in-graphql-and-how-graphql-modules-can-help-fadc1ee5b0c2)**
- **[Authentication with AccountsJS & GraphQL Modules](https://medium.com/the-guild/authentication-with-accountsjs-graphql-modules-e0fb9799a9da)**
- **[Manage Circular Imports Hell in GraphQL-Modules](https://medium.com/the-guild/manage-circular-imports-hell-with-graphql-modules-4b1611dee781)**
- [Website](https://graphql-modules.com)
- [Documentation](https://graphql-modules.com/docs)

## Highlights

- **Reusable modules** - Modules are defined by their GraphQL schema (Schema first design). They're completely independent and can be shared between apps.
- **Reusable modules** - Modules are defined by their GraphQL schema (Schema first design). They can be shared between apps.
- **Scalable structure** - Manage multiple teams and features, multiple micro-services and servers.
- **Gradual growth** - A clear, gradual path from a very simple and fast, single-file modules, to scalable multi-file, multi-teams, multi-repo, multi-server modules.
- **Testable** - A rich toolset around testing, mocking and separation.

## Documentation

Documentation is available at [graphql-modules.com](https://graphql-modules.com/docs/introduction/getting-started) or inside the [docs](./docs/) directory.
Documentation is available at [graphql-modules.com](https://graphql-modules.com/docs).

## Installation

To install graphql-modules, use the following:

```sh
$ npm install @graphql-modules/core
$ npm install graphql-modules

# Or, with Yarn

$ yarn add @graphql-modules/core
$ yarn add graphql-modules
```

Or, in alternative, just use the graphql-modules-seed to get started:

$ git clone https://github.com/darkbasic/graphql-modules-seed.git

#### Pre-release

We are also publishing a pre-release version to NPM on each change.

Just take a look at the build status on CircleCI and find "Publish Canary" job to get the published version.
Just take a look at the build status on Github Actions and find "Publish Canary" job to get the published version.

## Usage

More advanced usage at [graphql-modules.com](https://graphql-modules.com/docs/introduction/getting-started)
More advanced usage at [graphql-modules.com](https://graphql-modules.com/docs)

```js
import { GraphQLModule } from '@graphql-modules/core';
import { createModule, createAppliction } from 'graphql-modules';

const module = new GraphQLModule({
typeDefs: gql`
const module = createModule({
id: 'my-module',
typeDefs: `
type Post {
id: ID
title: String
Expand All @@ -71,30 +60,18 @@ const module = new GraphQLModule({
}
`,
resolvers: blogResolvers,
imports: [UserModule]
});

const application = createAppliction({
modules: [module],
});
```

Inside the `examples` directory you can find the following examples:

- [Simple GraphQL-Modules example](./examples/basic)
- [Using dependency injection in GraphQL Modules](./examples/basic-with-dependency-injection)
- You can also take a look at the [graphql-modules-seed](https://github.com/darkbasic/graphql-modules-seed) repository.

## GraphQL Code Generator integration

GraphQL Modules easily integrates with [GraphQL Code Generator](https://github.com/dotansimha/graphql-code-generator). To see how look at the [graphql-modules-seed](https://github.com/darkbasic/graphql-modules-seed).

## Troubleshoot

If you have issues with the generator, feel free open issues in this repository.

## Contributing

Feel free to open issues (for bugs/questions) and create pull requests (add generators / fix bugs).

## License

[![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg?maxAge=2592000)](https://raw.githubusercontent.com/apollostack/apollo-ios/master/LICENSE)

MIT
GraphQL Modules easily integrates with [GraphQL Code Generator](https://github.com/dotansimha/graphql-code-generator).
2 changes: 2 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- [x] rename `createApp` to `createApplication`
- [ ] write a long message of what the new modules are as an introduction to Gago instead of a video call
Loading

0 comments on commit 5fa95f4

Please sign in to comment.