项目作者: wunderdogsw

项目描述 :
Typescript standard library
高级语言: TypeScript
项目地址: git://github.com/wunderdogsw/proem.git
创建时间: 2018-10-30T17:20:20Z
项目社区:https://github.com/wunderdogsw/proem

开源协议:MIT License

下载


CircleCI branch
Commitizen friendly
npm

Proem

TypeScript standard library.

Developing

You need yarn

Commits should be made with commitizen.
There is a node script for it in package.json, so instead of git commit just write:

  1. yarn commit

You can write the commit message yourself, but it has to comply with the “conventional” commit structure.
See https://github.com/conventional-changelog/commitlint#what-is-commitlint

Don’t forget to add your name into package/package.json contributors!

Test with

  1. yarn test

Run tests in watch mode

  1. yarn test:watch

Add dependencies

The project uses yarn workspaces.

The root package.json is the workspace root, and package/package.json is the actual npm package.

You can add a dependency for the root project with

  1. yarn add -W dep1

and adding deps to the proem library works with

  1. yarn workspace proem add dep1 dep2

Build with

  1. yarn build

The compiled files can be found at package/. The files in package/ are never committed to the repository, except
for package.json. The reason for this strange structure is that multi-file packages are difficult to handle with npm.

We want the proem package to consist of many submodules that can be imported with a syntax like import * as array from 'proem/array'.
Because of the way node module resolution works, this is only possible if all the files are at the root of the npm package folder.
Usually we would deploy the repository root as the npm package, but we don’t want to pollute it with compilation artifacts.
By building the files into package/ and treating it as the proem npm package root, we can have the nice imports,
and not make a mess of the repository root.

This of course means that if proem needs dependencies, they should be added to package/package.json, but those should be rare.
The whole point of proem is to provide useful utilities while avoiding a ton of external dependencies.

You can clean the package/ folder with the command

  1. yarn clean