-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nx-plugin-graphql-mesh): add API Gateway generator (#49)
- Loading branch information
1 parent
f71e97d
commit 68e8380
Showing
93 changed files
with
2,523 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'nx-plugin-graphql-mesh': major | ||
--- | ||
|
||
Add `app` generator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
apps/api-gateway/javascript-wiki/cjs-config-e2e/.eslintrc.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": ["plugin:cypress/recommended", "../../../../.eslintrc.json"], | ||
"ignorePatterns": ["!**/*"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], | ||
"rules": {} | ||
} | ||
] | ||
} |
12 changes: 12 additions & 0 deletions
12
apps/api-gateway/javascript-wiki/cjs-config-e2e/cypress.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"fileServerFolder": ".", | ||
"fixturesFolder": "./src/fixtures", | ||
"integrationFolder": "./src/integration", | ||
"modifyObstructiveCode": false, | ||
"supportFile": "./src/support/index.ts", | ||
"pluginsFile": false, | ||
"video": true, | ||
"videosFolder": "../../../../dist/cypress/apps/api-gateway/javascript-wiki/cjs-config-e2e/videos", | ||
"screenshotsFolder": "../../../../dist/cypress/apps/api-gateway/javascript-wiki/cjs-config-e2e/screenshots", | ||
"chromeWebSecurity": false | ||
} |
30 changes: 30 additions & 0 deletions
30
apps/api-gateway/javascript-wiki/cjs-config-e2e/project.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"$schema": "../../../../node_modules/nx/schemas/project-schema.json", | ||
"sourceRoot": "apps/api-gateway/javascript-wiki/cjs-config-e2e/src", | ||
"projectType": "application", | ||
"targets": { | ||
"e2e": { | ||
"executor": "@nrwl/cypress:cypress", | ||
"options": { | ||
"cypressConfig": "apps/api-gateway/javascript-wiki/cjs-config-e2e/cypress.json", | ||
"devServerTarget": "api-gateway-javascript-wiki-cjs-config:serve" | ||
}, | ||
"configurations": { | ||
"production": { | ||
"devServerTarget": "api-gateway-javascript-wiki-cjs-config:serve:production" | ||
} | ||
} | ||
}, | ||
"lint": { | ||
"executor": "@nrwl/linter:eslint", | ||
"outputs": ["{options.outputFile}"], | ||
"options": { | ||
"lintFilePatterns": [ | ||
"apps/api-gateway/javascript-wiki/cjs-config-e2e/**/*.{js,ts}" | ||
] | ||
} | ||
} | ||
}, | ||
"tags": [], | ||
"implicitDependencies": ["api-gateway-javascript-wiki-cjs-config"] | ||
} |
4 changes: 4 additions & 0 deletions
4
apps/api-gateway/javascript-wiki/cjs-config-e2e/src/fixtures/example.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "Using fixtures to represent data", | ||
"email": "hello@cypress.io" | ||
} |
17 changes: 17 additions & 0 deletions
17
apps/api-gateway/javascript-wiki/cjs-config-e2e/src/integration/app.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
describe('javascript-wiki-cjs-config', () => { | ||
it('should start a mesh server', () => { | ||
cy.request('/graphql/health').then((resp) => { | ||
expect(resp.status).to.eq(200); | ||
expect(resp.body).to.have.property('message', 'alive'); | ||
}); | ||
}); | ||
|
||
it('should still be running after 15 seconds', () => { | ||
cy.wait(1000 * 15) | ||
.request('/graphql/health') | ||
.then((resp) => { | ||
expect(resp.status).to.eq(200); | ||
expect(resp.body).to.have.property('message', 'alive'); | ||
}); | ||
}); | ||
}); |
1 change: 1 addition & 0 deletions
1
apps/api-gateway/javascript-wiki/cjs-config-e2e/src/support/app.po.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const getGreeting = () => cy.get('h1'); |
33 changes: 33 additions & 0 deletions
33
apps/api-gateway/javascript-wiki/cjs-config-e2e/src/support/commands.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// *********************************************** | ||
// This example commands.js shows you how to | ||
// create various custom commands and overwrite | ||
// existing commands. | ||
// | ||
// For more comprehensive examples of custom | ||
// commands please read more here: | ||
// https://on.cypress.io/custom-commands | ||
// *********************************************** | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-namespace | ||
declare namespace Cypress { | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
interface Chainable<Subject> { | ||
login(email: string, password: string): void; | ||
} | ||
} | ||
// | ||
// -- This is a parent command -- | ||
Cypress.Commands.add('login', (email, password) => { | ||
console.log('Custom command example: Login', email, password); | ||
}); | ||
// | ||
// -- This is a child command -- | ||
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This is a dual command -- | ||
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This will overwrite an existing command -- | ||
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) |
17 changes: 17 additions & 0 deletions
17
apps/api-gateway/javascript-wiki/cjs-config-e2e/src/support/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// *********************************************************** | ||
// This example support/index.js is processed and | ||
// loaded automatically before your test files. | ||
// | ||
// This is a great place to put global configuration and | ||
// behavior that modifies Cypress. | ||
// | ||
// You can change the location of this file or turn off | ||
// automatically serving support files with the | ||
// 'supportFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/configuration | ||
// *********************************************************** | ||
|
||
// Import commands.js using ES2015 syntax: | ||
import './commands'; |
10 changes: 10 additions & 0 deletions
10
apps/api-gateway/javascript-wiki/cjs-config-e2e/tsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "../../../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"sourceMap": false, | ||
"outDir": "../../../../dist/out-tsc", | ||
"allowJs": true, | ||
"types": ["cypress", "node"] | ||
}, | ||
"include": ["src/**/*.ts", "src/**/*.js"] | ||
} |
18 changes: 18 additions & 0 deletions
18
apps/api-gateway/javascript-wiki/cjs-config/.eslintrc.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"extends": ["../../../../.eslintrc.json"], | ||
"ignorePatterns": ["!**/*", ".mesh"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.js", "*.jsx"], | ||
"rules": {} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports = { | ||
sources: [ | ||
{ | ||
name: 'JavaScript Wiki', | ||
handler: { | ||
openapi: { | ||
source: | ||
'https://api.apis.guru/v2/specs/wikimedia.org/1.0.0/swagger.yaml', | ||
}, | ||
}, | ||
}, | ||
], | ||
serve: { | ||
browser: false, | ||
}, | ||
}; |
17 changes: 17 additions & 0 deletions
17
apps/api-gateway/javascript-wiki/cjs-config/jest.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* eslint-disable */ | ||
export default { | ||
displayName: 'api-gateway-javascript-wiki-cjs-config', | ||
preset: '../../../../jest.preset.js', | ||
globals: { | ||
'ts-jest': { | ||
tsconfig: '<rootDir>/tsconfig.spec.json', | ||
}, | ||
}, | ||
testEnvironment: 'node', | ||
transform: { | ||
'^.+\\.[tj]s$': 'ts-jest', | ||
}, | ||
moduleFileExtensions: ['ts', 'js', 'html'], | ||
coverageDirectory: | ||
'../../../../coverage/apps/api-gateway/javascript-wiki/cjs-config', | ||
}; |
Oops, something went wrong.