1.0.2-beta.0 • Published 4 years ago
@rapharacing/types v1.0.2-beta.0
Rapha Racing Types
This package is to handle the type definitions for all Rapha projects.
Do's
- Namespace and split files. This helps with organisation and will allow for duplicate named interfaces.
- Only export the namespace, this will prevent random interfaces from floating around
- Interfaces, Namespaces and Types should all be Capitalised
interface Foo {}
type Bar = string | number;
namespace Baz {}
Don'ts
- Assign enums directly to a property, create an exportable type
// bad
interface Foo {
bar: "hello" | "world" | 1;
}
// good
type Bar = "hello" | "world" | 1;
interface Foo {
bar: Bar;
}
Publishing
- Make sure you have an NPM account and are logged in.
- Visit https://www.npmjs.com/ to create an account
- Request access to the the @rapharacing organisation (Alex / John)
- Login into the CLI
npm login
- Create a new symatic package version https://docs.npmjs.com/cli/v7/commands/npm-version.
npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease [--preid=<prerelease-id>] | from-git]
whilst we are in dev, we should be using prerelease versions
npm version prerelease --preid=beta
N.B
There is a post version hook that will then trigger a push with the version tag. GitLab CI will run, and create a new version in NPM.