czapp-shared 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitlab-ci.yml +25 -0
- package/README.md +7 -5
- package/package.json +2 -2
- package/test/util/util.test.ts +3 -5
package/.gitlab-ci.yml
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
image: node:18-alpine
|
|
2
|
+
|
|
3
|
+
stages:
|
|
4
|
+
- build
|
|
5
|
+
- test
|
|
6
|
+
|
|
7
|
+
build:
|
|
8
|
+
stage: build
|
|
9
|
+
script:
|
|
10
|
+
- npm install
|
|
11
|
+
cache:
|
|
12
|
+
paths:
|
|
13
|
+
- node_modules/
|
|
14
|
+
artifacts:
|
|
15
|
+
expire_in: 1 days
|
|
16
|
+
when: on_success
|
|
17
|
+
paths:
|
|
18
|
+
- node_modules/
|
|
19
|
+
|
|
20
|
+
unitTest:
|
|
21
|
+
stage: test
|
|
22
|
+
dependencies:
|
|
23
|
+
- build
|
|
24
|
+
script:
|
|
25
|
+
- npm run test:unit
|
package/README.md
CHANGED
|
@@ -24,14 +24,16 @@ To test:
|
|
|
24
24
|
npm run test
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
To release new version
|
|
27
|
+
To release new version, and types and then run this...
|
|
28
|
+
|
|
28
29
|
```bash
|
|
30
|
+
// first build the package which generates the artifacts
|
|
31
|
+
npm run build
|
|
32
|
+
|
|
33
|
+
// then bump the version (bump version, commit, tag, push):
|
|
29
34
|
npm run release:bump
|
|
30
|
-
```
|
|
31
35
|
|
|
32
|
-
|
|
33
|
-
```bash
|
|
36
|
+
// then publish the package to npm so that it can be consumed by other projects
|
|
34
37
|
npm publish
|
|
35
38
|
```
|
|
36
39
|
|
|
37
|
-
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "czapp-shared",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "This is a shared library for Czapp projects. It contains common code that is used across multiple projects.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"typings": "dist/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"test
|
|
9
|
+
"test": "mocha --require ts-node/register/transpile-only test/**/*.ts",
|
|
10
10
|
"build": "tsup src/index.ts --clean --format=cjs,esm --dts",
|
|
11
11
|
"release:bump": "bumpp"
|
|
12
12
|
},
|
package/test/util/util.test.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { expect } from 'chai';
|
|
2
|
-
import { MySQLDate } from '../../lib';
|
|
3
2
|
import {
|
|
4
3
|
convertJSDateObjectToMySQLDateString,
|
|
5
4
|
convertJSDateStringToMySQLDate, dateDifferenceInDays, isClientDateTooFarFromServerDate,
|
|
6
5
|
isThePreviousDay,
|
|
7
|
-
isTheSameDay, isValidJsDateString, isValidMysqlDateString
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
isTheSameDay, isValidJsDateString, isValidMysqlDateString,
|
|
7
|
+
MySQLDate
|
|
8
|
+
} from '../../src';
|
|
11
9
|
describe('Date', () => {
|
|
12
10
|
describe('isTheSameDay', () => {
|
|
13
11
|
it('should return true if both dates are the same calendar day', () => {
|