-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #920 from 3YOURMIND/update-documentation
documentation(publish/eslint): describe new autopublish workflow and add documentation for packages/eslint-config
- Loading branch information
Showing
5 changed files
with
126 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -150,111 +150,68 @@ yarn run test | |
|
||
### Publishing | ||
|
||
This monorepo supports a semi-automatic release workflow. To trigger an automatic release: | ||
|
||
- make sure that the package that should be auto-released is mentioned in `packagesToConsider` of [this file](internals/scripts/source/publish.ts) | ||
- bump the package's version in the relevant `package.json` | ||
- merge this change to `master`. This will trigger the repo's `publish` workflow which publishes any new versions it finds. | ||
|
||
#### Kotti | ||
|
||
1. Prepare a new release draft [here](https://github.com/3YOURMIND/kotti/releases/new) | ||
|
||
a. Tag format: `v1.2.3` (select `Create new tag: v1.2.3 on publish`) | ||
a. Tag format: `versions/kotti-ui/1.2.3` (select `Create new tag: versions/kotti-ui/1.2.3 on publish`) | ||
|
||
b. Title format: `1.2.3: tldr of what's happening` | ||
|
||
c. Release notes: Follow guidelines of previous releases | ||
|
||
d. Click on `Save draft` | ||
|
||
2. Checkout the master branch in the Kotti repository and pull latest changes | ||
|
||
```bash | ||
git checkout master | ||
git pull --rebase | ||
``` | ||
|
||
3. Install/update dependencies | ||
|
||
```bash | ||
yarn install | ||
``` | ||
|
||
4. Build Kotti. Make sure it builds successfully. | ||
2. Optional: If you haven't already, make sure to functionally test: | ||
|
||
```bash | ||
yarn run turbo run --filter=@3yourmind/kotti-ui build | ||
yarn run watch # or if already merged to master, go to <https://3yourmind.github.io/kotti/> | ||
``` | ||
|
||
5. Optional: If you haven't already, make sure to functionally test: | ||
|
||
```bash | ||
yarn run watch | ||
``` | ||
|
||
6. Login into NPM with your credentials. Make sure you have publishing rights and 2FA on your npmjs.com account enabled. | ||
|
||
```bash | ||
npm login | ||
``` | ||
|
||
7. Update the version in `package.json` in `packages/kotti-ui` and all `@3yourmind/kotti-ui` dependencies in: | ||
|
||
a. `packages/documentation` | ||
|
||
b. `packages/test-app` | ||
3. Create a pull request that bumps the version: | ||
a. Update the version in `packages/kotti-ui/package.json` | ||
b. Commit message format: `version([email protected]): tldr of what's happening` | ||
|
||
8. Make a version commit, **DO NOT PUSH** yet. | ||
4. Merge the pull request and publish the release draft from `step 1` [here](https://github.com/3YOURMIND/kotti/releases) | ||
|
||
a. Commit message format: `version(1.2.3): tldr of what's happening` | ||
|
||
9. Publish. Lerna will auto-detect the packages whose versions got updated in `package.json` and ask you to confirm the packages to be updated and their corresponding versions. | ||
|
||
```bash | ||
yarn run lerna publish from-package | ||
``` | ||
|
||
10. Push the version commit to remote | ||
|
||
```bash | ||
git push | ||
``` | ||
|
||
11. Find the release draft from `step 1` [here](https://github.com/3YOURMIND/kotti/releases), edit it and click on `Publish release` | ||
|
||
12. Announce the new version in the `#kotti` slack channel | ||
5. Announce the new version in the `#kotti` slack channel | ||
|
||
#### Yoco | ||
|
||
1. Create a version bump branch out of master | ||
|
||
2. Update the version in `packages/yoco` | ||
1. Prepare a new release draft [here](https://github.com/3YOURMIND/kotti/releases/new) | ||
|
||
3. Commit and push | ||
a. Tag format: `versions/yoco/1.2.3` (select `Create new tag: versions/yoco/1.2.3 on publish`) | ||
|
||
4. Create a PR and get it merged | ||
b. Title format: `Yoco 1.2.3: tldr of what's happening` | ||
|
||
5. Checkout the master branch in the Kotti repository and pull latest changes | ||
c. Release notes: Follow guidelines of previous releases | ||
|
||
```bash | ||
git checkout master | ||
git pull --rebase | ||
``` | ||
d. Click on `Save draft` | ||
|
||
6. Login into NPM with your credentials. Make sure you have publishing rights and 2FA on your npmjs.com account enabled. | ||
2. Optional: If you haven't already, make sure to functionally test: | ||
|
||
```bash | ||
npm login | ||
yarn run watch # or if already merged to master, go to <https://3yourmind.github.io/kotti/> | ||
``` | ||
|
||
7. Build yoco | ||
3. Create a pull request that bumps the version: | ||
a. Update the version in `packages/yoco/package.json` | ||
b. Update the yoco version in `packages/kotti-ui/package.json` (consider bumping kotti-ui, if the changes need to be used there as well) | ||
c. Commit message format: `version([email protected]): tldr of what's happening` | ||
|
||
```bash | ||
yarn run turbo run --filter=@3yourmind/yoco build | ||
``` | ||
4. Merge the pull request and publish the release draft from `step 1` [here](https://github.com/3YOURMIND/kotti/releases) | ||
|
||
8. Publish. Lerna will auto-detect the packages whose versions got updated in `package.json` and ask you to confirm the packages to be updated and their corresponding versions. | ||
5. Announce the new version in the `#kotti` slack channel | ||
|
||
```bash | ||
yarn run lerna publish from-package | ||
``` | ||
#### Debugging | ||
|
||
9. If any new icon is needed in Kotti, create a PR updating the `@3yourmind/yoco` version in `package.json` in `kotti-ui` | ||
In case this does not work as expected, you want to check out the [publish script](internals/scripts/source/publish.ts) and the [github workflow definition](.github/workflows/publish.yml) that drive this action | ||
|
||
### Build | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# @3yourmind/eslint-config | ||
|
||
## Usage | ||
|
||
```ts | ||
import tseslint from 'typescript-eslint' | ||
import eslintConfig3YD from '@3yourmind/eslint-config' | ||
|
||
const config = tseslint.config( | ||
/** | ||
* DO NOT ADD ANY OTHER KEYS TO THIS FIRST OBJECT | ||
* | ||
* @see {@link https://eslint.org/docs/latest/use/configure/ignore#ignoring-files} | ||
*/ | ||
{ | ||
ignores: ['**/dist/**', '**/.nuxt/**', '**/.turbo/**'], // global ignores | ||
}, | ||
...eslintConfig3YD.configs.global, // enables recommended eslint settings globally | ||
{ | ||
languageOptions: { | ||
ecmaVersion: 2022, | ||
parserOptions: { | ||
debugLevel: 'typescript-eslint', | ||
project: [ | ||
'./tsconfig.json', | ||
// FIXME: Change these to your `tsconfig.json`s | ||
// './packages/*/tsconfig.json', | ||
], | ||
tsconfigRootDir: 'FIXME: You may want to specify this directory', | ||
}, | ||
sourceType: 'module', | ||
}, | ||
}, | ||
...eslintConfig3YD.configs.default.map((config) => ({ | ||
...config, | ||
// Example: apply config to only these files | ||
files: ['packages/**/*.ts', 'packages/**/*.tsx'], | ||
})), | ||
// Example: apply config to all default files | ||
...eslintConfig3YD.configs.untyped, | ||
...eslintConfig3YD.configs.json, | ||
...eslintConfig3YD.configs.tests.map((config) => ({ | ||
...config, | ||
// FIXME: Add your custom test files here | ||
files: [. | ||
..config.files, | ||
// 'packages/*/source/test-utils/**/*.ts' | ||
] | ||
})), | ||
...eslintConfig3YD.configs.vue, | ||
{ | ||
rules: { | ||
// add your overrides here | ||
// '@typescript-eslint/no-restricted-imports': 'off', | ||
}, | ||
}, | ||
) | ||
|
||
export default config | ||
``` | ||
|
||
## Installation & Requirements | ||
|
||
`@3yourmind/eslint-config` requires `eslint>=9` and its new FlatConfig format | ||
|
||
```sh | ||
npm install --save-dev @3yourmind/eslint-config | ||
# or | ||
yarn add --dev @3yourmind/eslint-config | ||
``` | ||
|
||
## Configurations | ||
|
||
- `eslintConfig3YD.configs.default` | ||
- Should be used on .ts and .tsx files. This enables rules that rely on type checking. | ||
- `eslintConfig3YD.configs.global` | ||
- Registers plugins and settings that should be globally enabled. | ||
- `eslintConfig3YD.configs.json` | ||
- Should be used only on JSON files. Treats some files (e.g. tsconfig) as jsonc. | ||
- `eslintConfig3YD.configs.tests` | ||
- Should be used on test files. It includes vitest-specific rules and turns off rules that would be unhelpful/annoying when writing tests. | ||
- `eslintConfig3YD.configs.untyped` | ||
- Enables basic rules for javascript files. Use a more specific config if possible | ||
|
||
## Custom Rules | ||
|
||
- `vue-consistent-ref-names`: <https://github.com/3YOURMIND/kotti/blob/master/packages/eslint-config/source/rules/vue-consistent-ref-names.ts> | ||
- `vue-no-v-model-deep`: <https://github.com/3YOURMIND/kotti/blob/master/packages/eslint-config/source/rules/vue-no-v-model-deep.ts> | ||
- `vue-no-v-t-on-components`: <https://github.com/3YOURMIND/kotti/blob/master/packages/eslint-config/source/rules/vue-no-v-t-on-components.ts> | ||
- `vue-no-v-t-without-translation`: <https://github.com/3YOURMIND/kotti/blob/master/packages/eslint-config/source/rules/vue-no-v-t-without-translation.ts> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,5 +61,5 @@ | |
}, | ||
"type": "module", | ||
"types": "./dist/mjs/index.d.ts", | ||
"version": "0.0.1" | ||
"version": "0.0.2" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters