-
Notifications
You must be signed in to change notification settings - Fork 9
feat: add plugin check command (Experimental)
#1228
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
tasshi-me
wants to merge
20
commits into
main
Choose a base branch
from
feat/plugin-check
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
6382bf7
feat: add `plugin check` command (Experimental)
tasshi-me b87b5de
chore: add TODO comments
tasshi-me a5d4c8a
feat: add custom eslint rules
tasshi-me bdd59e1
fix: suppress rule not found errors
tasshi-me 5d060e9
Merge remote-tracking branch 'origin/main' into feat/plugin-check
tasshi-me 97b652d
feat: add more forbidden selector regexes
tasshi-me 8955f81
docs: add document
tasshi-me ea3a660
Merge remote-tracking branch 'origin/main' into feat/plugin-check
tasshi-me f7e7113
fix tests
tasshi-me 35c7660
unlist from document
tasshi-me 9f75f50
update translation progress
tasshi-me 0a9f327
Merge remote-tracking branch 'origin/main' into feat/plugin-check
tasshi-me 805c675
refactor: transfer rules to js-sdk
tasshi-me e3af0ca
chore: use @kintone/eslint-plugin
tasshi-me b065b90
fix: use @kintone/eslint-plugin rules
tasshi-me a09f192
Merge remote-tracking branch 'origin/main' into feat/plugin-check
tasshi-me 89cde76
fix: only available on npm pacakge version
tasshi-me bd0a4d9
fix: type incompatiblity of ESLint config
tasshi-me 13de7f9
docs: improve plugin check document
tasshi-me ef34256
test: add E2E tests for plugin check
tasshi-me File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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,9 @@ | ||
| (function () { | ||
| // This code uses internal APIs that should be detected | ||
| const data = cybozu.data; | ||
| console.log(data); | ||
|
|
||
| // This code uses internal CSS selectors that should be detected | ||
| document.querySelector(".gaia-argoui-button"); | ||
| document.querySelector(".ocean-ui-dialog"); | ||
| })(); |
This file contains hidden or 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,15 @@ | ||
| { | ||
| "manifest_version": 1, | ||
| "version": 1, | ||
| "type": "APP", | ||
| "name": { | ||
| "en": "test-plugin" | ||
| }, | ||
| "description": { | ||
| "en": "Test plugin for E2E testing" | ||
| }, | ||
| "icon": "image/icon.png", | ||
| "desktop": { | ||
| "js": ["js/desktop.js"] | ||
| } | ||
| } |
This file contains hidden or 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,51 @@ | ||
| @isolated | ||
| @plugin-check | ||
| Feature: plugin check | ||
|
|
||
| Scenario: Show error message when running on standalone binary | ||
| Given An asset with key "plugin_project" is available as "src" | ||
| When I run the command with args "plugin check --input ./src/manifest.json" | ||
| Then I should get the exit code is non-zero | ||
| And The output error message should match with the pattern: "not available in the standalone binary version" | ||
|
|
||
| # The following scenarios require npm version of cli-kintone. | ||
| # They are skipped in E2E tests because E2E tests use standalone binary. | ||
|
|
||
| @skip | ||
| Scenario: Check a plugin with no issues | ||
| Given An asset with key "plugin_project" is available as "src" | ||
| When I run the command with args "plugin check --input ./src/manifest.json" | ||
| Then I should get the exit code is zero | ||
| And The output message should match with the pattern: | ||
| """ | ||
| Files checked: 3 | ||
| Problems: 0 | ||
| """ | ||
|
|
||
| @skip | ||
| Scenario: Check a plugin with issues | ||
| Given An asset with key "plugin_with_issues" is available as "src" | ||
| When I run the command with args "plugin check --input ./src/manifest.json" | ||
| Then I should get the exit code is zero | ||
| And The output message should match with the pattern: "cybozu.data" | ||
| And The output message should match with the pattern: "gaia-argoui-" | ||
| And The output message should match with the pattern: "Problems: 3" | ||
|
|
||
| @skip | ||
| Scenario: Check a plugin with JSON format output | ||
| Given An asset with key "plugin_with_issues" is available as "src" | ||
| When I run the command with args "plugin check --input ./src/manifest.json --format json" | ||
| Then I should get the exit code is zero | ||
| And The output message should match with the pattern: "\"errorCount\": 3" | ||
|
|
||
| @skip | ||
| Scenario: Check a plugin zip file | ||
| Given An asset with key "plugin_chjjmgadianhfiopehkbjlfkfioglafk_v1.zip" is available as "plugin.zip" | ||
| When I run the command with args "plugin check --input ./plugin.zip" | ||
| Then I should get the exit code is zero | ||
| And The output message should match with the pattern: "Files checked:" | ||
|
|
||
| Scenario: Input file is not specified | ||
| When I run the command with args "plugin check" | ||
| Then I should get the exit code is non-zero | ||
| And The output error message should match with the pattern: "Missing required argument: input" |
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eslintis now listed in bothdevDependenciesanddependencies(with different ranges). This can lead to duplicate installs and version skew between development and runtime. Sinceplugin checkneeds ESLint at runtime, consider keeping a single entry (typically independencies) and aligning/removing the devDependency version.