-
-
Notifications
You must be signed in to change notification settings - Fork 44
feat: multiple dirs, prefix, watch & transpile support #2
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
8af431a
feat: patterns array, lazy & duplicates support
kevinmarrec 43051fc
feat: watch all top scanned folders
kevinmarrec 043253b
refactor: refactor lof of things
kevinmarrec 2f20b4a
fix: update default pattern
kevinmarrec d31dc3f
feat: use default nuxt ignore patterns
kevinmarrec 7c638d1
fix: upgrade @nuxt/types & fix transpile
kevinmarrec 8b03b6f
feat: use builder.supportedExtensions for default pattern
kevinmarrec 99a869c
chore: rollback docs change for now
kevinmarrec 11fcbcd
fix: check presence of builder.ignore.ignore
kevinmarrec 96e26c3
feat: handle top level options
kevinmarrec 136050c
chore: remove useless array spread
kevinmarrec 32fc7b5
chore: add not-array check
kevinmarrec bde1a62
feat: avoid double prefix
kevinmarrec 75c2fc5
feat: challenge accepted
kevinmarrec 3315a43
chore(deps): lock file maintenance
kevinmarrec 4e7882d
Merge branch 'master' into new-features
kevinmarrec 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
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
File renamed without changes.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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,5 @@ | ||
| <template> | ||
| <div> | ||
| Base Button | ||
| </div> | ||
| </template> |
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,5 @@ | ||
| <template> | ||
| <div> | ||
| Icon Home | ||
| </div> | ||
| </template> |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,8 @@ | ||
| <template> | ||
| <div> | ||
| <ComponentFoo /> | ||
| <ComponentBar /> | ||
| <component-baz /> | ||
| <Foo /> | ||
| <LazyBar /> | ||
| <BaseButton /> | ||
| <IconHome /> | ||
| </div> | ||
| </template> |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| import { matcher } from '../../src/scan' | ||
| import { scanFixtureComponents } from './scanner.test' | ||
| import { scanFixtureComponents } from './utils' | ||
|
|
||
| test('matcher', async () => { | ||
| const components = await scanFixtureComponents() | ||
| const tags = ['ComponentFoo', 'ComponentBar', 'component-baz'] | ||
| const tags = ['Foo', 'LazyBar', 'BaseButton', 'IconHome'] | ||
|
|
||
| const matchedComponents = matcher(tags, components).sort((a, b) => a.name < b.name ? -1 : 1) | ||
| expect(matchedComponents).toEqual(components.sort((a, b) => a.name < b.name ? -1 : 1)) | ||
| const matchedComponents = matcher(tags, components).sort((a, b) => a.pascalName < b.pascalName ? -1 : 1) | ||
|
|
||
| expect(matchedComponents).toHaveLength(4) | ||
| }) |
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 |
|---|---|---|
| @@ -1,15 +1,16 @@ | ||
| import path from 'path' | ||
| import { scanComponents } from '../../src/scan' | ||
|
|
||
| export function scanFixtureComponents () { | ||
| return scanComponents({ | ||
| cwd: path.resolve('test/fixture'), | ||
| pattern: 'components/**/*.{vue,ts,js}' | ||
| }) | ||
| } | ||
| import { scanFixtureComponents } from './utils' | ||
|
|
||
| test('scanner', async () => { | ||
| const components = await scanFixtureComponents() | ||
|
|
||
| expect(components).toHaveLength(3) | ||
| expect(components.map(c => c.pascalName)).toEqual([ | ||
| 'BaseButton', | ||
| 'LazyBaseButton', | ||
| 'IconHome', | ||
| 'LazyIconHome', | ||
| 'Bar', | ||
| 'LazyBar', | ||
| 'Foo', | ||
| 'LazyFoo' | ||
| ]) | ||
| }) |
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.
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.
Uh oh!
There was an error while loading. Please reload this page.