-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Ivy workspaces #15320
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
Ivy workspaces #15320
Changes from all commits
d792376
e746591
0a0d38b
0e1e0cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "extends": "./tsconfig.lib.json", | ||
| "angularCompilerOptions": { | ||
| "enableIvy": false | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -124,7 +124,7 @@ function addDependenciesToPackageJson() { | |
| }; | ||
| } | ||
|
|
||
| function addAppToWorkspaceFile( | ||
| function addLibToWorkspaceFile( | ||
| options: LibraryOptions, | ||
| projectRoot: string, | ||
| projectName: string, | ||
|
|
@@ -147,6 +147,11 @@ function addAppToWorkspaceFile( | |
| tsConfig: `${projectRoot}/tsconfig.lib.json`, | ||
| project: `${projectRoot}/ng-package.json`, | ||
| }, | ||
| configurations: { | ||
| production: { | ||
| tsConfig: `${projectRoot}/tsconfig.lib.prod.json`, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We also need a migration for this, right?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is already a separate PR for that, I made it separate since it can go in now in master. #15272 I also, created some utils, which would be needed for another schematic |
||
| }, | ||
| }, | ||
| }, | ||
| test: { | ||
| builder: Builders.Karma, | ||
|
|
@@ -199,7 +204,6 @@ export default function (options: LibraryOptions): Rule { | |
| const folderName = `${scopeFolder}${strings.dasherize(options.name)}`; | ||
| const projectRoot = join(normalize(newProjectRoot), folderName); | ||
| const distRoot = `dist/${folderName}`; | ||
|
|
||
| const sourceDir = `${projectRoot}/src/lib`; | ||
|
|
||
| const templateSource = apply(url('./files'), [ | ||
|
|
@@ -219,7 +223,7 @@ export default function (options: LibraryOptions): Rule { | |
|
|
||
| return chain([ | ||
| mergeWith(templateSource), | ||
| addAppToWorkspaceFile(options, projectRoot, projectName), | ||
| addLibToWorkspaceFile(options, projectRoot, projectName), | ||
| options.skipPackageJson ? noop() : addDependenciesToPackageJson(), | ||
| options.skipTsConfig ? noop() : updateTsConfig(packageName, distRoot), | ||
| schematic('module', { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,8 +10,5 @@ | |
| ], | ||
| "include": [ | ||
| "**/*.d.ts" | ||
| ], | ||
| "angularCompilerOptions": { | ||
| "enableIvy": true | ||
| } | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,8 +14,5 @@ | |
| "include": [ | ||
| "**/*.spec.ts", | ||
| "**/*.d.ts" | ||
| ], | ||
| "angularCompilerOptions": { | ||
| "enableIvy": true | ||
| } | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,5 +17,8 @@ | |
| "es2017", | ||
| "dom" | ||
| ] | ||
| }, | ||
| "angularCompilerOptions": { | ||
| "enableIvy": true | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,5 +17,8 @@ | |
| "es2017", | ||
| "dom" | ||
| ] | ||
| }, | ||
| "angularCompilerOptions": { | ||
| "enableIvy": false | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,5 +16,8 @@ | |
| "es2017", | ||
| "dom" | ||
| ] | ||
| }, | ||
| "angularCompilerOptions": { | ||
| "enableIvy": false | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ import { getGlobalVariable } from '../utils/env'; | |
| import { expectFileToExist } from '../utils/fs'; | ||
| import { gitClean } from '../utils/git'; | ||
| import { ng } from '../utils/process'; | ||
| import { prepareProjectForE2e } from '../utils/project'; | ||
| import { prepareProjectForE2e, updateJsonFile } from '../utils/project'; | ||
|
|
||
| export default async function() { | ||
| const argv = getGlobalVariable('argv'); | ||
|
|
@@ -18,13 +18,20 @@ export default async function() { | |
| } else { | ||
| const extraArgs = []; | ||
|
|
||
| if (argv['ivy']) { | ||
| extraArgs.push('--enable-ivy'); | ||
| } | ||
|
|
||
| await ng('new', 'test-project', '--skip-install', ...extraArgs); | ||
| await expectFileToExist(join(process.cwd(), 'test-project')); | ||
| process.chdir('./test-project'); | ||
|
|
||
| if (!argv['ivy']) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At some point we should flip this flag, so that we have to opt-in VE tests instead of opt-in Ivy ones.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea. I will do it later today or tmr.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As discussed offline, let’s tackle this in a separate PR were we enable the full test suit for Ivy and remove |
||
| await updateJsonFile('tsconfig.json', config => { | ||
| config.angularCompilerOptions.enableIvy = false; | ||
| }); | ||
|
|
||
| // In VE non prod builds are non AOT by default | ||
| await updateJsonFile('angular.json', config => { | ||
| config.projects['test-project'].architect.build.options.aot = false; | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| await prepareProjectForE2e('test-project'); | ||
|
|
||
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.
Note: the below options are not needed by ngtsc compiler, but we will leave them to make opt-out easier.