Skip to content

Commit

Permalink
[Chores] Follow-up on API docs generation (#1474)
Browse files Browse the repository at this point in the history
* Test pipeline

* Update since flag

* Update since flag

* Update

* Fix for the script

* add comment

* Update CHANGELOG
  • Loading branch information
illiakovalenko committed May 11, 2023
1 parent d53c935 commit 0b7f86c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -32,7 +32,7 @@ Our versioning strategy is as follows:

### 🧹 Chores

* Automated API doc generation and added packages/samples filter ([#1470](https://github.com/Sitecore/jss/pull/1470))
* Automated API doc generation and added packages/samples filter ([#1470](https://github.com/Sitecore/jss/pull/1470))([#1474](https://github.com/Sitecore/jss/pull/1474))
* Revisit and update github ISSUE_TEMPLATE ([#1445](https://github.com/Sitecore/jss/pull/1445))
* Configure the recommended VSCode extensions for the starters ([#1437](https://github.com/Sitecore/jss/pull/1437))
* `[templates/nextjs]` `[templates/nextjs-styleguide-tracking]` Move remaining Styleguide-Tracking artifacts from the base template ([#1422](https://github.com/Sitecore/jss/pull/1422))
Expand Down
8 changes: 4 additions & 4 deletions azure-pipelines.yml
Expand Up @@ -33,7 +33,7 @@ variables:
branchName: $[ replace(variables['Build.SourceBranch'], 'refs/heads/', '') ]
${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}:
branchName: $[ replace(variables['System.PullRequest.SourceBranch'], 'refs/heads/', '') ]
lernaSinceFlag: "--since $(variables['branchName'])"
lernaSinceFlag: "--since=origin/dev"
# disable `PublishCodeCoverageResults` report generation, as `reportgenerator` provides custom report
disable.coverage.autogenerate: 'true'
# Some steps here scaffold jss apps and check if they build and lint correctly
Expand All @@ -48,7 +48,7 @@ steps:
yarn cache clean --all && yarn install --immutable
displayName: 'yarn install - initial'
- script: |
yarn lint-packages -- ${{ variables.lernaSinceFlag }}
yarn lint-packages ${{ variables.lernaSinceFlag }}
displayName: 'lint packages'
- script: |
lerna run build
Expand Down Expand Up @@ -83,7 +83,7 @@ steps:
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
- script: |
yarn lint-samples -- ${{ variables.lernaSinceFlag }}
yarn lint-samples ${{ variables.lernaSinceFlag }}
displayName: 'lint samples'
condition: and(succeeded(), ne(variables.shouldPublish, true))

Expand All @@ -104,7 +104,7 @@ steps:
# Only run for 'dev' and 'release' branches
# in order to don't produce extra changes in the Pull Request
- script: |
yarn generate-docs -- ${{ variables.lernaSinceFlag }}
yarn generate-docs ${{ variables.lernaSinceFlag }}
git add ./ref-docs/**/*
git commit -m "Update API docs [skip ci]"
displayName: 'generate API docs'
Expand Down
3 changes: 2 additions & 1 deletion scripts/lint-samples.js
Expand Up @@ -3,14 +3,15 @@ const samples = require('./samples.json');
const { getAppName } = require('./utils');

const cliArgs = process.argv.slice(2);
const lernaSinceFlag = cliArgs.length ? cliArgs[1] : undefined;
const lernaSinceFlag = cliArgs.length ? cliArgs[0].replace('--since=', '') : undefined;

const runLintCommand = (scope) =>
execSync(`lerna run lint --scope ${scope} -- --fix`, {
stdio: 'inherit',
});

if (!lernaSinceFlag) {
// lint all the samples
runLintCommand('sample-*');

return;
Expand Down

0 comments on commit 0b7f86c

Please sign in to comment.