Skip to content

Commit

Permalink
feat: modernize
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillgroshkov committed May 11, 2024
1 parent 8f92d1b commit 60dadbf
Show file tree
Hide file tree
Showing 17 changed files with 3,726 additions and 4,485 deletions.
35 changes: 0 additions & 35 deletions .circleci/config.yml

This file was deleted.

62 changes: 0 additions & 62 deletions .codeclimate.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: ci

on: [push, workflow_dispatch]

env:
NODE_OPTIONS: --max-old-space-size=5000

jobs:
build-job:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message , 'skip ci')"
steps:
- { uses: actions/checkout@v4, with: { persist-credentials: false } }
- { uses: actions/setup-node@v4, with: { node-version: 'lts/*', cache: 'yarn' } }
- run: yarn --frozen-lockfile
- run: yarn build
- run: yarn test

release-job:
runs-on: ubuntu-latest
if: github.ref_name == 'master'
permissions:
contents: write
id-token: write
steps:
- { uses: actions/checkout@v4, with: { persist-credentials: true } }
- { uses: actions/setup-node@v4, with: { node-version: 'lts/*', cache: 'yarn' } }

# Cache for npm/npx in ~/.npm
- uses: actions/cache@v4
with:
path: ~/.npm
key: npm-v1-${{ runner.os }}

- run: yarn --frozen-lockfile
- run: yarn build-prod

- name: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx @naturalcycles/semantic-release
6 changes: 6 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
[ -n "$CI" ] && exit 0
. "$(dirname "$0")/_/husky.sh"

node_modules/.bin/commitlint-def $1
# exit 1 # uncomment to debug
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
[ -n "$CI" ] && exit 0
. "$(dirname "$0")/_/husky.sh"

node_modules/.bin/lint-staged-def
14 changes: 1 addition & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
## [1.0.1](https://github.com/NaturalCycles/spreadsheet-lib/compare/v1.0.0...v1.0.1) (2020-05-31)


### Bug Fixes

* adapt to db-lib@7 ([f72b1a2](https://github.com/NaturalCycles/spreadsheet-lib/commit/f72b1a25d41044b3ab92913e3104eace8a39732c))

# 1.0.0 (2020-05-24)


### Features

* first version ([b1a102a](https://github.com/NaturalCycles/spreadsheet-lib/commit/b1a102a48e614e8f792507bc7c3f23c71c5317cd))
See [Github Releases](https://github.com/NaturalCycles/spreadsheet-lib/releases)
3 changes: 0 additions & 3 deletions husky.config.js

This file was deleted.

21 changes: 12 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
{
"name": "@naturalcycles/spreadsheet-lib",
"scripts": {},
"scripts": {
"prepare": "husky"
},
"dependencies": {
"@naturalcycles/db-lib": "^7.0.0",
"@naturalcycles/js-lib": "^13.0.0",
"@naturalcycles/nodejs-lib": "^10.2.1",
"googleapis": "^51.0.0"
"@naturalcycles/db-lib": "^9.14.1",
"@naturalcycles/js-lib": "^14.235.0",
"@naturalcycles/nodejs-lib": "^13.24.1",
"googleapis": "*"
},
"devDependencies": {
"@naturalcycles/dev-lib": "^10.14.12",
"@types/node": "^14.0.1",
"jest": "^26.0.1"
"@naturalcycles/dev-lib": "^13.52.1",
"@types/node": "^20.12.11",
"jest": "^29.7.0"
},
"files": [
"dist",
Expand All @@ -23,14 +25,15 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"publishConfig": {
"provenance": true,
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/NaturalCycles/spreadsheet-lib"
},
"engines": {
"node": ">=12.13.1"
"node": ">=18.12.0"
},
"version": "1.0.1",
"description": "CommonDB implementation backed by a Google Spreadsheet",
Expand Down
5 changes: 2 additions & 3 deletions scripts/testscript.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/*
DEBUG=nc* yarn tsn testscript
yarn tsn testscript
*/

import { requireEnvKeys } from '@naturalcycles/nodejs-lib'
import { runScript } from '@naturalcycles/nodejs-lib/dist/script'
import { requireEnvKeys, runScript } from '@naturalcycles/nodejs-lib'

runScript(async () => {
const { GCP_CFG } = requireEnvKeys('GCP_CFG')
Expand Down
4 changes: 2 additions & 2 deletions scripts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "@naturalcycles/dev-lib/scripts/tsconfig.json",
"compilerOptions": {
"baseUrl": "./",
"outDir": "../dist"
"outDir": "../dist",
},
"exclude": ["**/__exclude"]
"exclude": ["**/__exclude"],
}
4 changes: 1 addition & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
import { SpreadsheetDB, SpreadsheetDBCfg } from './spreadsheet.db'

export { SpreadsheetDBCfg, SpreadsheetDB }
export * from './spreadsheet.db'
Loading

0 comments on commit 60dadbf

Please sign in to comment.