Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

RHCLOUD-23014: Use API Extractor on distributable packages #184

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Expand Up @@ -3,3 +3,4 @@
/screenshots
**/node_modules
**/dist
**/.DS_Store
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -3,6 +3,7 @@
/screenshots
**/node_modules
**/dist
**/.DS_Store

# https://next.yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
.pnp.*
Expand Down
3 changes: 1 addition & 2 deletions clean.sh
@@ -1,7 +1,6 @@
#!/bin/bash
set -euo pipefail

for dir in 'node_modules' 'dist'
do
for dir in node_modules dist; do
find . -type d -name "$dir" -prune -exec rm -rf {} \;
done
5 changes: 3 additions & 2 deletions generate-api-docs.sh
Expand Up @@ -6,7 +6,8 @@ yarn build-libs

mkdir -p docs/generated && rm -rf docs/generated/*

shopt -s globstar
cp packages/lib-*/dist/api/lib-*.api.json docs/generated
for dir in packages/lib-*; do
cp $dir/dist/api/$(basename $dir).api.json docs/generated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

馃憤

done

yarn api-documenter markdown -i docs/generated -o docs/generated/api
2 changes: 1 addition & 1 deletion packages/eslint-plugin-internal/src/rules/all-bases.js
Expand Up @@ -17,7 +17,7 @@ module.exports = {
// Enforce a maximum number of classes per file
'max-classes-per-file': 'off',

// This rule has inconsistent behavior and poor monorepo support, replaced by lib-restricted-external-imports
// Replaced by lib-restricted-external-imports, see the replacement rule documentation for details
'import/no-extraneous-dependencies': 'off',

// Enforce imported external modules to be declared in dependencies or peerDependencies within the closest parent package.json
Expand Down
Expand Up @@ -61,6 +61,16 @@ const checkImport = (context, node) => {
* Enforce imported external modules to be declared in `dependencies` or `peerDependencies`
* within the closest parent `package.json`.
*
* This rule is meant to replace `import/no-extraneous-dependencies` which seems to have
* some behavioral inconsistencies as well as suboptimal support for monorepo projects.
*
* This rule differs from `import/no-extraneous-dependencies` in the following ways:
* - only the first closest parent `package.json` found is taken into account
* - external modules must be declared in either `dependencies` or `peerDependencies`
* - supports optional criteria that determine whether a file should be linted
* - `includeFiles` and `excludeFiles` - `minimatch` compatible file glob patterns
* - `excludeModules` - external modules to exclude from linting
*
* @type {import('eslint').Rule.RuleModule}
*/
module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion packages/lib-extensions/src/index.ts
Expand Up @@ -3,7 +3,7 @@
*
* @remarks
* This package provides extension types and corresponding type guard functions
* used to interpret these extensions at runtime.
* used to interpret the corresponding extension objects at runtime.
*
* @packageDocumentation
*/
Expand Down
6 changes: 0 additions & 6 deletions test.sh
Expand Up @@ -21,11 +21,5 @@ yarn lint
# Run unit tests
yarn test

# Ensure that Git repo is still clean
if [[ -n "$(git status --porcelain)" ]]; then
echo "Git repository is not clean, make sure that all changes are committed"
exit 1
fi

# Upload code coverage
./prow-codecov.sh 2>/dev/null