Skip to content

Instantly share code, notes, and snippets.

View vsavkin's full-sized avatar

Victor Savkin vsavkin

View GitHub Profile
// Nx Devkit
export default async function (tree: Tree, options: Schema) {
generateFiles(
tree,
join(__dirname, 'files'),
join('tools/generators', options.name),
options
);
await formatFiles(tree);
}
{
"tasks": [
{
"id": "react-app:build",
"overrides": {},
"target": {
"project": "react-app",
"target": "build"
},
"command": "npm run nx -- build react-app",
const execSync = require('child_process').execSync;
const commands = JSON.parse(process.argv[2]);
const projects = commands[process.argv[3]];
const target = process.argv[4];
execSync(
`npx nx run-many --target=${target} --projects=${projects.join(
','
)} --parallel`,
{
stdio: [0, 1, 2]
- job: lint1
dependsOn: initial_setup
condition: |
and(
succeeded(),
not(contains(
dependencies.initial_setup.outputs['setCommands.COMMANDS'],
'"lint1":[]'
))
)
const isMaster = process.argv[2] === 'False';
const baseSha = isMaster ? 'origin/master~1' : 'origin/master';
- job: lint1
dependsOn: initial_setup
condition: |
and(
succeeded(),
not(contains(
dependencies.initial_setup.outputs['setCommands.COMMANDS'],
'"lint1":[]'
))
)
jobs:
- job: initial_setup
pool:
vmImage: 'ubuntu-latest'
variables:
IS_PR: $[ eq(variables['Build.Reason'], 'PullRequest') ]
steps:
- template: .azure-pipelines/steps/install-node-modules.yml
- powershell: echo "##vso[task.setvariable variable=COMMANDS;isOutput=true]$(node ./tools/scripts/calculate-commands.js $(IS_PR))"
name: setCommands
jobs:
- job: ci
timeoutInMinutes: 120
pool:
vmImage: 'ubuntu-latest'
variables:
IS_PR: $[ eq(variables['Build.Reason'], 'PullRequest') ]
steps:
- template: .azure-pipelines/steps/install-node-modules.yml
- script: yarn nx affected --target=test --base=origin/master --parallel
jobs:
- job: ci
timeoutInMinutes: 120
pool:
vmImage: 'ubuntu-latest'
steps:
- template: .azure-pipelines/steps/install-node-modules.yml
- script: yarn nx affected --target=test --base=origin/master
- script: yarn nx affected --target=lint --base=origin/master
- script: yarn nx affected --target=build --base=origin/master --prod
jobs:
- job: ci
timeoutInMinutes: 120
pool:
vmImage: 'ubuntu-latest'
steps:
- template: .azure-pipelines/steps/install-node-modules.yml
- script: yarn nx run-many --target=test --all
- script: yarn nx run-many --target=lint --all
- script: yarn nx run-many --target=build --all --prod