-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(react): rename bundle builder to package (#2411)
- Loading branch information
1 parent
3d36b15
commit ed0f0f8
Showing
13 changed files
with
96 additions
and
16 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
docs/angular/api-web/builders/bundle.md → docs/angular/api-web/builders/package.md
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
4 changes: 2 additions & 2 deletions
4
docs/react/api-web/builders/bundle.md → docs/react/api-web/builders/package.md
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
4 changes: 2 additions & 2 deletions
4
docs/web/api-web/builders/bundle.md → docs/web/api-web/builders/package.md
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
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
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
packages/web/src/builders/bundle/schema.json → ...ages/web/src/builders/package/schema.json
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
54 changes: 54 additions & 0 deletions
54
packages/web/src/migrations/update-9-0-0/update-builder-9-0-0.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,54 @@ | ||
import { Tree } from '@angular-devkit/schematics'; | ||
import { SchematicTestRunner } from '@angular-devkit/schematics/testing'; | ||
import { | ||
updateJsonInTree, | ||
readJsonInTree, | ||
updateWorkspaceInTree, | ||
readWorkspace, | ||
getWorkspacePath | ||
} from '@nrwl/workspace'; | ||
|
||
import * as path from 'path'; | ||
import { stripIndents } from '@angular-devkit/core/src/utils/literals'; | ||
|
||
describe('Update 8-5-0', () => { | ||
let tree: Tree; | ||
let schematicRunner: SchematicTestRunner; | ||
|
||
beforeEach(async () => { | ||
tree = Tree.empty(); | ||
schematicRunner = new SchematicTestRunner( | ||
'@nrwl/web', | ||
path.join(__dirname, '../../../migrations.json') | ||
); | ||
}); | ||
|
||
it(`should remove differentialLoading as an option for build builder`, async () => { | ||
tree.create( | ||
'workspace.json', | ||
JSON.stringify({ | ||
projects: { | ||
demo: { | ||
root: 'apps/demo', | ||
sourceRoot: 'apps/demo/src', | ||
architect: { | ||
build: { | ||
builder: '@nrwl/web:build', | ||
options: { | ||
differentialLoading: true | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}) | ||
); | ||
|
||
tree = await schematicRunner | ||
.runSchematicAsync('update-builder-8.5.0', {}, tree) | ||
.toPromise(); | ||
|
||
const config = readWorkspace(tree); | ||
expect(config.projects.demo.architect.build.options).toEqual({}); | ||
}); | ||
}); |
21 changes: 21 additions & 0 deletions
21
packages/web/src/migrations/update-9-0-0/update-builder-9-0-0.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,21 @@ | ||
import { Rule } from '@angular-devkit/schematics'; | ||
import { updateWorkspaceInTree } from '@nrwl/workspace'; | ||
|
||
export default function update(): Rule { | ||
return updateWorkspaceInTree(workspaceJson => { | ||
Object.entries<any>(workspaceJson.projects).forEach( | ||
([projectName, project]) => { | ||
Object.entries<any>(project.architect).forEach( | ||
([targetName, targetConfig]) => { | ||
if (targetConfig.builder === '@nrwl/web:bundle') { | ||
workspaceJson.projects[projectName].architect[ | ||
targetName | ||
].builder = '@nrwl/web:package'; | ||
} | ||
} | ||
); | ||
} | ||
); | ||
return workspaceJson; | ||
}); | ||
} |