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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bit bundle #7180

Draft
wants to merge 116 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
151bf9b
import all core aspects main runtimes to make sure it's part of the b…
GiladShoham Jan 19, 2023
fbaedad
now that we import all the core aspect main runtimes we don't need to…
GiladShoham Jan 19, 2023
613ee4e
require yargs instead of import it as it causes bundling issues
GiladShoham Jan 19, 2023
b053368
WIP - first bundling script (with hard coded stuff)
GiladShoham Jan 19, 2023
83935fc
externals updates
GiladShoham Jan 19, 2023
95b3f0d
remove tsconfig from eslint config (it will anyway generated on runtime)
GiladShoham Jan 19, 2023
3d174e4
update externals
GiladShoham Jan 19, 2023
cadc837
move imports
GiladShoham Jan 19, 2023
e861f01
Merge branch 'master' into bit-bundle
GiladShoham Mar 21, 2023
9589d7c
add esbuild plugins to policy
GiladShoham Mar 26, 2023
2484fe6
adjust bundle script
GiladShoham Mar 26, 2023
8e37f88
Merge branch 'master' into bit-bundle
GiladShoham Jul 16, 2023
dba67b1
Merge branch 'master' into bit-bundle
GiladShoham Jul 16, 2023
0009c69
fixes
GiladShoham Jul 16, 2023
96a78d7
Merge branch 'master' into bit-bundle
GiladShoham Jul 20, 2023
e34dc54
manifests fixes
GiladShoham Jul 20, 2023
6dd2505
move jest config inside instead of top
GiladShoham Jul 20, 2023
1dbdd6d
expose manifests map as a function (to support the bundling hoisting …
GiladShoham Jul 20, 2023
1b0549f
add more ignores
GiladShoham Jul 20, 2023
5614efc
fix config aspect instances
GiladShoham Jul 20, 2023
2b6c8ea
restructure bundle files and add readme
GiladShoham Jul 23, 2023
5ecf019
restore core aspects to manifests
GiladShoham Jul 23, 2023
76b3e02
bundle - generateCoreAspectsBarrelFile
GiladShoham Jul 23, 2023
f91bf9e
ignore bundle outputs
GiladShoham Jul 23, 2023
18c027b
generate core aspects modules
GiladShoham Jul 23, 2023
8c7b59b
export from generate core aspects barrel file
GiladShoham Jul 23, 2023
0d51e30
handle exports / modules for harmony / legacy
GiladShoham Jul 23, 2023
52b88a6
fix generated modules path
GiladShoham Jul 23, 2023
c1db47a
do not load core aspects defs when exclude core is true
GiladShoham Jul 23, 2023
b1b40b2
add todo about sourcemaps
GiladShoham Jul 23, 2023
3a87c27
fix gitignore
GiladShoham Jul 23, 2023
52a6fe1
update core aspects exports
GiladShoham Jul 23, 2023
10076bd
do not add core envs aspect defs to env runtime
GiladShoham Jul 23, 2023
942d6c9
add esbuild config files plugin
GiladShoham Jul 24, 2023
9162021
esbuild plugin handle module paths config files
GiladShoham Jul 24, 2023
abe239f
handle more files to copy
GiladShoham Jul 24, 2023
7fe2467
improve config files esbuild plugin
GiladShoham Jul 24, 2023
78eac1c
handle more config files (also from node_modules)
GiladShoham Jul 24, 2023
cf83bdb
externalize more packages
GiladShoham Jul 24, 2023
dcbfbac
remove file extensions from jest config
GiladShoham Jul 24, 2023
5efed4e
force some react env jest config bundling (hack)
GiladShoham Jul 24, 2023
d0d7e29
Merge branch 'master' into bit-bundle
GiladShoham Jul 25, 2023
1706167
Merge branch 'master' into bit-bundle
GiladShoham Jul 26, 2023
d9743e5
Merge branch 'master' into bit-bundle
GiladShoham Jul 26, 2023
d2ba72d
clean logs
GiladShoham Jul 26, 2023
f6315f3
output esbuild duration
GiladShoham Jul 26, 2023
465b11d
create package.json with external deps
GiladShoham Jul 26, 2023
1775e68
generate npmrc with bit's registry
GiladShoham Jul 26, 2023
4a342a6
copy pacakge.json of core aspects
GiladShoham Jul 26, 2023
8cdda40
move externals to a dedicated file
GiladShoham Jul 26, 2023
a640fa5
update main flow
GiladShoham Jul 26, 2023
ed4c523
update readme
GiladShoham Jul 26, 2023
d0b7dcb
add missing core aspects
GiladShoham Jul 26, 2023
c0c702a
add bundle script
GiladShoham Jul 27, 2023
a266483
Merge branch 'master' into bit-bundle
GiladShoham Aug 7, 2023
9d05d28
Merge branch 'master' into bit-bundle
GiladShoham Aug 7, 2023
798d9c8
trying tsup
GiladShoham Aug 7, 2023
c41f2e6
ensure folder exists
GiladShoham Aug 7, 2023
2b98ada
Merge branch 'master' into bit-bundle
GiladShoham Aug 10, 2023
ced0b86
move back to esbuild
GiladShoham Aug 13, 2023
7e0759d
Merge branch 'master' into bit-bundle
GiladShoham Aug 14, 2023
a08f376
add more externals
GiladShoham Aug 14, 2023
e707df9
update browserslist version
GiladShoham Aug 14, 2023
953986c
add copy files of core aspects
GiladShoham Aug 14, 2023
34490c3
improve copy files for core aspects
GiladShoham Aug 14, 2023
dc2b486
improve copy files
GiladShoham Aug 14, 2023
5c6bd02
improve core aspect path calc
GiladShoham Aug 14, 2023
540b342
derefrence copied files
GiladShoham Aug 14, 2023
d68863e
readability
GiladShoham Aug 14, 2023
58d7751
add more externals required for tests (jest config)
GiladShoham Aug 14, 2023
160f6fa
handle asset.d.ts and style.d.ts files
GiladShoham Aug 15, 2023
1f1f621
copy ts d.ts files
GiladShoham Aug 15, 2023
7b80033
add minify in comment
GiladShoham Aug 15, 2023
bf82ed9
Merge branch master into bit-bundle
GiladShoham Jan 21, 2024
e29685b
Merge branch 'master' into bit-bundle
GiladShoham Jan 21, 2024
5836d5d
remove elements leftovers
GiladShoham Jan 21, 2024
f0969a4
improve config files esbuild plugin resolution
GiladShoham Jan 21, 2024
53237f9
remove elements left overs
GiladShoham Jan 21, 2024
2b09cea
add missing exports in esm files
GiladShoham Jan 28, 2024
f97c391
Merge branch 'master' into bit-bundle
GiladShoham Jan 28, 2024
5a8e42e
Merge branch 'master' into bit-bundle
GiladShoham Feb 13, 2024
296c48a
add missing export in merging esm.mjs
GiladShoham Feb 13, 2024
74494ad
add missing externals
GiladShoham Feb 13, 2024
b42c56a
handle jest cjs transformer
GiladShoham Feb 13, 2024
946cfc9
fixes for workspace config proto
GiladShoham Feb 19, 2024
212e41a
Merge branch 'master' into bit-bundle
GiladShoham Feb 19, 2024
cf98ad4
refactor(core-aspects) - use named import to import aspects manifests
GiladShoham Feb 20, 2024
5089cdb
add config merger aspect to core ids
GiladShoham Feb 21, 2024
edb0d68
esm fixes on package.json and esm.mjs file copy
GiladShoham Feb 21, 2024
5f27727
improve core aspect loading when using bundle
GiladShoham Feb 21, 2024
d9dea87
generate sea and pkg configs (WIP)
GiladShoham Feb 29, 2024
0e7feeb
Merge branch 'master' of https://github.com/teambit/bit into bit-bundle
GiladShoham Feb 29, 2024
1473cf0
bump esbuild
GiladShoham Feb 29, 2024
3558b09
add binary script to readme
GiladShoham Mar 4, 2024
c4e190e
generate esbuild metafile for bundle analysis
GiladShoham Mar 5, 2024
0b6cbfd
Merge branch 'master' into bit-bundle
GiladShoham Mar 7, 2024
08a26da
Merge branch 'master' of https://github.com/teambit/bit into bit-bundle
GiladShoham Mar 10, 2024
4858ce2
Merge branch 'master' of https://github.com/teambit/bit into bit-bundle
GiladShoham Mar 10, 2024
59a2528
Merge branch 'master' of https://github.com/teambit/bit into bit-bundle
GiladShoham Mar 12, 2024
6b0771d
Merge branch 'master' of https://github.com/teambit/bit into bit-bundle
GiladShoham Mar 12, 2024
61bb165
Merge branch 'master' into bit-bundle
GiladShoham May 15, 2024
0f7aaf5
fix getting bit version from bundle
GiladShoham May 16, 2024
2b5b9c1
Merge commit 'b01aa9901ad7937cdb18c9142f48a4e7edb93b71' into bit-bundle
GiladShoham May 16, 2024
195bd58
Merge branch 'master' into bit-bundle
GiladShoham Dec 16, 2024
3d2a32a
update esbuild
GiladShoham Dec 16, 2024
417c9f3
remove old file
GiladShoham Dec 16, 2024
07d43f0
remove react-native
GiladShoham Dec 16, 2024
62a8ef6
fixes
GiladShoham Dec 16, 2024
6217a28
fixes
GiladShoham Dec 16, 2024
c2a9e53
Merge branch 'master' of https://github.com/teambit/bit into bit-bundle
GiladShoham Dec 17, 2024
1b2c3a6
remove react native
GiladShoham Dec 17, 2024
de8b463
replace getConsumerInfo with getWorkspaceInfo
GiladShoham Dec 17, 2024
b65b4d1
Merge branch 'master' of https://github.com/teambit/bit into bit-bundle
GiladShoham Dec 17, 2024
0f7240a
fixes
GiladShoham Dec 17, 2024
43c0aab
more fixes
GiladShoham Dec 17, 2024
2ea0c3c
update manifests file
GiladShoham Dec 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
do not load core aspects defs when exclude core is true
GiladShoham committed Jul 23, 2023
commit c1db47a4e134cd7a9c93f7cdc6c260eb380c31ed
26 changes: 16 additions & 10 deletions scopes/workspace/workspace/workspace-aspects-loader.ts
Original file line number Diff line number Diff line change
@@ -242,9 +242,6 @@ needed-for: ${neededFor || '<unknown>'}. using opts: ${JSON.stringify(mergedOpts
const callId = Math.floor(Math.random() * 1000);
const loggerPrefix = `[${callId}] workspace resolveAspects,`;

this.logger.debug(
`${loggerPrefix}, resolving aspects for - runtimeName: ${runtimeName}, componentIds: ${componentIds}`
);
const defaultOpts: ResolveAspectsOptions = {
excludeCore: false,
requestedOnly: false,
@@ -254,6 +251,13 @@ needed-for: ${neededFor || '<unknown>'}. using opts: ${JSON.stringify(mergedOpts
resolveEnvsFromRoots: this.resolveEnvsFromRoots,
};
const mergedOpts = { ...defaultOpts, ...opts };
this.logger.debug(
`${loggerPrefix}, resolving aspects for - runtimeName: ${runtimeName}, componentIds: ${componentIds}, opts: ${JSON.stringify(
mergedOpts,
null,
2
)}`
);
const idsToResolve = componentIds ? componentIds.map((id) => id.toString()) : this.harmony.extensionsIds;
const coreAspectsIds = this.aspectLoader.getCoreAspectIds();
const configuredAspects = this.aspectLoader.getConfiguredAspects();
@@ -274,13 +278,15 @@ needed-for: ${neededFor || '<unknown>'}. using opts: ${JSON.stringify(mergedOpts
components,
this.getWorkspaceAspectResolver([], runtimeName)
);

const coreAspectDefs = await Promise.all(
coreAspectsIds.map(async (coreId) => {
const rawDef = await getAspectDef(coreId, runtimeName);
return this.aspectLoader.loadDefinition(rawDef);
})
);
let coreAspectDefs: AspectDefinition[] = [];
if (!mergedOpts.excludeCore) {
coreAspectDefs = await Promise.all(
coreAspectsIds.map(async (coreId) => {
const rawDef = await getAspectDef(coreId, runtimeName);
return this.aspectLoader.loadDefinition(rawDef);
})
);
}

const idsToFilter = idsToResolve.map((idStr) => ComponentID.fromString(idStr));
const targetDefs = wsAspectDefs.concat(coreAspectDefs);