-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
927 changed files
with
73,538 additions
and
0 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,13 @@ | ||
# Editor configuration, see http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
max_line_length = off | ||
trim_trailing_whitespace = false |
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 @@ | ||
node_modules/ |
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,44 @@ | ||
{ | ||
"root": true, | ||
"ignorePatterns": ["**/*"], | ||
"plugins": ["@nrwl/nx", "graphql"], | ||
"rules": { | ||
"graphql/template-strings": "off", | ||
"graphql/named-operations": "off" | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], | ||
"rules": { | ||
"@nrwl/nx/enforce-module-boundaries": [ | ||
"error", | ||
{ | ||
"enforceBuildableLibDependency": true, | ||
"allow": [], | ||
"depConstraints": [ | ||
{ | ||
"sourceTag": "*", | ||
"onlyDependOnLibsWithTags": ["*"] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"extends": ["plugin:@nrwl/nx/typescript"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.js", "*.jsx"], | ||
"extends": ["plugin:@nrwl/nx/javascript"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": "*.json", | ||
"parser": "jsonc-eslint-parser", | ||
"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,41 @@ | ||
# Pull Request Guidelines | ||
|
||
Thank you for contributing to our project! To help streamline the review process, please ensure that your pull request adheres to the following guidelines. | ||
|
||
## PR Title Format | ||
|
||
All pull requests must follow the Conventional Commits format. This is crucial for automated changelog generation and semantic versioning. Your PR title should look like one of the following: | ||
|
||
- `feat(scope): description` for new features. | ||
- `fix(scope): description` for bug fixes. | ||
- `docs(scope): description` for documentation changes. | ||
- `style(scope): description` for code style changes (formatting, missing semicolons, etc.). | ||
- `refactor(scope): description` for code changes that neither fix a bug nor add a feature. | ||
- `perf(scope): description` for performance improvements. | ||
- `test(scope): description` for adding missing tests or correcting existing tests. | ||
- `build(scope): description` for changes that affect the build system or external dependencies. | ||
- `ci(scope): description` for changes to our CI configuration files and scripts. | ||
- `chore(scope): description` for other changes that don't modify src or test files. | ||
- `revert(scope): description` for reverting a previous commit. | ||
|
||
### Scope | ||
|
||
The `scope` should be the package or area of the project affected by the change, enclosed in parentheses. For changes affecting the entire project or where the scope is not applicable, you may omit the scope. | ||
|
||
### Description | ||
|
||
The `description` should be a concise explanation of the changes. Start with a lowercase letter and do not end with a period. | ||
|
||
## Example PR Titles | ||
|
||
- `feat(authentication): implement JWT authentication` | ||
- `fix(database): resolve connection timeout issue` | ||
- `docs(readme): update installation instructions` | ||
|
||
## Additional Information | ||
|
||
- Include any additional details about your PR in this section. | ||
- If your PR includes multiple commits, consider squashing them into a single commit that follows the Conventional Commits format. | ||
- Attach any relevant issue numbers or references. | ||
|
||
Thank you for helping us improve our project! |
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 @@ | ||
name: Run script and check stdout | ||
description: Run a script from package.json and checks stdout for a success message | ||
inputs: | ||
packageCommand: | ||
description: The package.json command to run | ||
required: true | ||
successRegexp: | ||
description: The RegExp to match in stdout for success | ||
required: true | ||
runs: | ||
using: 'node12' | ||
main: 'index.js' |
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,37 @@ | ||
const core = require('@actions/core'); | ||
const {spawn} = require('child_process'); | ||
|
||
async function run() { | ||
try { | ||
const packageCommand = core.getInput('packageCommand', {required: true}); | ||
const successRegexp = core.getInput('successRegexp', {required: true}); | ||
let timeoutId; | ||
|
||
const child = spawn(packageCommand, { | ||
shell: true, | ||
}); | ||
|
||
console.log('###', successRegexp); | ||
child.stdout.on('data', data => { | ||
console.log(data.toString()); | ||
if (data.toString().includes(successRegexp)) { | ||
clearTimeout(timeoutId); | ||
child.kill('SIGTERM'); | ||
core.setOutput('result', 'Success'); | ||
} | ||
}); | ||
|
||
child.stderr.on('data', data => { | ||
console.error(data.toString()); | ||
}); | ||
|
||
timeoutId = setTimeout(() => { | ||
child.kill('SIGTERM'); | ||
core.setFailed('Command timeout'); | ||
}, 8 * 60 * 1000); // 8 minutes | ||
} catch (error) { | ||
core.setFailed(error.message); | ||
} | ||
} | ||
|
||
run(); |
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,43 @@ | ||
{ | ||
$schema: 'https://docs.renovatebot.com/renovate-schema.json', | ||
extends: [ | ||
'config:js-app', // https://docs.renovatebot.com/presets-config/#configjs-app | ||
':semanticCommits', | ||
':semanticCommitTypeAll(chore)', | ||
'group:monorepos', | ||
'group:allDigest', | ||
'helpers:pinGitHubActionDigests', | ||
], | ||
rebaseWhen: 'never', // we use merge queue which will rebase PRs before merging | ||
prConcurrentLimit: 3, | ||
commitMessageAction: '🔗 update', | ||
internalChecksFilter: 'strict', // required for packageRules[].stabilityDays | ||
dependencyDashboard: true, | ||
dependencyDashboardApproval: true, // require approval for all updates initially | ||
pin: { | ||
dependencyDashboardApproval: false, | ||
automerge: false, // let's test it and change to true later | ||
rebaseWhen: 'never', // | ||
}, | ||
separateMinorPatch: true, | ||
separateMajorMinor: true, | ||
separateMultipleMajor: true, | ||
packageRules: [ | ||
{ | ||
// group all patch updates together in a single PR | ||
groupName: 'all patch dependencies', | ||
groupSlug: 'all-patch', | ||
matchPackageNames: ['*'], | ||
matchUpdateTypes: ['patch'], | ||
}, | ||
{ | ||
matchDatasources: ['npm'], | ||
stabilityDays: 3, // npm packages less than 72 hours (3 days) old can be unpublished | ||
}, | ||
{ | ||
matchCurrentVersion: '2.8.8', // [Prettier v3 doesn't work with jest-snapshots](https://github.com/jestjs/jest/issues/14305), remove after jest update to >=30 | ||
matchPackageNames: ['prettier'], | ||
enabled: false, | ||
}, | ||
], | ||
} |
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,34 @@ | ||
name: Check Pull Request semantic | ||
|
||
on: | ||
pull_request: | ||
types: [opened, edited, synchronize] | ||
|
||
jobs: | ||
check-pr-title: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check PR Title | ||
uses: amannn/action-semantic-pull-request@505e44b4f33b4c801f063838b3f053990ee46ea7 # v4.6.0 | ||
with: | ||
# Define the allowed types | ||
types: | | ||
feat | ||
fix | ||
docs | ||
style | ||
refactor | ||
perf | ||
test | ||
build | ||
ci | ||
chore | ||
revert | ||
# Single commits also should be in that structure | ||
validateSingleCommit: true | ||
ignoreLabels: | | ||
bot | ||
internal | ||
release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,125 @@ | ||
name: Generators Integration Tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
- alpha-* | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: 'Run tests' | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- { | ||
packageCommand: 'pnpm nx g @brainly/gene-tools:core-module --name my-module --directory examples --tags domain:social-qa && pnpm nx test examples-modules-my-module-module', | ||
successRegexp: 'Successfully ran target test for project examples-modules-my-module-module', | ||
} | ||
- { | ||
packageCommand: 'pnpm nx g @brainly/gene-tools:core-module --name my-module --directory examples --tags domain:social-qa && pnpm nx lint examples-modules-my-module-module', | ||
successRegexp: 'Successfully ran target lint for project examples-modules-my-module-module', | ||
} | ||
- { | ||
packageCommand: 'pnpm nx g @brainly/gene-tools:core-module --name my-module --directory examples --tags domain:social-qa && pnpm nx e2e examples-modules-my-module-module-e2e --verbose', | ||
successRegexp: 'Successfully ran target e2e for project examples-modules-my-module-module-e2e', | ||
} | ||
- { | ||
packageCommand: 'pnpm nx g @brainly/gene-tools:components-library --name my-components --directory examples --tags domain:social-qa && pnpm nx test examples-components-my-components-ui', | ||
successRegexp: 'Successfully ran target test for project examples-components-my-components-ui', | ||
} | ||
- { | ||
packageCommand: 'pnpm nx g @brainly/gene-tools:components-library --name my-components --directory examples --tags domain:social-qa && pnpm nx lint examples-components-my-components-ui', | ||
successRegexp: 'Successfully ran target lint for project examples-components-my-components-ui', | ||
} | ||
- { | ||
packageCommand: 'pnpm nx g @brainly/gene-tools:service --name=my-data --directory=my-feature/services --serviceType=apollo --tags=domain:social-qa && pnpm nx lint my-feature-services-my-data-service', | ||
successRegexp: 'Successfully ran target lint for project my-feature-services-my-data-service', | ||
} | ||
- { | ||
packageCommand: 'pnpm nx g @brainly/gene-tools:service --name=my-data --directory=my-feature/services --serviceType=apollo --tags=domain:social-qa && pnpm nx test my-feature-services-my-data-service', | ||
successRegexp: 'Successfully ran target test for project my-feature-services-my-data-service', | ||
} | ||
- { | ||
packageCommand: 'pnpm nx g @brainly/gene-tools:service --name=my-data --directory=my-feature/services --serviceType=react-query --tags=domain:social-qa && pnpm nx lint my-feature-services-my-data-service', | ||
successRegexp: 'Successfully ran target lint for project my-feature-services-my-data-service', | ||
} | ||
- { | ||
packageCommand: 'pnpm nx g @brainly/gene-tools:service --name=my-data --directory=my-feature/services --serviceType=react-query --tags=domain:social-qa && pnpm nx test my-feature-services-my-data-service', | ||
successRegexp: 'Successfully ran target test for project my-feature-services-my-data-service', | ||
} | ||
- { | ||
packageCommand: 'pnpm nx g @brainly/gene-tools:nextjs-app --name=my-app --directory=example --tags=domain:social-qa --rewrites=true --apollo=true --reactQuery=true --e2e=true && NODE_OPTIONS="--max-old-space-size=8192" pnpm nx e2e example-my-app-e2e --verbose', | ||
successRegexp: 'Successfully ran target e2e for project example-my-app-e2e', | ||
} | ||
- { | ||
packageCommand: 'pnpm nx g @brainly/gene-tools:nextjs-app --name=my-app --directory=example --tags=domain:social-qa --rewrites=true --apollo=true --reactQuery=true --e2e=true && pnpm nx test example-my-app', | ||
successRegexp: 'Successfully ran target test for project example-my-app', | ||
} | ||
- { | ||
packageCommand: 'pnpm nx g @brainly/gene-tools:nextjs-app --name=my-app --directory=example --tags=domain:social-qa --rewrites=true --apollo=true --reactQuery=true --e2e=true && pnpm nx lint example-my-app', | ||
successRegexp: 'Successfully ran target lint for project example-my-app', | ||
} | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup node | ||
uses: actions/setup-node@7c12f8017d5436eb855f1ed4399f037a36fbd9e8 # v2 | ||
with: | ||
node-version: '18.20.0' | ||
- uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9.12.0 | ||
- name: Restore cached npm dependencies | ||
uses: actions/cache/restore@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3 | ||
with: | ||
path: node_modules | ||
key: npm-dependencies-${{ hashFiles('pnpm-lock.yaml') }} | ||
- name: Restore cached Cypress binary | ||
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3 | ||
with: | ||
path: ~/.cache/Cypress | ||
key: cypress-cache-${{ hashFiles('pnpm-lock.yaml') }} | ||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile | ||
- name: Install Cypress binary | ||
run: | | ||
npx cypress install | ||
- name: Cache npm dependencies | ||
uses: actions/cache/save@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3 | ||
with: | ||
path: node_modules | ||
key: npm-dependencies-${{ hashFiles('pnpm-lock.yaml') }} | ||
- name: Cache Cypress binary | ||
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3 | ||
with: | ||
path: ~/.cache/Cypress | ||
key: cypress-cache-${{ hashFiles('pnpm-lock.yaml') }} | ||
- name: Run script and check stdout | ||
uses: ./.github/actions/generators-integration-tests | ||
timeout-minutes: 10 | ||
with: | ||
packageCommand: ${{ matrix.config.packageCommand }} | ||
successRegexp: ${{ matrix.config.successRegexp }} | ||
|
||
generators-integration-summary: | ||
name: 'Summary check' | ||
runs-on: ubuntu-latest | ||
needs: build | ||
if: always() | ||
steps: | ||
- name: Successful Generator tests | ||
if: ${{ !(contains(needs.*.result, 'failure')) }} | ||
run: exit 0 | ||
- name: Failing Generator tests | ||
if: ${{ contains(needs.*.result, 'failure') }} | ||
run: | | ||
echo "Some Generator tests failed - please look on particular job logs for more details." | ||
exit 1 |
Oops, something went wrong.