Skip to content

Rewrite #85

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,17 @@ rules:
no-unreachable-loop: off
no-use-before-define: ["error", { "functions": false, "classes": false }]
"@typescript-eslint/consistent-type-imports": ["error", { "prefer": "type-imports" }]

overrides:
- files: [ '*.spec.ts' ]
globals:
runScript: true
execScript: true
initRepo: true
writeConfig: true
- files: ['*.ts']
rules:
no-redeclare: off

env:
node: true
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 'release'

on:
push:
branches:
- 'beta'

env:
PVM_LL: silly

jobs:
release-beta:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 150
- uses: ./.github/actions/setup
- run: npm run build
- run: node scripts/remark-readme.js
- run: npm exec pvm publish -- --canary --tag beta -s all --canary-unified --canary-base-version 1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PVM_SLACK_TOKEN: ${{ secrets.PVM_SLACK_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PVM_MATTERMOST_URL: ${{ secrets.PVM_MATTERMOST_URL }}
PVM_MATTERMOST_TOKEN: ${{ secrets.PVM_MATTERMOST_TOKEN }}
PVM_MATTERMOST_INCOMING_WEBHOOK: ${{ secrets.PVM_MATTERMOST_INCOMING_WEBHOOK }}
3 changes: 2 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,14 @@ jobs:
- 'packages/**'
- 'test/**'
- run: npm run build
- run: npm run check-ts-strict
- run: npm exec depscheck
- run: npm run lint:config-schema
- run: npm exec pvm vcs is-branch-actual
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: npm exec pvm lint
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: npm run lint
- if: steps.packageChanges.outputs.changes == 'true'
run: npm run test -- -w `node -p 'Math.min(os.cpus().length, 2)'`
Expand Down
21 changes: 7 additions & 14 deletions .pvm.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versioning]
unified = ['/packages/*', '/src/**/*']
unified = ['/packages/*']
source = 'tag'

[changelog]
Expand Down Expand Up @@ -35,19 +35,12 @@ strip_namespace = false
[notifications]
target = 'all'

[[notifications.clients]]
name = 'mattermost'
pkg = '@pvm/mattermost'

[notifications.client_configs.mattermost]
team = 'tinkoff'

[notifications.clients_common_config]
channel = 'pvm-github'
author = { name = 'pvm minion (github)', avatarEmoji = ':deciduous_tree:' }
[[plugins_v2]]
plugin = '@pvm/plugin-github'

[plugins]
local_plugins = ['packages/pvm-plugin-conventional-changelog']
[[plugins_v2]]
plugin = '@pvm/plugin-conventional-changelog'

[[plugins_v2]]
plugin = '@pvm/plugin-github'
plugin = '@pvm/plugin-mattermost'
options = { team = 'tinkoff', channel = 'pvm-github', author = { name = 'pvm minion (github)', avatarEmoji = ':deciduous_tree:' } }
3 changes: 1 addition & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ module.exports = {
testMatch: [
'<rootDir>/packages/**/__tests__/**/*.spec.ts',
'<rootDir>/src/**/__tests__/**/*.spec.ts',
'<rootDir>/src/**/*.spec.js',
'<rootDir>/test/**/*.spec.js',
'<rootDir>/test/**/*.spec.ts',
],
setupFiles: [
'./test/jest.setup.js',
Expand Down
17 changes: 17 additions & 0 deletions module-to-relative.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = function(fileInfo, api, options) {
const depth = fileInfo.path.split('\\').length - 3

const re = /@pvm\/(types)/
return api.jscodeshift(fileInfo.source)
.find(api.jscodeshift.ImportDeclaration)
.forEach(path => {
const source = path.value.source
const [f, m] = re.exec(source.value) ?? []

if (f) {
const replace = Array(depth).fill('..').join('/') + `/${m}`
source.value = source.value.replace(f, replace)
}
})
.toSource()
}
Loading