Gathering detailed insights and metrics for @angular-devkit/core
Gathering detailed insights and metrics for @angular-devkit/core
Gathering detailed insights and metrics for @angular-devkit/core
Gathering detailed insights and metrics for @angular-devkit/core
npm install @angular-devkit/core
Typescript
Module System
Min. Node Version
Node Version
NPM Version
60.6
Supply Chain
99.6
Quality
96.6
Maintenance
100
Vulnerability
99.6
License
TypeScript (94.76%)
Starlark (2.25%)
HTML (1.57%)
JavaScript (1.07%)
EJS (0.25%)
Shell (0.06%)
jq (0.03%)
CSS (0.01%)
Total
1,777,072,305
Last Day
321,974
Last Week
9,938,456
Last Month
42,464,953
Last Year
451,691,723
26,792 Stars
15,817 Commits
11,982 Forks
1,003 Watching
28 Branches
659 Contributors
Minified
Minified + Gzipped
Latest Version
19.0.4
Package Id
@angular-devkit/core@19.0.4
Unpacked Size
253.60 kB
Size
53.81 kB
File Count
111
NPM Version
10.9.0
Node Version
20.17.0
Publised On
05 Dec 2024
Cumulative downloads
Total Downloads
Last day
-10.4%
321,974
Compared to previous day
Last week
2%
9,938,456
Compared to previous week
Last month
1.3%
42,464,953
Compared to previous month
Last year
8%
451,691,723
Compared to previous year
6
1
Shared utilities for Angular DevKit.
export interface SchemaValidatorResult {
success: boolean;
errors?: string[];
}
export interface SchemaValidator {
(data: any): Observable<SchemaValidatorResult>;
}
export interface SchemaFormatter {
readonly async: boolean;
validate(data: any): boolean | Observable<boolean>;
}
export interface SchemaRegistry {
compile(schema: Object): Observable<SchemaValidator>;
addFormat(name: string, formatter: SchemaFormatter): void;
}
SchemaRegistry
implementation using https://github.com/epoberezkin/ajv.
Constructor accepts object containing SchemaFormatter
that will be added automatically.
export class CoreSchemaRegistry implements SchemaRegistry {
constructor(formats: { [name: string]: SchemaFormatter} = {}) {}
}
The workspaces
namespace provides an API for interacting with the workspace file formats.
It provides an abstraction of the underlying storage format of the workspace and provides
support for both reading and writing. Currently, the only supported format is the JSON-based
format used by the Angular CLI. For this format, the API provides internal change tracking of values which
enables fine-grained updates to the underlying storage of the workspace. This allows for the
retention of existing formatting and comments.
A workspace is defined via the following object model. Definition collection objects are specialized
Javascript Map
objects with an additional add
method to simplify addition and provide more localized
error checking of the newly added values.
1export interface WorkspaceDefinition { 2 readonly extensions: Record<string, JsonValue | undefined>; 3 readonly projects: ProjectDefinitionCollection; 4} 5 6export interface ProjectDefinition { 7 readonly extensions: Record<string, JsonValue | undefined>; 8 readonly targets: TargetDefinitionCollection; 9 root: string; 10 prefix?: string; 11 sourceRoot?: string; 12} 13 14export interface TargetDefinition { 15 options?: Record<string, JsonValue | undefined>; 16 configurations?: Record<string, Record<string, JsonValue | undefined> | undefined>; 17 builder: string; 18}
The API is asynchronous and has two main functions to facilitate reading, creation, and modifying
a workspace: readWorkspace
and writeWorkspace
.
1export enum WorkspaceFormat { 2 JSON, 3}
1export function readWorkspace(
2 path: string,
3 host: WorkspaceHost,
4 format?: WorkspaceFormat,
5): Promise<{ workspace: WorkspaceDefinition }>;
1export function writeWorkspace(
2 workspace: WorkspaceDefinition,
3 host: WorkspaceHost,
4 path?: string,
5 format?: WorkspaceFormat,
6): Promise<void>;
A WorkspaceHost
abstracts the underlying data access methods from the functions. It provides
methods to read, write, and analyze paths. A utility function is provided to create
an instance of a WorkspaceHost
from the Angular DevKit's virtual filesystem host abstraction.
1export interface WorkspaceHost {
2 readFile(path: string): Promise<string>;
3 writeFile(path: string, data: string): Promise<void>;
4 isDirectory(path: string): Promise<boolean>;
5 isFile(path: string): Promise<boolean>;
6}
7
8export function createWorkspaceHost(host: virtualFs.Host): WorkspaceHost;
To demonstrate the usage of the API, the following code will show how to add a option property to a build target for an application.
1import { NodeJsSyncHost } from '@angular-devkit/core/node'; 2import { workspaces } from '@angular-devkit/core'; 3 4async function demonstrate() { 5 const host = workspaces.createWorkspaceHost(new NodeJsSyncHost()); 6 const { workspace } = await workspaces.readWorkspace('path/to/workspace/directory/', host); 7 8 const project = workspace.projects.get('my-app'); 9 if (!project) { 10 throw new Error('my-app does not exist'); 11 } 12 13 const buildTarget = project.targets.get('build'); 14 if (!buildTarget) { 15 throw new Error('build target does not exist'); 16 } 17 18 buildTarget.options.optimization = true; 19 20 await workspaces.writeWorkspace(workspace, host); 21} 22 23demonstrate();
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
30 out of 30 merged PRs checked by a CI test -- score normalized to 10
Reason
project has 65 contributing companies or organizations
Details
Reason
no dangerous workflow patterns detected
Reason
update tool detected
Details
Reason
license file detected
Details
Reason
30 commit(s) and 21 issue activity found in the last 90 days -- score normalized to 10
Reason
all dependencies are pinned
Details
Reason
security policy file detected
Details
Reason
GitHub workflow tokens follow principle of least privilege
Details
Reason
Found 29/30 approved changesets -- score normalized to 9
Reason
branch protection is not maximal on development and all release branches
Details
Reason
6 existing vulnerabilities detected
Details
Reason
badge detected: InProgress
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-12-08T14:32:49Z
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More