-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add support for declaring specific endpoints to be built #120
Open
con322
wants to merge
14
commits into
main
Choose a base branch
from
feature/targeted-entrypoints
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.
Open
Changes from 9 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
870d9b1
feat: add entrypoint option to project paths (test-project@frontend)
con322 981b8f3
feat: attempt to handle standalon/all project builds
con322 205347a
feat: add ability to declare entrypoint(s) to build
con322 5a8243c
feat: add ability to declare entrypoint(s) to build
con322 1146934
chore: remove test code
con322 070f028
build: fix tests
con322 902f1d3
build: fix tests
con322 659e0fa
fix: remove unused import
con322 bea4b7f
docs: remove param comment from doc block as its no longer required
con322 a8f34d6
docs: add doc block for getFilteredEntryPoints function
con322 86a797f
fix: move variable and reuse
con322 e721498
docs: add build entrypoints command to docs
con322 8702c04
build: remove yarn.lock as yarn is not used
con322 ac7f777
build: remove yarn.lock as yarn is not used
con322 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 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 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,34 @@ | ||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | ||
# yarn lockfile v1 | ||
|
||
|
||
"js-tokens@^3.0.0 || ^4.0.0": | ||
"integrity" "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" | ||
"resolved" "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz" | ||
"version" "4.0.0" | ||
|
||
"loose-envify@^1.4.0": | ||
"integrity" "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==" | ||
"resolved" "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz" | ||
"version" "1.4.0" | ||
dependencies: | ||
"js-tokens" "^3.0.0 || ^4.0.0" | ||
|
||
"object-assign@^4.1.1": | ||
"integrity" "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==" | ||
"resolved" "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" | ||
"version" "4.1.1" | ||
|
||
"prop-types@^15.8.1": | ||
"integrity" "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==" | ||
"resolved" "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz" | ||
"version" "15.8.1" | ||
dependencies: | ||
"loose-envify" "^1.4.0" | ||
"object-assign" "^4.1.1" | ||
"react-is" "^16.13.1" | ||
|
||
"react-is@^16.13.1": | ||
"integrity" "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" | ||
"resolved" "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz" | ||
"version" "16.13.1" |
This file contains 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 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 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 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,21 @@ | ||
const { getFilteredEntryPoints } = require('../get-filtered-entrypoints'); | ||
|
||
describe('Get filtered entrypoints', () => { | ||
it('Return object with empty array if no filtered entry points', () => { | ||
const projects = 'test-project'; | ||
const result = getFilteredEntryPoints(projects); | ||
expect(result).toEqual({ 'test-project': [] }); | ||
}); | ||
|
||
it('Returns object with array of entrypoints', () => { | ||
const projects = 'test-project@frontend+editor'; | ||
const result = getFilteredEntryPoints(projects); | ||
expect(result).toEqual({ 'test-project': ['frontend', 'editor'] }); | ||
}); | ||
|
||
it('Return object with entrypoints where @ is present and empty array if non defined', () => { | ||
const projects = 'test-project@editor,test-project-2'; | ||
const result = getFilteredEntryPoints(projects); | ||
expect(result).toEqual({ 'test-project': ['editor'], 'test-project-2': []}); | ||
}); | ||
}); |
This file contains 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 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,27 @@ | ||
const getFilteredEntryPoints = (projects) => { | ||
ampersarnie marked this conversation as resolved.
Show resolved
Hide resolved
|
||
const filteredProjectEntryPoints = {}; | ||
const projectNames = projects.split(','); | ||
|
||
projectNames.forEach((project) => { | ||
const projectParts = project.split('@'); | ||
const projectName = projectParts[0]; | ||
const entryPoints = projectParts[1] ? projectParts[1].split('+') : []; | ||
|
||
if (!projectName) { | ||
return filteredProjectEntryPoints; | ||
} | ||
|
||
if (entryPoints.length === 0) { | ||
filteredProjectEntryPoints[projectName] = []; | ||
return; | ||
} | ||
|
||
return filteredProjectEntryPoints[projectName] = entryPoints; | ||
}); | ||
|
||
return filteredProjectEntryPoints; | ||
}; | ||
|
||
module.exports = { | ||
getFilteredEntryPoints, | ||
}; |
This file contains 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.
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.
Just spotted this, yarn isn't used in the project so can this be removed to avoid confusion.
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.
Removed this :)