Skip to content

Commit 5fa95f4

Browse files
authored
Release V1 (#1177)
1 parent 806a329 commit 5fa95f4

File tree

282 files changed

+11631
-15037
lines changed

Some content is hidden

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

282 files changed

+11631
-15037
lines changed

.circleci/config.yml

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

.editorconfig

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

.github/workflows/benchmark.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Benchmark
2+
3+
on: [push]
4+
5+
jobs:
6+
Benchmark:
7+
name: Benchmark on node ${{ matrix.node_version }}
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
node_version: [12, 14]
12+
env:
13+
CI: true
14+
15+
steps:
16+
- uses: actions/checkout@v1
17+
18+
- name: Use Node.js ${{ matrix.node_version }}
19+
uses: actions/setup-node@master
20+
with:
21+
node-version: ${{ matrix.node_version }}
22+
23+
- name: Get yarn cache
24+
id: yarn-cache
25+
run: echo "::set-output name=dir::$(yarn cache dir)"
26+
- name: Cache Yarn
27+
uses: actions/cache@v1
28+
with:
29+
path: ${{ steps.yarn-cache.outputs.dir }}
30+
key: ${{ runner.os }}-${{ matrix.node_version }}-yarn-${{ hashFiles('yarn.lock') }}
31+
restore-keys: |
32+
${{ runner.os }}-${{ matrix.node_version }}-yarn-
33+
34+
- name: Install
35+
run: yarn
36+
37+
- name: Build
38+
run: yarn build
39+
40+
- name: Benchmark
41+
run: 'yarn benchmark:basic'

.github/workflows/canary.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Canary Release
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
jobs:
8+
publish-canary:
9+
name: Publish Canary
10+
runs-on: ubuntu-latest
11+
if: contains(github.actor, 'dependabot') == false && github.event.pull_request.head.repo.full_name == github.repository
12+
steps:
13+
- name: Checkout Master
14+
uses: actions/checkout@v1
15+
- name: Use Node
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: '14.x'
19+
- name: Get yarn cache
20+
id: yarn-cache
21+
run: echo "::set-output name=dir::$(yarn cache dir)"
22+
- name: Cache Yarn
23+
uses: actions/cache@v1
24+
with:
25+
path: ${{ steps.yarn-cache.outputs.dir }}
26+
key: ${{ runner.os }}-14-15-yarn-${{ hashFiles('yarn.lock') }}
27+
restore-keys: |
28+
${{ runner.os }}-14-15-yarn-
29+
- name: Install Dependencies using Yarn
30+
run: yarn install && git checkout yarn.lock
31+
- name: Build
32+
run: yarn build
33+
34+
- name: Release Canary
35+
id: canary
36+
uses: 'kamilkisiela/release-canary@master'
37+
if: github.repository == 'ardatan/graphql-tools'
38+
with:
39+
npm-token: ${{ secrets.NODE_AUTH_TOKEN }}
40+
npm-script: 'release:canary'
41+
- name: Publish a message
42+
if: steps.canary.outputs.released
43+
uses: 'kamilkisiela/pr-comment@master'
44+
with:
45+
message: |
46+
The latest changes of this PR are available as alpha in npm: `${{ steps.canary.outputs.version }}`
47+
Quickly update your package.json by running:
48+
npx match-version graphql-modules ${{ steps.canary.outputs.version }}
49+
bot-token: ${{ secrets.GH_API_TOKEN }}
50+
bot: 'theguild-bot'
51+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
Test:
7+
name: Test on node ${{ matrix.node_version }}
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
node_version: [12, 14]
12+
env:
13+
CI: true
14+
15+
steps:
16+
- uses: actions/checkout@v1
17+
18+
- name: Use Node.js ${{ matrix.node_version }}
19+
uses: actions/setup-node@master
20+
with:
21+
node-version: ${{ matrix.node_version }}
22+
23+
- name: Get yarn cache
24+
id: yarn-cache
25+
run: echo "::set-output name=dir::$(yarn cache dir)"
26+
- name: Cache Yarn
27+
uses: actions/cache@v1
28+
with:
29+
path: ${{ steps.yarn-cache.outputs.dir }}
30+
key: ${{ runner.os }}-${{ matrix.node_version }}-yarn-${{ hashFiles('yarn.lock') }}
31+
restore-keys: |
32+
${{ runner.os }}-${{ matrix.node_version }}-yarn-
33+
34+
- name: Install
35+
run: yarn
36+
37+
- name: Build
38+
run: yarn build
39+
40+
- name: Test
41+
run: yarn test

.gitignore

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Coverage directory used by tools like istanbul
9+
coverage
10+
11+
# Dependency directories
112
node_modules
2-
.idea
13+
14+
# Optional npm cache directory
15+
.npm
16+
17+
# Output of 'npm pack'
18+
*.tgz
19+
20+
# Yarn Integrity file
21+
.yarn-integrity
22+
23+
# dotenv environment variables file
24+
.env
25+
26+
# Builds
327
dist
4-
build
5-
out
6-
temp
7-
lerna-debug.log
8-
packages/*/yarn.lock
9-
packages/*/yarn-error.log
10-
examples/*/yarn.lock
11-
packages/*/yarn-error.log
12-
yarn-error.log
13-
14-
.DS_Store
15-
16-
lib/core/metadata.js
17-
lib/core/MetadataBlog.js
18-
19-
website/translated_docs
20-
website/build/
21-
website/yarn.lock
22-
website/functions
23-
website/node_modules
24-
website/i18n/*
25-
26-
docs/api/**/*.md
27-
28-
test-results/
29-
junit.xml
30-
31-
yarn.lock
32-
package-lock.json
28+
29+
# IDE
30+
.idea
31+
.vscode
32+
33+
.bob
34+
tsconfig.tsbuildinfo

.pretterignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist
2+
**/dist

.prettierrc

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

README.md

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

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

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

11-
- **[Website](https://graphql-modules.com/docs/introduction/getting-started)**
12-
- **[Introducing GraphQL Modules - Feature based GraphQL Modules at scale](https://medium.com/the-guild/graphql-modules-feature-based-graphql-modules-at-scale-2d7b2b0da6da)**
13-
- **[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)**
14-
- **[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)**
15-
- **[Scoped Providers in GraphQL-Modules Dependency Injection](https://medium.com/the-guild/scoped-providers-in-graphql-modules-dependency-injection-system-949cd2588e0)**
16-
- **[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)**
17-
- **[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)**
18-
- **[Authentication with AccountsJS & GraphQL Modules](https://medium.com/the-guild/authentication-with-accountsjs-graphql-modules-e0fb9799a9da)**
19-
- **[Manage Circular Imports Hell in GraphQL-Modules](https://medium.com/the-guild/manage-circular-imports-hell-with-graphql-modules-4b1611dee781)**
10+
- [Website](https://graphql-modules.com)
11+
- [Documentation](https://graphql-modules.com/docs)
2012

2113
## Highlights
2214

23-
- **Reusable modules** - Modules are defined by their GraphQL schema (Schema first design). They're completely independent and can be shared between apps.
15+
- **Reusable modules** - Modules are defined by their GraphQL schema (Schema first design). They can be shared between apps.
2416
- **Scalable structure** - Manage multiple teams and features, multiple micro-services and servers.
2517
- **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.
2618
- **Testable** - A rich toolset around testing, mocking and separation.
2719

2820
## Documentation
2921

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

3224
## Installation
3325

3426
To install graphql-modules, use the following:
3527

3628
```sh
37-
$ npm install @graphql-modules/core
29+
$ npm install graphql-modules
3830

3931
# Or, with Yarn
4032

41-
$ yarn add @graphql-modules/core
33+
$ yarn add graphql-modules
4234
```
4335

44-
Or, in alternative, just use the graphql-modules-seed to get started:
45-
46-
$ git clone https://github.com/darkbasic/graphql-modules-seed.git
47-
4836
#### Pre-release
4937

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

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

5442
## Usage
5543

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

5846
```js
59-
import { GraphQLModule } from '@graphql-modules/core';
47+
import { createModule, createAppliction } from 'graphql-modules';
6048

61-
const module = new GraphQLModule({
62-
typeDefs: gql`
49+
const module = createModule({
50+
id: 'my-module',
51+
typeDefs: `
6352
type Post {
6453
id: ID
6554
title: String
@@ -71,30 +60,18 @@ const module = new GraphQLModule({
7160
}
7261
`,
7362
resolvers: blogResolvers,
74-
imports: [UserModule]
63+
});
64+
65+
const application = createAppliction({
66+
modules: [module],
7567
});
7668
```
7769

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

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

8475
## GraphQL Code Generator integration
8576

86-
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).
87-
88-
## Troubleshoot
89-
90-
If you have issues with the generator, feel free open issues in this repository.
91-
92-
## Contributing
93-
94-
Feel free to open issues (for bugs/questions) and create pull requests (add generators / fix bugs).
95-
96-
## License
97-
98-
[![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg?maxAge=2592000)](https://raw.githubusercontent.com/apollostack/apollo-ios/master/LICENSE)
99-
100-
MIT
77+
GraphQL Modules easily integrates with [GraphQL Code Generator](https://github.com/dotansimha/graphql-code-generator).

TODO.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- [x] rename `createApp` to `createApplication`
2+
- [ ] write a long message of what the new modules are as an introduction to Gago instead of a video call

0 commit comments

Comments
 (0)