23 Commits

Author SHA1 Message Date
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
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
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
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
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
d1623c6b0c refactor(@schematics/angular): refactor some schematics to use the new JSON parser 2020-07-07 08:45:17 +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
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
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
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