{"id":15093179,"url":"https://github.com/angular/angular-devkit-core-builds","last_synced_at":"2025-10-19T11:32:19.737Z","repository":{"id":37561612,"uuid":"118971226","full_name":"angular/angular-devkit-core-builds","owner":"angular","description":"Snapshots for @angular-devkit/core","archived":false,"fork":false,"pushed_at":"2024-12-23T18:41:46.000Z","size":5852,"stargazers_count":6,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-12-25T05:31:22.697Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/angular.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-25T21:44:11.000Z","updated_at":"2024-12-23T18:41:43.000Z","dependencies_parsed_at":"2023-12-10T22:28:34.223Z","dependency_job_id":"785d9a9e-a32e-46a2-8633-2318c6ef088f","html_url":"https://github.com/angular/angular-devkit-core-builds","commit_stats":{"total_commits":7439,"total_committers":3,"mean_commits":"2479.6666666666665","dds":0.03763946767038584,"last_synced_commit":"14d480bffef11a15a60f830bfea0e0f2b80f8ef5"},"previous_names":[],"tags_count":10483,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angular%2Fangular-devkit-core-builds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angular%2Fangular-devkit-core-builds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angular%2Fangular-devkit-core-builds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angular%2Fangular-devkit-core-builds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/angular","download_url":"https://codeload.github.com/angular/angular-devkit-core-builds/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237125363,"owners_count":19259273,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-25T11:04:01.410Z","updated_at":"2025-10-19T11:32:19.347Z","avatar_url":"https://github.com/angular.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Snapshot build of @angular-devkit/core\n\nThis repository is a snapshot of a commit on the original repository. The original code used to\ngenerate this is located at http://github.com/angular/angular-cli.\n\nWe do not accept PRs or Issues opened on this repository. You should not use this over a tested and\nreleased version of this package.\n\nTo test this snapshot in your own project, use\n\n```bash\nnpm install git+https://github.com/angular/angular-devkit-core-builds.git\n```\n\n----\n# Core\n\n\u003e Shared utilities for Angular DevKit.\n\n# Exception\n\n# Json\n\n## Schema\n\n### SchemaValidatorResult\n\n```\nexport interface SchemaValidatorResult {\n  success: boolean;\n  errors?: string[];\n}\n```\n\n### SchemaValidator\n\n```\nexport interface SchemaValidator {\n  (data: any): Observable\u003cSchemaValidatorResult\u003e;\n}\n```\n\n### SchemaFormatter\n\n```\nexport interface SchemaFormatter {\n  readonly async: boolean;\n  validate(data: any): boolean | Observable\u003cboolean\u003e;\n}\n```\n\n### SchemaRegistry\n\n```\nexport interface SchemaRegistry {\n  compile(schema: Object): Observable\u003cSchemaValidator\u003e;\n  addFormat(name: string, formatter: SchemaFormatter): void;\n}\n```\n\n### CoreSchemaRegistry\n\n`SchemaRegistry` implementation using https://github.com/epoberezkin/ajv.\nConstructor accepts object containing `SchemaFormatter` that will be added automatically.\n\n```\nexport class CoreSchemaRegistry implements SchemaRegistry {\n  constructor(formats: { [name: string]: SchemaFormatter} = {}) {}\n}\n```\n\n# Logger\n\n# Utils\n\n# Virtual FS\n\n# Workspaces\n\nThe `workspaces` namespace provides an API for interacting with the workspace file formats.\nIt provides an abstraction of the underlying storage format of the workspace and provides\nsupport for both reading and writing. Currently, the only supported format is the JSON-based\nformat used by the Angular CLI. For this format, the API provides internal change tracking of values which\nenables fine-grained updates to the underlying storage of the workspace. This allows for the\nretention of existing formatting and comments.\n\nA workspace is defined via the following object model. Definition collection objects are specialized\nJavascript `Map` objects with an additional `add` method to simplify addition and provide more localized\nerror checking of the newly added values.\n\n```ts\nexport interface WorkspaceDefinition {\n  readonly extensions: Record\u003cstring, JsonValue | undefined\u003e;\n  readonly projects: ProjectDefinitionCollection;\n}\n\nexport interface ProjectDefinition {\n  readonly extensions: Record\u003cstring, JsonValue | undefined\u003e;\n  readonly targets: TargetDefinitionCollection;\n  root: string;\n  prefix?: string;\n  sourceRoot?: string;\n}\n\nexport interface TargetDefinition {\n  options?: Record\u003cstring, JsonValue | undefined\u003e;\n  configurations?: Record\u003cstring, Record\u003cstring, JsonValue | undefined\u003e | undefined\u003e;\n  builder: string;\n}\n```\n\nThe API is asynchronous and has two main functions to facilitate reading, creation, and modifying\na workspace: `readWorkspace` and `writeWorkspace`.\n\n```ts\nexport enum WorkspaceFormat {\n  JSON,\n}\n```\n\n```ts\nexport function readWorkspace(\n  path: string,\n  host: WorkspaceHost,\n  format?: WorkspaceFormat,\n): Promise\u003c{ workspace: WorkspaceDefinition }\u003e;\n```\n\n```ts\nexport function writeWorkspace(\n  workspace: WorkspaceDefinition,\n  host: WorkspaceHost,\n  path?: string,\n  format?: WorkspaceFormat,\n): Promise\u003cvoid\u003e;\n```\n\nA `WorkspaceHost` abstracts the underlying data access methods from the functions. It provides\nmethods to read, write, and analyze paths. A utility function is provided to create\nan instance of a `WorkspaceHost` from the Angular DevKit's virtual filesystem host abstraction.\n\n```ts\nexport interface WorkspaceHost {\n  readFile(path: string): Promise\u003cstring\u003e;\n  writeFile(path: string, data: string): Promise\u003cvoid\u003e;\n  isDirectory(path: string): Promise\u003cboolean\u003e;\n  isFile(path: string): Promise\u003cboolean\u003e;\n}\n\nexport function createWorkspaceHost(host: virtualFs.Host): WorkspaceHost;\n```\n\n## Usage Example\n\nTo demonstrate the usage of the API, the following code will show how to add a option property\nto a build target for an application.\n\n```ts\nimport { NodeJsSyncHost } from '@angular-devkit/core/node';\nimport { workspaces } from '@angular-devkit/core';\n\nasync function demonstrate() {\n  const host = workspaces.createWorkspaceHost(new NodeJsSyncHost());\n  const { workspace } = await workspaces.readWorkspace('path/to/workspace/directory/', host);\n\n  const project = workspace.projects.get('my-app');\n  if (!project) {\n    throw new Error('my-app does not exist');\n  }\n\n  const buildTarget = project.targets.get('build');\n  if (!buildTarget) {\n    throw new Error('build target does not exist');\n  }\n\n  buildTarget.options.optimization = true;\n\n  await workspaces.writeWorkspace(workspace, host);\n}\n\ndemonstrate();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangular%2Fangular-devkit-core-builds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangular%2Fangular-devkit-core-builds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangular%2Fangular-devkit-core-builds/lists"}