Skip to content

Commit

Permalink
Merge pull request #35 from sineverba/release-2.0.0
Browse files Browse the repository at this point in the history
Release 2.0.0
  • Loading branch information
sineverba committed Feb 23, 2023
2 parents 62b6047 + 710733e commit 5d6b56e
Show file tree
Hide file tree
Showing 16 changed files with 3,889 additions and 2,331 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Expand Up @@ -3,7 +3,7 @@ jobs:

test:
docker:
- image: cimg/node:18.12.0
- image: cimg/node:18.14.2

steps:
- checkout
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
@@ -1 +1 @@
v18.13.0
v18.14.2
2 changes: 2 additions & 0 deletions .semaphore/build-deploy.yml
Expand Up @@ -17,5 +17,7 @@ blocks:
- name: Deploy
commands:
- checkout
- npm ci
- npm run build
- mv npmrc.txt .npmrc
- npm publish
27 changes: 21 additions & 6 deletions .semaphore/semaphore.yml
@@ -1,12 +1,15 @@
version: v1.0

name: Build and test Pipeline
name: Build and test
agent:
machine:
type: e1-standard-2
os_image: ubuntu2004

global_job_config:
env_vars:
- name: SONARSCANNER_VERSION
value: 4.8.0
secrets:
- name: ACCESS_TOKENS

Expand Down Expand Up @@ -35,10 +38,17 @@ blocks:
- name: Test
matrix:
- env_var: NODE_VERSION
values: [ "12", "14", "16", "18" ]
values: [ "14", "16", "18" ]
commands:
- sem-version node $NODE_VERSION
- npm run test
- name: Prettier
commands:
- rm -r node_modules/
- nvm install
- nvm use
- npm ci
- npm run prettier

- name: Coverage
skip:
Expand All @@ -48,19 +58,24 @@ blocks:
commands:
- checkout
- cache restore
- npm run coverage
jobs:
- name: Coverage
commands:
- export COVERALLS_REPO_TOKEN=$COVERALLS_NPM_PKG_YEAR_INTERVAL
- npm run cover
- cat coverage/lcov.info | node_modules/coveralls/bin/coveralls.js
- name: Sonarcloud
commands:
- npm run cover
- docker run --rm -e SONAR_HOST_URL="https://sonarcloud.io" -e SONAR_LOGIN=$SONAR_TOKEN -v "/home/semaphore/npm-pkg-year-interval:/usr/src" sonarsource/sonar-scanner-cli:4.8.0
- >-
docker run
--rm
-e SONAR_HOST_URL="https://sonarcloud.io"
-e SONAR_LOGIN=$SONAR_TOKEN
-v "/home/semaphore/npm-pkg-year-interval:/usr/src"
sonarsource/sonar-scanner-cli:$SONARSCANNER_VERSION
promotions:
- name: Deploy
pipeline_file: build-deploy.yml
auto_promote:
when: "tag =~ '.*'"
when: "result = 'passed' and tag =~ '.*'"
6 changes: 5 additions & 1 deletion CHANGELOG.md
@@ -1,4 +1,8 @@
# 1.4.0
# 2.0.0
+ Upgrade dependencies
+ Move to TypeScript

## 1.4.0
+ Refactor Semaphore
+ Upgrade dependencies

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -11,7 +11,7 @@ sonar:
sonarsource/sonar-scanner-cli:$(SONARSCANNER_VERSION)

upgrade:
npx ncu -u
npx ncu --doctor -u
npm install
npx browserslist@latest --update-db
npm audit fix
8 changes: 3 additions & 5 deletions README.md
Expand Up @@ -23,13 +23,11 @@ Useful to use in copyright section ("Copyright 2018-2020 by Acme INC").
(In following examples current year is assumed as 2020)

```js
var interval = require('@sineverba/years-interval');
// Or...
// import interval from '@sineverba/years-interval'
import { Shortener } from "shortfield";

var yearInterval = interval("2020");
var yearInterval = Shortener("2020");
console.log(yearInterval); // returns 2020
var newYearInterval = interval("2018");
var newYearInterval = Shortener("2018");
console.log(newYearInterval); // returns 2018-2020
// on next year...
console.log(yearInterval); // returns 2020-2021
Expand Down
5 changes: 5 additions & 0 deletions jest.config.js
@@ -0,0 +1,5 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};

0 comments on commit 5d6b56e

Please sign in to comment.