Skip to content

Commit

Permalink
build: Update to lumos 5. (#708)
Browse files Browse the repository at this point in the history
* build: Update lumos to version 5.

* deps: Update lumos.

* build: Update to full lumos.

* build: Change to packemon and yarn 3.

* ci: Update matrix.

* ci: Fix danger script.

* ci: Change to dangerfile.ts.

* fix: Add missing danger config.

* ci: Change to require.
  • Loading branch information
rajzik authored Dec 29, 2021
1 parent 3cd8bf4 commit d854dd9
Show file tree
Hide file tree
Showing 34 changed files with 20,993 additions and 12,423 deletions.
25 changes: 25 additions & 0 deletions .config/lumos.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import type { LumosConfig } from '@oriflame/lumos';

const config: LumosConfig = {
module: '@oriflame/lumos',
drivers: [
'babel',
'eslint',
'jest',
'prettier',
['typescript', { declarationOnly: true, buildFolder: 'dts' }],
],
settings: {
node: true,
library: true,
env: {
targets: {
node: '12.14',
esmodules: false,
},
},
esm: false,
},
};

export default config;
9 changes: 9 additions & 0 deletions .config/lumos/eslint.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { ESLintConfig } from '@oriflame/lumos';

const config: ESLintConfig = {
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
},
};

export default config;
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.yarn/releases/** binary
/.yarn/plugins/** binary
6 changes: 3 additions & 3 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ jobs:
if: "! contains(toJSON(github.event.commits.*.message), '[ci skip]')"
strategy:
matrix:
node-version: [12, 14]
node-version: [14, 16, 17]
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
- run: yarn install --immutable
- run: yarn run build
# Our fake git commit system doesn't work in GH jobs
# - run: yarn run jest
- run: yarn run lint
6 changes: 3 additions & 3 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- run: yarn install --frozen-lockfile --ignore-engines
- run: yarn build
- run: yarn danger ci --use-github-checks
- run: yarn install --immutable
- run: yarn run build
- run: npx danger ci --use-github-checks
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DANGER_FAKE_CI: GitHub
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

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

- name: Build packages
run: yarn build
run: yarn run pack

- name: Publish package
run: yarn run release
Expand Down
13 changes: 9 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ coverage/
esm/
lib/
node_modules/
dts/

# Custom
*.min.js
Expand All @@ -29,11 +30,15 @@ node_modules/
babel.config.js
jest.config.js
prettier.config.js
tsconfig.json
webpack.config.js
tsconfig.eslint.json
prettier.config.js
TEST-RESULTS.xml
*.tsbuildinfo
tsconfig.json
tsconfig.options.json

.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
363 changes: 363 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

768 changes: 768 additions & 0 deletions .yarn/releases/yarn-3.1.1.cjs

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"

yarnPath: .yarn/releases/yarn-3.1.1.cjs
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
extends: ['./packages/conventional-changelog-lint'],
extends: ['@oriflame/conventional-changelog-lint-config'],
};
5 changes: 0 additions & 5 deletions configs/eslint.js

This file was deleted.

6 changes: 2 additions & 4 deletions dangerfile.js → dangerfile.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/* eslint-disable import/no-extraneous-dependencies */

import {
const {
checkForInvalidLocks,
checkForConventionalPrefix,
checkForConventionalSquashCommit,
} from '@oriflame/config-danger';
} = require('@oriflame/config-danger');

checkForInvalidLocks();
checkForConventionalPrefix();
Expand Down
40 changes: 13 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@
"license": "MIT",
"scripts": {
"prepare": "lumos create-config && husky install",
"build": "lumos typescript --build --reference-workspaces",
"build": "packemon build --addEngines --declaration=standard",
"coverage": "yarn run jest --coverage",
"sync-project-refs": "lumos typescript:sync-project-refs",
"lint": "lumos eslint",
"jest": "lumos jest -i",
"prettier": "lumos prettier",
"type": "yarn run build",
"pretest": "yarn run type",
"pretest": "yarn run pack",
"test": "yarn run jest",
"posttest": "yarn run lint",
"pack": "cross-env NODE_ENV=production packemon pack --addEngines --declaration=standard",
"release-alpha": "git reset --hard && lerna publish --canary --force-publish --yes",
"release": "git reset --hard && lumos run-script auto-release",
"link-packages": "lerna exec -- yarn link",
Expand All @@ -27,35 +28,20 @@
"workspaces": [
"./packages/*"
],
"lumos": {
"drivers": [
"babel",
"eslint",
"jest",
"prettier",
"typescript"
],
"settings": {
"node": true,
"library": true
}
},
"devDependencies": {
"@commitlint/cli": "^15.0.0",
"@oriflame/config-babel": "^4.3.0",
"@oriflame/config-danger": "4.3.0",
"@oriflame/config-eslint": "^4.3.0",
"@oriflame/config-jest": "^4.3.0",
"@oriflame/config-prettier": "^4.3.0",
"@oriflame/config-typescript": "^4.3.0",
"@oriflame/lumos": "^4.3.0",
"@types/node": "^16.11.11",
"@types/shelljs": "^0.8.9",
"@commitlint/cli": "^16.0.1",
"@oriflame/config-danger": "^5.0.27",
"@oriflame/lumos": "^5.0.27",
"@types/node": "^17.0.5",
"@types/shelljs": "^0.8.10",
"cross-env": "^7.0.3",
"husky": "^7.0.4",
"lerna": "^4.0.0",
"packemon": "^1.10.0",
"shelljs": "^0.8.4"
},
"resolutions": {
"caniuse-lite": "^1.0.30001271"
}
},
"packageManager": "[email protected]"
}
18 changes: 16 additions & 2 deletions packages/conventional-changelog-lint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@
"version": "1.1.5",
"description": "Conventional changelog lint config oriflame",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"types": "./dts/index.d.ts",
"repository": {
"url": "https://github.com/Oriflame/conventional-changelog-tools",
"directory": "packages/conventional-changelog-lint"
},
"author": "Jan Šilhan <[email protected]>",
"license": "MIT",
"files": [
"lib"
"dts",
"dts/**/*.d.ts",
"lib",
"lib/**/*.{js,map}",
"src",
"src/**/*.{ts,tsx,json}"
],
"keywords": [
"conventional-changelog",
Expand All @@ -27,5 +32,14 @@
},
"peerDependencies": {
"@commitlint/cli": ">=12"
},
"packemon": {
"format": "lib",
"platform": "node",
"support": "current"
},
"engines": {
"node": ">=14.16.0",
"npm": ">=6.14.0 || >=7.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/conventional-changelog-lint/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { GROUPS } from '@oriflame/conventional-changelog-types';

export = {
export default {
rules: {
'body-max-length': [0],
'scope-case': [0, 'never', 'start-case'],
Expand Down
23 changes: 23 additions & 0 deletions packages/conventional-changelog-lint/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"declarationDir": "dts",
"outDir": "dts",
"rootDir": "src",
"emitDeclarationOnly": true
},
"exclude": [
"dts",
"tests"
],
"extends": "../../tsconfig.options.json",
"include": [
"src/**/*",
"types/**/*",
"../../types/**/*"
],
"references": [
{
"path": "../conventional-changelog-types"
}
]
}
19 changes: 15 additions & 4 deletions packages/conventional-changelog-types/package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
{
"name": "@oriflame/conventional-changelog-types",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"types": "./dts/index.d.ts",
"version": "1.0.8",
"engines": {
"node": ">=12"
"node": ">=14.16.0",
"npm": ">=6.14.0 || >=7.0.0"
},
"publishConfig": {
"access": "public"
},
"files": [
"lib"
"dts",
"dts/**/*.d.ts",
"lib",
"lib/**/*.{js,map}",
"src",
"src/**/*.{ts,tsx,json}"
],
"repository": {
"url": "https://github.com/Oriflame/conventional-changelog-tools",
"directory": "packages/conventional-changelog-types"
},
"author": "Jan Silhan",
"license": "MIT"
"license": "MIT",
"packemon": {
"format": "lib",
"platform": "node",
"support": "current"
}
}
19 changes: 19 additions & 0 deletions packages/conventional-changelog-types/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"declarationDir": "dts",
"outDir": "dts",
"rootDir": "src",
"emitDeclarationOnly": true
},
"exclude": [
"dts",
"tests"
],
"extends": "../../tsconfig.options.json",
"include": [
"src/**/*",
"types/**/*",
"../../types/**/*"
],
"references": []
}
20 changes: 17 additions & 3 deletions packages/conventional-changelog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,20 @@
"oriflame",
"preset"
],
"main": "./index.js",
"types": "./lib/index.d.ts",
"main": "./lib/index.js",
"types": "./dts/index.d.ts",
"engines": {
"node": ">=12"
"node": ">=14.16.0",
"npm": ">=6.14.0 || >=7.0.0"
},
"files": [
"dts",
"dts/**/*.d.ts",
"lib",
"lib/**/*.{js,map}",
"src",
"src/**/*.{ts,tsx,json}"
],
"publishConfig": {
"access": "public"
},
Expand All @@ -27,5 +36,10 @@
"devDependencies": {
"conventional-changelog-core": "^4.2.4",
"conventional-recommended-bump": "^6.1.0"
},
"packemon": {
"format": "lib",
"platform": "node",
"support": "current"
}
}
2 changes: 1 addition & 1 deletion packages/conventional-changelog/src/checkCommitFormat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function checkCommitFormat(
if (!match) {
return null;
}
const [, type, scope] = match;
const [, type, scope = ''] = match;

return {
scope: scope || '',
Expand Down
2 changes: 1 addition & 1 deletion packages/conventional-changelog/src/writerOpts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function createLink(paths: string[], context: Context, reference: Partial<Refere
'src',
].forEach((browsePart) => {
if (base.includes(`/${browsePart}/`)) {
[base] = base.split(`/${browsePart}/`);
base = base.split(`/${browsePart}/`)[0]!;
}
});

Expand Down
Loading

0 comments on commit d854dd9

Please sign in to comment.