32 Commits

Author SHA1 Message Date
Joey Perrott
22b9edfbe4 refactor(@schematics/angular): fix dependencies and import paths for strict deps requirements 2025-02-20 14:18:10 -05:00
Joey Perrott
33ed6e875e refactor: move builtin module imports to use node: prefix imports 2025-02-14 11:09:23 -08:00
Ash Ramirez
434a3740f0 refactor(@angular/cli): update aio links -> adev links
Updates for all angular.io links to the new angular.dev domain. Additionally, adjustment to new resources where the equivalent does not exist on the new site (e.g. Tour of Heroes tutorial)
2024-06-06 11:12:06 +02:00
Alan Agius
ac0db66975 feat(@schematics/angular): enable standalone by default in new applications
This commit update the schematics to generate a standalone application by default.
2023-09-22 16:42:35 +02:00
Charles Lyding
c9b2aa41da fix(@schematics/angular): Allow skipping existing dependencies in E2E schematic
The E2E schematic will now (as it did previously) skip adding dependencies
if they already exist within the `package.json` regardless of the specifier.
This is accomplished with the `existing` option for the `addDependency` rule
which allows defining the behavior for when a dependency already exists.
Currently the two option behaviors are skip and replace with replace being
the default to retain behavior for existing rule usages.
2022-07-19 13:29:37 -04:00
Charles Lyding
c3821caf98 refactor(@schematics/angular): use updated utilities in E2E schematic
Updates the E2E schematic to use the workspace and dependency utility rules exported from `@schematics/angular/utility`.
This change also removes the use of the custom path manipulation functions from `@angular-devkit/core`.
The development dependency versions for `protractor` and `jasmine-spec-reporter` are also moved to the latest
versions helper `package.json` file. This move allows the versions to be automatically updated via renovate
instead of hardcoded in the schematic source code.
2022-05-25 11:24:18 -07:00
Charles Lyding
1b2b8d96e5 refactor(@schematics/angular): track E2E ts-node version with latest-versions utility
This change allows renovate to automatically manage the dependency updates for the `ts-node` package used by the E2E schematic.
2022-05-06 11:00:55 -07:00
Charles Lyding
b07ccfbb1b feat(@schematics/angular): introduce a utility subpath export for Angular rules and utilities
The `@schematics/angular` package now contains a defined set of package `exports` including a `utility` subpath export.
A wildcard export is also temporarily defined to support transition away from existing deep-import usage.
The `@schematics/angular/utility` subpath export will contain supported utility methods used by the first-party schematics
contained within the `@schematics/angular` package and can be considered public API that will follow SemVer stability constraints.
The first group of utilities introduced in this change are used to modify the `angular.json` workspace file
within the schematics and include the `updateWorkspace` rule and `readWorkspace`/`writeWorkspace` helpers.
2022-05-03 14:04:47 -07:00
Charles Lyding
291bbffcc9 refactor(@schematics/angular): use string helper re-export from @angular-devkit/schematics
By using the `strings` re-export from `@angular-devkit/schematics` instead of from `@angular-devkit/core`,
the number of imports from `@angular-devkit/core` has been reduced and lowers the direct dependency count
for many of the individual schematics.
2022-04-22 11:31:53 -04:00
Charles Lyding
c927c038ba fix(@schematics/angular): remove @types/node from new projects
The `@types/node` package is now only added if E2E tests (`ng generate e2e`) or universal are added to a project.
2022-03-16 10:09:51 -04:00
Charles Lyding
37a06a7c37 build: format all files
All files are now formatted using the ng-dev tools via prettier.
2021-04-28 16:05:49 -07:00
Joey Perrott
003854257c build: migrate all file header to use Google LLC rather than Google Inc 2021-04-27 08:35:22 +02:00
cexbrayat
29cf8125ca fix(@schematics/angular): remove jasmine-spec-reporter and ts-node from default workspace
The dependencies are only needed for protractor tests, so they should only be added by the e2e schematics.
2021-04-22 10:56:36 +02:00
Keen Yee Liau
49ba5e20aa refactor(@schematics/angular): Do not include Protractor test in new project
Do not include Protractor for new projects since we do not have a concrete
plan for Protractor yet.
2021-04-21 12:38:46 -07:00
Alan Agius
226a8d274d feat(@schematics/angular): remove tslint and codelyzer from new projects
Both of these projects and the tslint builder are deprecated.

Closes #20105 and closes #18465
2021-03-16 15:49:46 +01:00
Alan Agius
1de6d71edd feat(@schematics/angular): production builds by default
With this change we do several changes to the `angular.json` configuration for `build` , `server` and `app-shell` targets so that these are `production` by default.

- build, server and app-shell targets are configured to run production by default.
- We add a new configuration named `development` to run the mentioned builder targets in development. Ex: `ng build --configuration development`.
- When adding `universal` or `app-shell`, we generate the full set of configurations as per the `buiid` target. Previously, we only generated the `production` configuration.
- We added a helper script in `package.json` to run build in watch mode. `npm run watch` which is a shortcut for `ng build --watch --configuration development`
2021-03-10 08:16:38 -06:00
timdeschryver
a0e2f28d26 fix(@schematics/angular): don't create e2e script when createApplication is false
Bugfix for the ng new --createApplication=false command.
Currently, it creates an e2e script in package.json. This change will only add the script when the application is created.

Closes #13412
2020-08-14 15:08:34 +02:00
Alan Agius
8b96e52d83 fix(@schematics/angular): remove solution style tsconfig from new projects
Following the issues highlighted in https://docs.google.com/document/d/1eB6cGCG_2ircfS5GzpDC9dBgikeYYcMxghVH5sDESHw/edit?usp=sharing and discussions held with the TypeScript team. The best course of action is to rollback this feature.

In future, it is not excluded that solution style tsconfigs are re-introduced..

Closes #18040 and closes #18170
2020-08-12 19:26:12 +01:00
Alan Agius
cc87202710 fix(@schematics/angular): don't add e2e tsconfig reference in solution tsconfig
Since the tsconfig for e2e’s is named tsconfig.json there is no reason why it should be included in the solutions typescript configuration file.

Closes #18190
2020-07-13 12:17:24 -04:00
Alan Agius
bede23226a feat(@schematics/angular): add solutions style tsconfig structure
In version 3.9, TypeScript introduced the concept of "Solutions Style" tsconfig to improve developer experience.

More info: https://devblogs.microsoft.com/typescript/announcing-typescript-3-9-rc/#solution-style-tsconfig

Closes #17493 and closes #8138
2020-05-20 12:12:33 -07:00
Alan
f03ff807b4 refactor(@schematics/angular): create relativePathToWorkspaceRoot helper and replace usages 2019-04-19 10:55:02 -07:00
Charles Lyding
bd79e0908a refactor(@schematics/angular): update e2e to use new workspace rules 2019-04-16 11:23:48 -07:00
Alan
a7d095d916 feat(@schematics/angular): change layout for root applications
This change aligns the file layout of applications generated with `ng new` and `ng generate`

Ref: TOOL-686
2019-03-06 11:28:26 -08:00
Alan Agius
edfc155f35 feat(@schematics/angular): rename tsconfig.e2e.json to tsconfig.json
This will help IDEs as they only pick up the standard name
2019-03-04 09:33:12 -08:00
Alan
026ae8cefc feat(@schematics/angular): change layout of e2e files
With this change E2E files will be relocated inside an existing application instead of creating a seperate E2E project. This will also remove a lot of extra boilerplating inside the workspace configuration file.

File layout:
```
│   browserslist
│   karma.conf.js
│   tsconfig.app.json
│   tsconfig.spec.json
│   tslint.json
│
├───e2e
│   │   protractor.conf.js
│   │   tsconfig.e2e.json
│   │
│   └───src
│           app.e2e-spec.ts
│           app.po.ts
│
└───src
    │   favicon.ico
    │   index.html
    │   main.po.ts
    │   main.ts
    │   polyfills.ts
    │   styles.css
    │   test.ts
    │
    ├───app
    │       app.component.css
    │       app.component.html
    │       app.component.spec.ts
    │       app.component.ts
    │       app.module.ts
    │
    ├───assets
    │       .gitkeep
    │
    └───environments
            environment.prod.ts
            environment.ts
```

Ref: TOOL-699
2019-03-04 09:33:12 -08:00
Alan Agius
36eba0c9fc refactor: use .template suffix for all schematic files
Currently when using `ivy-ngcc` it will print out a warning

```
Failed to read entry point info from //node_modules/@schematics/angular/workspace/files/package.json with error SyntaxError: Unexpected token < in JSON at position 1121.
```

Fixes #13378
2019-01-16 10:29:56 -08:00
Alan Agius
c6a92a6579 refactor: change code to work with TypeScript 3 and add missing models 2018-09-26 12:12:01 -04:00
Charles Lyding
f107d2de11 fix(@schematics/angular): use 'architect' instead of 'targets' until deprecated 2018-09-13 16:43:31 -07:00
Alan Agius
82f2bda2f5 refactor(@schematics/angular): make interaction with architect targets type safe 2018-09-12 12:37:24 -07:00
Charles Lyding
d202480a17 build: update/cleanup tslint rules & fix errors 2018-08-23 11:35:34 -07:00
Filipe Silva
307160806c feat(@schematics/angular): use targets property on new projects 2018-07-25 20:17:33 +01:00
Hans Larsen
44086c60ff build: move devkit repo back to angular-cli 2018-06-05 18:50:06 -07:00