@almedso/apis-core

中文文档
0.5.6发布于 2018/02/07MITTypeScriptESM + CJS零依赖近 30 天下载 2195

Angular and Material2 based one core package

原始使用文档
文档目录7 节
  1. Docker
  2. Run Lint/test/build
  3. Development server
  4. Code scaffolding
  5. Build
  6. Running unit tests
  7. Running end-to-end tests

Apis Core Package

The apis core package manages access control and basic singleton like services

The application uses the following technologies:

  • typescript
  • angular
  • material design

For building and packaging

  • webpack
  • angular cli

For testing and code quality

  • karma/jasmine
  • protractor
  • tslint

For scaffolding

  • angular cli

Quick start

The development can happen with or without docker. (See Dockerfile for a container that runs the development application.)

Continous Integration and building/packaging is provided via tailored docker container using an image created from Dockerfile.build file.

Docker

Run Lint/test/build

$ docker-compose up 

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

If you run npm start it works as ng server but there are proxy settings applied to that redicrect server requests to port 3000.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive/pipe/service/class/module.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the -prod flag for a production build.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor. Before running the tests make sure you are serving the app via ng serve.

Docker Intergration

There are docker files for different images:

  • Dockerfile.build: Describes an image to actually run build steps (jshint, test, build-package)
  • Dockerfile.prod: Image that can be used to run the static page via nginx
    • It listens on port 80
    • exposes /var

Assets

The asset foulder is the place for files that are just plain-copied from source to dist. Assets hold

  • internationalization data (if not build in etc)
  • icons
  • config data about end points, static items (created at build time etc)

License

see LICENSE file

版本与发布记录

@almedso/apis-core 共发布 27 个版本,首次发布于 2017/12/15;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.5.6latest2018/02/078 年前
0.5.52018/02/078 年前
0.5.42018/01/318 年前
0.5.32018/01/318 年前
0.5.22018/01/288 年前
0.5.12018/01/258 年前

关于 @almedso/apis-core 的常见问题

@almedso/apis-core 是什么?

Angular and Material2 based one core package

如何安装 @almedso/apis-core?

在项目目录运行 npm install @almedso/apis-core,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@almedso/apis-shared(>0.1.0)、@angular/core(^5.0.5)、@angular/common(^5.0.5)、@angular/compiler(^5.0.0)、@angular/forms(^5.0.5)、@angular/material(^5.0.0)、@angular/platform-browser(^5.0.5)、@angular/platform-browser-dynamic(^5.0.5)、@angular/router(^5.0.5)、@ngx-translate/core(^9.0.0)、angular2-jwt(^0.2.3)、core-js(^2.5.1)、rxjs(^5.5.5)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@almedso/apis-core 支持 TypeScript 吗?

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

@almedso/apis-core 支持 ESM 还是 CommonJS?

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

@almedso/apis-core 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >= 7.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@almedso/apis-core 可以商用吗?

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

@almedso/apis-core 的下载量有多少?

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

@almedso/apis-core 还在维护吗?

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