Skip to content

Commit

Permalink
breaking: Migrate to oriflame package. (#2)
Browse files Browse the repository at this point in the history
* ci: Migrate to github actions.

* deps: Update to latest.

* new: Update to azure format.

* internal: Remove test results.

* internal: Update gitignore.

* docs: Update readme.

* ci: Update.

* ci: Update pipelines.

* ci: Update pipelines.

* ci: Fix.

* ci: Fix.

* ci: Fix.

* docs: Update contributing.

* internal: Clean changelog.

* docs: Update readme.

* docs: Update warning.

* misc: Polish.

* internal: Migrate to monorepo folder.

* internal: Update scripts to monorepo.

* build: Add editor config.

* ci: Fix typo.

* misc: Update package json.

* new: Add semantic release config.

* fix: Add release rules.

* fix: Remove code.

* fix: Import.

* fix: Remove release types.

* new: Add global types.

* new: Migrate to shared package.

* new: Migrate to shared package.

* build: Update commitlint.

* fix: Update export path.

* internal: Change namespace.

* internal: Update readme.

* misc: Polish.

* internal: Fix editor config.

* ci: Update only LTS node.

* docs: Fix typos.

* style: Add final new line.

Co-authored-by: Silhan Jan <[email protected]>
  • Loading branch information
rajzik and rajzik authored Oct 16, 2020
1 parent 5538540 commit dfb1b76
Show file tree
Hide file tree
Showing 64 changed files with 2,685 additions and 1,419 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8

[**.{js,jsx,ts,tsx,css,json,md}]
indent_style = spaces
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @rajzik
82 changes: 82 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Contributing

## Developer setup

To contribute to conventional-changelog-tools, begin by cloning the repository, installing dependencies, and building
initial files.

```bash
git clone [email protected]:Oriflame/conventional-changelog-tools.git && cd ./conventional-changelog-tools
yarn install
yarn run build
```

conventional-changelog-tools uses [Yarn workspaces](https://yarnpkg.com/lang/en/docs/workspaces/) to manage multiple
packages as a monorepo, and [Lumos](https://github.com/Oriflame/lumos) as the configuration and
management layer.

### Workflow

- `yarn run build` will build applicable packages.
- `yarn run lint` will run lint all source and test files.
- `yarn run jest` will run the test suite.
- `yarn run prettier` will format code.
- `yarn test` will test, lint, and build.

## Reporting bugs

Please report all bugs as [an issue](https://github.com/Oriflame/conventional-changelog-tools/issues/new) on the conventional-changelog-tools
repository. Before filing a new issue, try to make sure your problem doesn’t already exist.

## Requesting new features

If you work for Oriflame, please create an issue and start a discussion about the feature you want
added to conventional-changelog-tools, and why.

Otherwise, we will not be accepting new features from individuals outside of conventional-changelog-tools.

## Releasing and versioning

conventional-changelog-tools uses [conventional commits](https://www.conventionalcommits.org) and
[Lerna](https://github.com/lerna/lerna) to automatically release and publish new package versions
for every commit that merges to master. To ensure versions are bumped correctly, we use the
[@oriflame/conventional-changelog][@oriflame/conventional-changelog] preset, coupled with PR titles and squash
merging to achieve this.

If your PR title does not match the specification, a DangerJS status check will fail.

## Code formatting

We use an automatic code formatter called [Prettier](https://prettier.io/). Run `yarn run prettier`
after making any changes to the code, or setup your editor to automatically format on save.

Our linter will catch most issues that may exist in your code.

## Updating dependencies

Most of the dependencies are updated automatically with dependabot.

Otherwise follow this guide: To update dependencies in conventional-changelog-tools, run
`yarn upgrade-interactive --latest` in the root of the project. This will display an interactive
menu in which you can select dependencies to update (to the latest version) using the space bar and
arrow keys.

However, there are a few caveats and requirements to follow when updating.

1. Dependencies should be updated in isolation per package (workspace), and committed to git
separately. For example, only dependencies within the `@oriflame/conventional-changelog` package should be
updated within a single commit.
- This allows packages to update and version independently from each other.
- The exception to this is when a dependency is used across many packages, like Babel being used
in Jest and Webpack. The preferred solution is to update all Babel dependencies first, across
all packages, in the same commit. Subsequent commits would isolate Jest and Webpack separately.
2. Format your commit message with the `deps` prefix, along the lines of
`deps: Update plugins to latest.` or `deps(ESLint): Update to v6.`. This message format follows
the [@oriflame/conventional-changelog][@oriflame/conventional-changelog] spec.
3. Commit all dependency updates in the same branch, so they can be grouped under the same PR. Once
the PR has been approved, merge the PR in standard way (_do non-fast-forward merge or squash_) the PR so all commits and
their formatted messages are sent to master. This will trigger an auto-release with the correct
version bumps.

<!-- prettier-ignore -->
[@oriflame/conventional-changelog]: https://github.com/Oriflame/conventional-changelog-tools/packages/conventional-changelog#commit-message-format
24 changes: 24 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build
on:
push:
branches:
- master
pull_request:
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12, 14]
fail-fast: true
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
with:
node-version: ${{ matrix.node-version }}
- run: yarn install --ignore-engines --frozen-lockfile
- run: yarn run type
# Our fake git commit system doesn't work in GH jobs
# - run: yarn run jest
- run: yarn run lint
20 changes: 20 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Pull request check

on:
pull_request:
branches:
- master

jobs:
pull_request_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GH_TOKEN }}
fetch-depth: '0'
- uses: actions/setup-node@v2-beta
- run: yarn install --frozen-lockfile --ignore-engines
- run: yarn lumos run-script pull-request-checks-github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release

on:
push:
branches:
- master

jobs:
release:
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[ci skip]')"
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GH_TOKEN }}
fetch-depth: '0'

- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- uses: actions/setup-node@v1

- name: Authenticate with Registry
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Install Packages
run: yarn install --frozen-lockfile --ignore-engines

- name: Build packages
run: yarn build

- name: Publish package
run: yarn run release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ tsconfig.json
webpack.config.js
tsconfig.eslint.json
prettier.config.js
TEST-RESULTS.xml
*.tsbuildinfo
tsconfig.json
tsconfig.options.json
3 changes: 0 additions & 3 deletions .releaserc.json

This file was deleted.

37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

Loading

0 comments on commit dfb1b76

Please sign in to comment.