@angular-architects/sam4sc

中文文档
0.0.1发布于 2022/02/12MITTypeScriptESM + CJS近 30 天下载 4440

Sam4Sc is a migration assistant for Angular to SCAM (Single Angular Component Modules) and Standalone Components.

原始使用文档
文档目录6 节
  1. 1. Introduction
  2. 2. Setup and Usage
  3. 2.1. Generate SCAMs
  4. 2.2. Show the progress report for the SCAM report
  5. 2.3. Migrate to Standalone Components (Beta)
  6. 3. More information

1. Introduction

Sam4Sc is a migration assistant for Angular to SCAM (Single Angular Component Modules) and Standalone Components.

Migrating an Angular application to the SCAM model is a preparation for the final switch to Standalone Components.

Sam4Sc assists in both steps, whereas the migration from SCAM to Standalone Components is fully automatic.

The migration/generation of SCAMs is semi-automatic. The SCAMs a generated first. After that, the developer(s) must define the dependencies per SCAM manually.

2. Setup and Usage

To install Sam4Sc, execute

npm i -D @angular-architects@sam4sc

2.1. Generate SCAMs

npx ng generate @angular-architects/sam4sc:scam --dry-run
# make sure, everything looks alright
npx ng generate @angular-architects/sam4sc:scam

or alternatively,

npx ng generate @angular-architects:sam4sc:scam --project [projectName]

2.2. Show the progress report for the SCAM report

npx ng generate @angular-architects/sam4sc:report

SCAMs will have a JavaScript comment at the start of the file with a tag SAM4SC:SCAM. Remove those, if you have added the dependencies and that module will not show up in the progress report.

2.3. Migrate to Standalone Components (Beta)

npx ng generate @angular-architects/sam4s:scam2sc

Please feel free to try it out and give feedback.

3. More information

Angular Architects: Angular Content, Consultancy, Training

版本与发布记录

@angular-architects/sam4sc 共发布 1 个版本,首次发布于 2022/02/12;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.0.1latest2022/02/124 年前

关于 @angular-architects/sam4sc 的常见问题

@angular-architects/sam4sc 是什么?

Sam4Sc is a migration assistant for Angular to SCAM (Single Angular Component Modules) and Standalone Components.

如何安装 @angular-architects/sam4sc?

在项目目录运行 npm install @angular-architects/sam4sc,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@angular/core(>=12.2.0)、@angular/common(>=12.2.0)、@phenomnomnominal/tsquery(^4.2.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@angular-architects/sam4sc 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@angular-architects/sam4sc 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@angular-architects/sam4sc 可以商用吗?

@angular-architects/sam4sc 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@angular-architects/sam4sc 的下载量有多少?

根据 npm 官方下载统计,@angular-architects/sam4sc 在 2026/10/06 – 2026/11/04 这 30 天内被下载 4,440 次,日均约 148 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@angular-architects/sam4sc 还在维护吗?

最新版本 0.0.1 发布于 2022/02/12(4 年前);至今共发布 1 个版本,其中过去 12 个月发布了 0 个;首次发布于 2022/02/12。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。