Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
always-auth: true
registry-url: 'https://registry.npmjs.org'

- run: yarn install --frozen-lockfile
- run: corepack enable

- uses: actions/cache@v4
with:
path: .yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}

- run: yarn install --immutable

- run: yarn test

Expand All @@ -36,13 +40,22 @@ jobs:
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Action"

- run: yarn version --new-version ${{ github.event.inputs.version }} --no-commit-hooks
- name: Bump version
env:
RELEASE_VERSION: ${{ github.event.inputs.version }}
run: |
yarn version "$RELEASE_VERSION"
git add package.json yarn.lock
if ! git diff --cached --quiet; then
git -c core.hooksPath=/dev/null commit -m "v$RELEASE_VERSION"
git tag "v$RELEASE_VERSION"
fi

- name: Pushing changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.DEVTOOLS_GITHUB_TOKEN }}
branch: ${{ github.ref }}

- name: Publushing release
run: yarn publish --non-interactive
- name: Publishing release
run: yarn npm publish
12 changes: 9 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
node-version-file: '.nvmrc'

- run: yarn install --frozen-lockfile
- run: corepack enable

- uses: actions/cache@v4
with:
path: .yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}

- run: yarn install --immutable

- run: yarn test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
dist
.yarn/
.swe-helper/
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ node_modules
.DS_Store
.gitignore
yarn.lock
.yarn
.yarnrc.yml
1 change: 0 additions & 1 deletion .yarnrc

This file was deleted.

6 changes: 6 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
enableGlobalCache: false
enableScripts: true

nodeLinker: node-modules

npmRegistryServer: "https://registry.npmjs.org"
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@

This package generates TypeScript typings based on the [VK API JSON schema](https://github.com/VKCOM/vk-api-schema).

## Development

Use the Node.js version from `.nvmrc`. Enable Corepack to use the Yarn version pinned in `package.json`:

```shell
corepack enable
yarn install --immutable
yarn test
yarn build
```

## Usage

#### Via npx:
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@
"repository": "https://github.com/VKCOM/api-schema-typescript-generator",
"engines": {
"node": ">=12.0.0",
"yarn": "^1.21.1"
"yarn": "^4.18.1"
},
"packageManager": "yarn@4.18.1",
"bin": {
"vk-api-schema-typescript-generator": "./bin/vk-api-schema-typescript-generator.js"
},
"scripts": {
"clear": "rimraf dist/*",
"clear": "rimraf dist",
"build": "yarn clear && tsc",
"watch": "yarn clear && tsc --watch",
"prettier": "prettier --write \"src/**/*.ts\"",
Expand Down
Loading
Loading