-
Notifications
You must be signed in to change notification settings - Fork 75
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
More bundler features #1410
Open
naugtur
wants to merge
9
commits into
master
Choose a base branch
from
naugtur-bundler-features
base: master
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
More bundler features #1410
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
054256f
chore(compartment-mapper): add a quality of life tool for developing …
naugtur 037be50
feat(compartment-mapper): json support in bundler
naugtur 3a496da
test(compartment-mapper): snapshot test for bundle ouput
kumavis b054d66
refactor(compartment-mapper): refactor bundler to produce less output
kumavis 21b6540
fix(compartment-mapper): add bundle option to strip any sourceURL pra…
kumavis c47ecf5
feat(compartment-mapper): normalize bundle line endings
kumavis 6facdc8
fix(compartment-mapper): bundle-mjs remove extraneous function defini…
kumavis 2462caa
test(compartment-mapper): add local (within package) cycles to bundle…
naugtur b5b5a8e
test(compartment-mapper): add cycles across package boundaries to bun…
naugtur 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,26 @@ | ||
import 'ses'; | ||
import fs from 'fs'; | ||
import url from 'url'; | ||
import { makeBundle } from '../index.js'; | ||
import { makeReadPowers } from '../node-powers.js'; | ||
|
||
const fixture = new URL( | ||
'../test/fixtures-0/node_modules/bundle/main.js', | ||
import.meta.url, | ||
).toString(); | ||
const target = new URL('../dist/bu.js', import.meta.url).toString(); | ||
|
||
const readPowers = makeReadPowers({ fs, url }); | ||
|
||
const bundle = await makeBundle(readPowers.read, fixture); | ||
fs.writeFileSync(url.fileURLToPath(target), bundle); | ||
// fs.writeFileSync(url.fileURLToPath(`${target}.${Date.now()}`), bundle); | ||
|
||
console.log(` | ||
####################### | ||
size: ${bundle.length} | ||
`); | ||
|
||
// eslint-disable-next-line no-undef | ||
global.print = console.log; | ||
import(target); |
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,16 @@ | ||
export default { | ||
runtime: '', | ||
getBundlerKit({ index, record: { sourceText } }) { | ||
return { | ||
getFunctor: () => `\ | ||
// === functors[${index}] === | ||
${sourceText}, | ||
`, | ||
getCells: () => ['default'], | ||
getReexportsWiring: () => '', | ||
getFunctorCall: () => `\ | ||
cells[${index}].default.set(functors[${index}]); | ||
`, | ||
}; | ||
}, | ||
}; |
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.
example bundle is no longer being committed, but I kinda regret that. It'd show what changed in the PR really well.
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.
snapshot tests!