diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..f3fd52a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" + reviewers: + - "diplodoc-platform/devops" + open-pull-requests-limit: 5 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2783a74 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,26 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + verify_files: + name: Verify Files + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: '18.x' + cache: 'npm' + - name: Install Packages + run: npm ci + - name: Lint Files + run: npm run lint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7cc971b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +on: + push: + branches: [master] + +name: release + +permissions: + contents: write + pull-requests: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 + with: + node-version: 18 + registry-url: 'https://registry.npmjs.org' + - run: npm ci + shell: bash + - uses: codex-team/action-nodejs-package-info@v1 + id: package + - uses: GoogleCloudPlatform/release-please-action@v3 + id: release + with: + token: ${{secrets.YC_UI_BOT_GITHUB_TOKEN}} + release-type: node + package-name: ${{steps.package.outputs.name}} + changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"perf","section":"Performance Improvements","hidden":false}]' + bump-minor-pre-major: true + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.ROBOT_DATAUI_NPM_TOKEN}} + if: ${{ steps.release.outputs.release_created }} + shell: bash diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..480664a --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,37 @@ +name: Tests + +on: + push: + branches: [master] + pull_request: + branches: ['**'] + +jobs: + test: + name: Node v${{ matrix.node-version }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + node-version: [18.x] + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + os: ${{ matrix.os }} + cache: 'npm' + - name: Install packages for project + run: npm ci + - run: npm run build + - name: Install packages for tests + run: | + cd tests + npm ci + - name: Run tests + run: | + cd tests + npm run test diff --git a/package-lock.json b/package-lock.json index 6098be2..4c28a20 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@diplodoc/utils", - "version": "0.0.8", + "version": "0.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@diplodoc/utils", - "version": "0.0.8", + "version": "0.0.1", "license": "MIT", "devDependencies": { "@diplodoc/lint": "^1.1.3", @@ -15,7 +15,7 @@ "@esbuild-plugins/tsconfig-paths": "^0.1.2", "@types/jest": "^27.5.2", "@types/markdown-it": "12.2.3", - "@types/node": "^17.0.35", + "@types/node": "^22.5.1", "esbuild": "^0.17.18", "esbuild-jest": "^0.5.0", "esbuild-node-externals": "^1.7.0", @@ -2767,10 +2767,13 @@ "dev": true }, "node_modules/@types/node": { - "version": "17.0.45", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz", - "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==", - "dev": true + "version": "22.5.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.1.tgz", + "integrity": "sha512-KkHsxej0j9IW1KKOOAA/XBA0z08UFSrRQHErzEfA3Vgq57eXIMYboIlHJuYIfd+lwCQjtKqUu3UnmKbtUc9yRw==", + "dev": true, + "dependencies": { + "undici-types": "~6.19.2" + } }, "node_modules/@types/normalize-package-data": { "version": "2.4.4", @@ -13270,6 +13273,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true + }, "node_modules/union-value": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", diff --git a/package.json b/package.json index 1fa63f1..1d160cb 100644 --- a/package.json +++ b/package.json @@ -22,9 +22,6 @@ "build": "npm run build:clean && npm run build:code", "build:code": "tsc -p tsconfig.types.json && node scripts/bundle.js", "build:clean": "rm -rf lib", - "build:dev": "npm run build:dev:clean && npm run build:dev:code", - "build:dev:code": "node scripts/development.js", - "build:dev:clean": "rm -rf dist", "prepublishOnly": "npm run build", "lint": "lint update && lint", "lint:fix": "lint update && lint fix", @@ -39,7 +36,7 @@ "@esbuild-plugins/tsconfig-paths": "^0.1.2", "@types/jest": "^27.5.2", "@types/markdown-it": "12.2.3", - "@types/node": "^17.0.35", + "@types/node": "^22.5.1", "esbuild": "^0.17.18", "esbuild-jest": "^0.5.0", "esbuild-node-externals": "^1.7.0", diff --git a/scripts/development.js b/scripts/development.js deleted file mode 100644 index 4006319..0000000 --- a/scripts/development.js +++ /dev/null @@ -1,22 +0,0 @@ -const esexec = require('@es-exec/api').default; -const {TsconfigPathsPlugin} = require('@esbuild-plugins/tsconfig-paths'); -const {nodeExternalsPlugin} = require('esbuild-node-externals'); - -const options = { - buildOptions: { - tsconfig: './tsconfig.json', - entryPoints: ['./src/playground.ts'], - outdir: 'dist', - platform: 'node', - target: 'node14', - bundle: true, - format: 'cjs', - plugins: [ - // eslint-disable-next-line new-cap - TsconfigPathsPlugin({tsconfig: './tsconfig.json'}), - nodeExternalsPlugin(), - ], - }, -}; - -esexec(options);