39 Commits

Author SHA1 Message Date
Alan Agius
ace34b7af3 docs: remove default project from schematic description
The default project is deprecated.
2023-01-03 14:49:19 +00:00
Alan Agius
207358afb8 feat(@angular-devkit/schematics): add runSchematic and runExternalSchematic methods
These async methods are a replacement for the Observable based `runSchematicAsync` and `runExternalSchematicAsync` methods.

DEPRECATED:
The Observable based `SchematicTestRunner.runSchematicAsync` and `SchematicTestRunner.runExternalSchematicAsync` method have been deprecated in favor of the Promise based `SchematicTestRunner.runSchematic` and `SchematicTestRunner.runExternalSchematic`.
2022-12-08 14:49:43 -08:00
Alan Agius
e751464ea3 fix(@angular/cli): populate path with working directory in nested schematics
With this change we change the how we handle `"format": "path"` schematic property option. We replace the formatter in favour of a `SmartDefaultProvider`, which ensures that nested schematics can access the `workingDirectory`.
2022-05-24 10:19:30 -07:00
Charles Lyding
a0e3de2b5f refactor(@schematics/angular): use Tree's newly introduced readText and readJSON functionality
Code related to decoding buffers into strings and parsing content into JSON can now be removed by using the
support provided directly from the Tree instance for the executing schematic.
2022-04-26 19:24:55 -04: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
51f89d633f test: enable no-useless-escape lint rule
The `no-useless-escape` eslint rule has now been enabled which removes unneeded characters and complexity from string literals and regular expressions. All files that were in violation of this rule have also been corrected.
2021-08-24 10:51:14 +01:00
Alan Agius
5986befcdc feat(@schematics/angular): remove deprecated options
With this change we removed several deprecated `@schematics/angular` deprecated options.

BREAKING CHANGE:

We removed several deprecated `@schematics/angular` deprecated options.
- `lintFix` have been removed from all schematics. `ng lint --fix` should be used instead.
- `legacyBrowsers` have been removed from the `application` schematics since IE 11 is no longer supported.
- `configuration` has been removed from the `web-worker` as it was unused.
- `target` has been removed from the `service-worker` as it was unused.
2021-07-30 14:26:53 +01:00
Alan Agius
82c438bedb refactor(@schematics/angular): clean up web-worker schematic
Remove code that used to handle version 8 applications. These should have migrated to the new structure when using ng-update.
2021-06-08 18:05:19 +02:00
Santosh Mahto
d13a866104 fix(@schematics/angular): working with formatting 2021-06-07 08:52:55 +02:00
Santosh Mahto
052b8fa4db fix(@schematics/angular): added webWorkerTsConfig into test option 2021-06-07 08:52:55 +02:00
Charles Lyding
c1512e4274 build: update files to be eslint compliant
All TypeScript files have been updated to pass the new eslint-based linting checks. eslint compatible disabling comments have also been added in place of the previous tslint comments.
2021-05-03 07:31:02 -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
Keen Yee Liau
5a57fea36b docs(@schematics/angular): add README and update description in schema
Create README for the package, and add missing description in some schema.
2021-04-19 20:34:35 +02:00
Alan Agius
076ab0f11f refactor: add correct schema keys
With this change
- We replace `id` with `$id`,  this no longer valid in draft-07.
- Replace all `$schemas` to `http://json-schema.org/draft-07/schema`, this is needed to "pin" the schema to `draft-07`.

More information about `draft-07` can be found https://json-schema.org/draft-07/json-schema-release-notes.html
2021-04-13 10:51:12 -04:00
Charles Lyding
df988c2493 fix(@schematics/angular): update web-worker to support Webpack 5
Webpack 5 now includes web worker support. However, the structure of the URL within the `Worker` constructor must be in a specific format.
Before: `new Worker('./app.worker', ...)`
After: `new Worker(new URL('./app.worker', import.meta.url), ...)`
2021-04-08 09:42:47 -04: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
ba6f546a02 fix(@schematics/angular): add additionalProperties to all schemas 2021-03-10 08:17:50 -06:00
Alan Agius
0bc15970ad refactor(@schematics/angular): use jsonc-parser instead of devkit parser 2020-11-05 08:31:02 +01: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
Charles Lyding
196b3b9f29 fix(@schematics/angular): improve compiler options migration error reporting
This change provides more fine-grained warnings during the `update-module-and-target-compiler-options` migration for V10.0 in the event a TypeScript configuration file could not be updated.  The `JSONFile` utility class was also augmented to directly throw when created to ensure that the `content` property is always initialized.
2020-08-10 09:43:11 +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
d1623c6b0c refactor(@schematics/angular): refactor some schematics to use the new JSON parser 2020-07-07 08:45:17 +02:00
Alan Agius
76f525cec2 fix(@schematics/angular): add links to generated tsconfig files
We now add a link to generated tsconfig.json to make is easier for users to find relevant information.
2020-06-15 08:48:14 +02: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
Keen Yee Liau
0662a8d774 build: g3 sync for packages/schematics and packages/angular
Fix all build errors in g3
2019-10-03 14:29:07 -07:00
Alan
ba8a6ea599 feat(@schematics/angular): remove enableIvy option
With this change we remove the enableIvy option as now we only support generating Ivy application. Users who want to create a VE applications should follow the opt-out guide
2019-08-16 09:31:02 -07:00
Charles Lyding
5a7b823b28 test: remove use of deprecated synchronous test helper runSchematic 2019-08-08 08:27:31 -07:00
Alan
3ecf29bb92 fix(@schematics/angular): support adding web-worker to pre version 8 applications
Fixes #14791
2019-06-17 11:05:50 -07:00
Alan
0d493cb2a2 refactor: update file filtering logic for webworker snippet Insertion 2019-05-21 09:03:39 -04:00
Santosh Yadav
e8b7cd92e5 fix(@schematics/angular): webworker snippet should not generate to module
Fixes #14467
2019-05-21 09:03:39 -04:00
Alan
f03ff807b4 refactor(@schematics/angular): create relativePathToWorkspaceRoot helper and replace usages 2019-04-19 10:55:02 -07:00
Alan
407d1d5b49 fix(@schematics/angular): generate tsconfig.worker.json outside of the src folder
This is to align with the folder structure of version 8, were tsconfigs are outside of the `src` folder

Also, this change remove the dud `tsconfig.json` in the `src` folder and instead we add the triple slash lib reference `/// <reference lib="webworker" />` for IDE support.
2019-04-18 11:47:22 -07:00
George Kalpakas
31d882e3ec docs(@schematics/angular): fix typo in web worker schematics ("service worker" --> "web worker") 2019-04-18 11:46:12 -07:00
Alan Agius
e2a0ac1ec6 fix(@schematics/angular): add tsconfig.worker.json to list of tsconfigs to lint 2019-04-16 13:29:07 -07:00
Charles Lyding
ca1ecb027d test(@schematics/angular): ensure application schematic is run async 2019-04-16 11:23:48 -07:00
Charles Lyding
5d199b23aa refactor(@schematics/angular): update webworker to use new workspace rules 2019-04-15 11:02:46 -07:00
cexbrayat
fcbe988d10 fix(@schematics/angular): properly log data received in web worker snippet
The generated snippet was:

    worker.onmessage = ({ data }) => {
      console.log('page got message: $\{data\}');
    };

which doesn't use a template string and so does not log `data`.
Fixes the generated snippet to be `console.log(`page got message: ${data}`);`.
Also adds a newline at the end of the web worker template to not fail the default TSLint rules if the schematic is used.
2019-04-12 12:20:25 -07:00
Filipe Silva
7ed4a60095 feat(@schematics/angular): add web worker schematics 2019-04-02 04:49:34 -07:00