From 9a91670900339397658379e5d73319cfeb2673c5 Mon Sep 17 00:00:00 2001 From: Gleb Voitenko Date: Thu, 29 Aug 2024 01:33:34 +0300 Subject: [PATCH] feat: init utils package --- .eslintignore | 3 ++- .github/workflows/ci.yml | 30 ++++++++++++++++++++++++++++++ .github/workflows/release.yml | 19 +++++++++++++++++++ README.MD | 6 ++++-- package.json | 6 ++---- scripts/development.js | 22 ---------------------- src/index.ts | 4 +--- 7 files changed, 58 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml delete mode 100644 scripts/development.js diff --git a/.eslintignore b/.eslintignore index 6afb065..3a3a9bc 100644 --- a/.eslintignore +++ b/.eslintignore @@ -8,4 +8,5 @@ node_modules /dist /build /cache -/coverage \ No newline at end of file +/coverage +/scripts \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..41be5b1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,30 @@ +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 + - name: Tests + run: npm run test + - name: Typecheck + run: npm run typecheck diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3ae38e9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,19 @@ +on: + push: + branches: [master] + +name: release + +permissions: + contents: write + pull-requests: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: yandex-cloud/ui-release-action@main + with: + github-token: ${{ secrets.YC_UI_BOT_GITHUB_TOKEN }} + npm-token: ${{ secrets.ROBOT_DATAUI_NPM_TOKEN }} + node-version: 18 diff --git a/README.MD b/README.MD index 59913bd..03c2b28 100644 --- a/README.MD +++ b/README.MD @@ -10,6 +10,8 @@ The Diplodoc ecosystem consists of many packages that have similar problems and ## Table of contents +- [AttrsParser](#AttrsParser) + ### AttrsParser ### Purpose @@ -21,7 +23,7 @@ Support [markdown-it-attrs](https://github.com/arve0/markdown-it-attrs)-like att ```typescript /* optional first query - if provided parser will parse it imminently + if provided parser will parse it immediately each 'parse' call is pure */ const attrs = new AttrsParser('{.class #id data-name=diplodoc}'); @@ -30,6 +32,6 @@ Support [markdown-it-attrs](https://github.com/arve0/markdown-it-attrs)-like att const other = attrs.parse('{data-wide title="Support quotes too"}') - other /* { attr: ['data-wide'], title: ['Support quotes too'] } + other /* { attr: ['data-wide'], title: ['Support quotes too'] } */ ``` diff --git a/package.json b/package.json index 1fa63f1..edb2f40 100644 --- a/package.json +++ b/package.json @@ -22,14 +22,12 @@ "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", "pre-commit": "lint update && lint-staged", - "prepare": "husky" + "prepare": "husky", + "typecheck": "tsc --noEmit" }, "license": "MIT", "devDependencies": { 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); diff --git a/src/index.ts b/src/index.ts index 25814d5..12934ed 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,3 @@ import {AttrsParser} from './attrs'; -export { - AttrsParser -} \ No newline at end of file +export {AttrsParser};