-
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.
fix(angular): adjust generated tsconfig path mapping for publ libs
ISSUES CLOSED: #2794
- Loading branch information
Showing
15 changed files
with
289 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -252,6 +252,7 @@ | |
} | ||
}, | ||
"dependencies": { | ||
"@nrwl/nx-cloud": "^9.3.2" | ||
"@nrwl/nx-cloud": "^9.3.2", | ||
"speakingurl": "^14.0.1" | ||
} | ||
} |
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
12 changes: 5 additions & 7 deletions
12
packages/angular/src/schematics/library/lib/update-lib-package-npm-scope.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 |
---|---|---|
@@ -1,12 +1,10 @@ | ||
import { Rule, Tree } from '@angular-devkit/schematics'; | ||
import { getNpmScope, updateJsonInTree } from '@nrwl/workspace'; | ||
import { updateJsonInTree } from '@nrwl/workspace'; | ||
import { NormalizedSchema } from './normalized-schema'; | ||
|
||
export function updateLibPackageNpmScope(options: NormalizedSchema): Rule { | ||
return (host: Tree) => { | ||
return updateJsonInTree(`${options.projectRoot}/package.json`, (json) => { | ||
json.name = `@${getNpmScope(host)}/${options.name}`; | ||
return json; | ||
}); | ||
}; | ||
return updateJsonInTree(`${options.projectRoot}/package.json`, (json) => { | ||
json.name = options.importPath; | ||
return 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
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
40 changes: 40 additions & 0 deletions
40
packages/workspace/src/utils/validate-npm-pkg-name.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,40 @@ | ||
import { validateNpmPackageName } from './validate-npm-pkg-name'; | ||
|
||
/** | ||
* Rules: https://docs.npmjs.com/files/package.json#name | ||
*/ | ||
|
||
describe('Validate npm package name', () => { | ||
['a'.repeat(214), '@myorg/awesomeness', 'awesomelib'].forEach((pkgName) => { | ||
it(`should succeed for ${pkgName}`, () => { | ||
expect(validateNpmPackageName(pkgName)).toBeTruthy(); | ||
}); | ||
}); | ||
|
||
[ | ||
{ | ||
name: 'a'.repeat(215), | ||
error: /more than 214 characters/, | ||
}, | ||
{ name: '_myawesomepkg', error: /cannot start with a dot nor underscore/ }, | ||
{ name: '.myawesomepkg', error: /cannot start with a dot nor underscore/ }, | ||
{ name: 'Mypackage', error: /uppercase letters/ }, | ||
{ name: '@my/super/org', error: /scoped package name has an extra/ }, | ||
{ | ||
name: '@my/SuperPkg', | ||
error: /package name cannot have uppercase letters/, | ||
}, | ||
].forEach((pkgTest) => { | ||
it(`should fail for ${pkgTest.name}`, () => { | ||
function execValidation() { | ||
validateNpmPackageName(pkgTest.name); | ||
} | ||
|
||
if (pkgTest.error) { | ||
expect(execValidation).toThrowError(pkgTest.error); | ||
} else { | ||
expect(execValidation).toThrowError(); | ||
} | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.