-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bundling): add support only bundling in workspace libs, not npm …
…packages (#12852)
- Loading branch information
Showing
13 changed files
with
260 additions
and
37 deletions.
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
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
83 changes: 83 additions & 0 deletions
83
packages/esbuild/src/executors/esbuild/lib/get-extra-dependencies.spec.ts
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,83 @@ | ||
import { getExtraDependencies } from './get-extra-dependencies'; | ||
|
||
describe('getExtraDependencies', () => { | ||
it('should include npm dependencies of child libs', () => { | ||
const result = getExtraDependencies('parent', { | ||
nodes: { | ||
parent: { | ||
type: 'app', | ||
name: 'parent', | ||
data: {}, | ||
}, | ||
child1: { | ||
type: 'lib', | ||
name: 'child1', | ||
data: {}, | ||
}, | ||
child2: { | ||
type: 'lib', | ||
name: 'child2', | ||
data: {}, | ||
}, | ||
}, | ||
externalNodes: { | ||
'npm:react': { | ||
type: 'npm', | ||
name: 'npm:react', | ||
data: { packageName: 'react', version: '18.0.0' }, | ||
}, | ||
'npm:axios': { | ||
type: 'npm', | ||
name: 'npm:axios', | ||
data: { packageName: 'axios', version: '1.0.0' }, | ||
}, | ||
'npm:dayjs': { | ||
type: 'npm', | ||
name: 'npm:dayjs', | ||
data: { packageName: 'dayjs', version: '1.11.0' }, | ||
}, | ||
}, | ||
dependencies: { | ||
parent: [ | ||
{ source: 'parent', target: 'child1', type: 'static' }, | ||
{ source: 'parent', target: 'npm:react', type: 'static' }, | ||
], | ||
child1: [ | ||
{ source: 'child1', target: 'child2', type: 'static' }, | ||
{ source: 'child1', target: 'npm:axios', type: 'static' }, | ||
], | ||
child2: [{ source: 'child2', target: 'npm:dayjs', type: 'static' }], | ||
}, | ||
}); | ||
|
||
expect(result).toEqual([ | ||
{ | ||
name: 'npm:react', | ||
outputs: [], | ||
node: { | ||
type: 'npm', | ||
name: 'npm:react', | ||
data: { packageName: 'react', version: '18.0.0' }, | ||
}, | ||
}, | ||
{ | ||
name: 'npm:axios', | ||
outputs: [], | ||
node: { | ||
type: 'npm', | ||
name: 'npm:axios', | ||
data: { packageName: 'axios', version: '1.0.0' }, | ||
}, | ||
}, | ||
{ | ||
name: 'npm:dayjs', | ||
outputs: [], | ||
node: { | ||
type: 'npm', | ||
name: 'npm:dayjs', | ||
data: { packageName: 'dayjs', version: '1.11.0' }, | ||
}, | ||
}, | ||
]); | ||
}); | ||
}); |
Oops, something went wrong.
58b5196
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.
Successfully deployed to the following URLs:
nx-dev – ./
nx-five.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx.dev
nx-dev-nrwl.vercel.app