Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

Commit 2875b1d

Browse files
authored
knack-avro -> ts & misc related changes (#30)
* knack-avro -> ts & misc related changes * revert to npm i bc no lock used at root * add node to knack-avro tsconfig types * update knack-avro version to align with latest version * update knack-avro exports to export streams for reverse compat * update cli and pckg versions * misc * v1.0.0 * fix array type construction * v1.1.0 * cli help & error handling update * v1.2.0 * convert json to avsc Type before sending to knack-avro * v1.3.0 * reorg test data and fix doc hoisting for avsc -> json schema * add test for more complex avsc -> json schema sets * v1.4.0 * doc updates and typo * v1.4.1
1 parent 80676b4 commit 2875b1d

File tree

95 files changed

+3692
-2134
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+3692
-2134
lines changed

.circleci/config.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2.1
33
defaults: &defaults
44
working_directory: ~/repo
55
docker:
6-
- image: lxghtless/node-lerna:1.0.0
6+
- image: lxghtless/node-lerna:1.1.0
77

88
orbs:
99
codecov: codecov/codecov@1.0.5
@@ -21,6 +21,8 @@ jobs:
2121
- run: npm i
2222
- run: lerna init
2323
- run: lerna bootstrap --hoist
24+
# run build on all packages that have a build command
25+
- run: lerna run build
2426
- save_cache:
2527
paths:
2628
- node_modules
@@ -43,7 +45,6 @@ jobs:
4345
flags: 'unittests'
4446

4547
workflows:
46-
version: 2.1
4748
build-test-codecov:
4849
jobs:
4950
- build

lerna.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"packages": [
33
"packages/*"
44
],
5-
"version": "0.4.0"
5+
"version": "1.4.1"
66
}

monorepoMergeReports.js

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env node
2+
'use strict';
3+
4+
const path = require('path');
5+
const {spawnSync} = require('child_process');
6+
7+
const rimraf = require('rimraf');
8+
const makeDir = require('make-dir');
9+
const glob = require('glob');
10+
11+
process.chdir(__dirname);
12+
rimraf.sync('.nyc_output');
13+
makeDir.sync('.nyc_output');
14+
// Merge coverage data from each package so we can generate a complete report
15+
glob.sync('packages/*/.nyc_output').forEach(nycOutput => {
16+
const cwd = path.dirname(nycOutput);
17+
const {status, stderr} = spawnSync(
18+
'nyc',
19+
[
20+
'merge',
21+
'.nyc_output',
22+
path.join(__dirname, '.nyc_output', path.basename(cwd) + '.json')
23+
],
24+
{
25+
encoding: 'utf8',
26+
shell: true,
27+
cwd
28+
}
29+
);
30+
31+
if (status !== 0) {
32+
console.error(stderr);
33+
process.exit(status);
34+
}
35+
});

package.json

+5-14
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,16 @@
55
"node": ">=10.18.0 <11 || >=12.14.0 <13 || >=13.5.0"
66
},
77
"scripts": {
8-
"test": "xo && nyc ava"
8+
"pretest": "xo",
9+
"test": "lerna run test",
10+
"posttest": "node ./monorepoMergeReports.js && nyc report"
911
},
1012
"devDependencies": {
11-
"ava": "^3.5.0",
1213
"husky": "^3.0.1",
1314
"lerna": "^3.20.2",
1415
"nyc": "^15.0.0",
15-
"xo": "^0.27.2"
16-
},
17-
"ava": {
18-
"files": [
19-
"packages/knack-*/test/**/*.test.js"
20-
],
21-
"concurrency": 5,
22-
"failFast": true,
23-
"failWithoutAssertions": false,
24-
"environmentVariables": {},
25-
"tap": false,
26-
"verbose": true
16+
"rimraf": "^3.0.2",
17+
"xo": "^0.29.1"
2718
},
2819
"nyc": {
2920
"reporter": [

packages/knack-avro/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ yarn.lock
33
.nyc_output
44
coverage
55
.DS_Store
6+
dist

packages/knack-avro/index.js

-27
This file was deleted.

packages/knack-avro/package.json

+123-73
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,125 @@
11
{
2-
"name": "@optum/knack-avro",
3-
"version": "0.4.0",
4-
"description": "A module for encoding and decoding avro with Kafka.",
5-
"license": "Apache-2.0",
6-
"licenses": [
7-
{
8-
"type": "Apache-2.0",
9-
"url": "http://www.apache.org/licenses/LICENSE-2.0"
10-
}
11-
],
12-
"repository": "optum/knack",
13-
"author": {
14-
"name": "lxghtless",
15-
"email": "william.kurth@optum.com",
16-
"url": "https://github.com/lxghtless"
17-
},
18-
"publishConfig": {
19-
"access": "public"
20-
},
21-
"engines": {
22-
"node": ">=10.18.0 <11 || >=12.14.0 <13 || >=13.5.0"
23-
},
24-
"scripts": {
25-
"test": "xo && nyc ava"
26-
},
27-
"files": [
28-
"index.js",
29-
"src"
30-
],
31-
"keywords": [
32-
"kafka"
33-
],
34-
"dependencies": {
35-
"@sindresorhus/slugify": "^0.11.0",
36-
"avsc": "^5.4.18",
37-
"is-object-empty": "^2.0.1",
38-
"ramda": "^0.27.0"
39-
},
40-
"devDependencies": {
41-
"ava": "^3.5.0",
42-
"fs-extra": "^8.1.0",
43-
"nyc": "^15.0.0",
44-
"xo": "^0.27.2"
45-
},
46-
"nyc": {
47-
"reporter": [
48-
"lcov",
49-
"text"
50-
]
51-
},
52-
"ava": {
53-
"failfast": false
54-
},
55-
"xo": {
56-
"envs": [
57-
"node"
58-
],
59-
"rules": {
60-
"unicorn/catch-error-name": [
61-
"error",
62-
{
63-
"caughtErrorsIgnorePattern": "^_$"
64-
}
65-
],
66-
"unicorn/filename-case": [
67-
"error",
68-
{
69-
"case": "camelCase"
70-
}
71-
],
72-
"capitalized-comments": 0
73-
}
74-
}
2+
"name": "@optum/knack-avro",
3+
"version": "1.4.1",
4+
"description": "A module for encoding and decoding avro with Kafka.",
5+
"license": "Apache-2.0",
6+
"licenses": [
7+
{
8+
"type": "Apache-2.0",
9+
"url": "http://www.apache.org/licenses/LICENSE-2.0"
10+
}
11+
],
12+
"repository": "optum/knack",
13+
"author": {
14+
"name": "lxghtless",
15+
"email": "william.kurth@optum.com",
16+
"url": "https://github.com/lxghtless"
17+
},
18+
"publishConfig": {
19+
"access": "public"
20+
},
21+
"engines": {
22+
"node": ">=10.18.0 <11 || >=12.14.0 <13 || >=13.5.0"
23+
},
24+
"scripts": {
25+
"test": "npm run type-check && xo && nyc ava",
26+
"lint": "npm run type-check && xo --fix",
27+
"type-check": "tsc -p tsconfig.json --noEmit",
28+
"build": "rimraf dist && tsc -p tsconfig.build.json"
29+
},
30+
"main": "dist/index.js",
31+
"files": [
32+
"index.ts",
33+
"src",
34+
"dist"
35+
],
36+
"keywords": [
37+
"kafka"
38+
],
39+
"dependencies": {
40+
"@sindresorhus/slugify": "^0.11.0",
41+
"avsc": "^5.4.18"
42+
},
43+
"devDependencies": {
44+
"@types/fs-extra": "^8.1.0",
45+
"@types/node": "^13.11.1",
46+
"@typescript-eslint/eslint-plugin": "^2.28.0",
47+
"@typescript-eslint/parser": "^2.28.0",
48+
"ava": "^3.5.0",
49+
"eslint-config-xo-typescript": "^0.27.0",
50+
"fs-extra": "^8.1.0",
51+
"nyc": "^15.0.0",
52+
"rimraf": "^3.0.2",
53+
"ts-node": "^8.8.2",
54+
"ts-sinon": "^1.2.0",
55+
"typescript": "^3.8.3",
56+
"xo": "^0.29.1"
57+
},
58+
"nyc": {
59+
"all": true,
60+
"reporter": [
61+
"lcov",
62+
"text"
63+
],
64+
"extension": [
65+
".ts"
66+
],
67+
"require": [
68+
"ts-node/register"
69+
],
70+
"include": [
71+
"index.ts",
72+
"src/**/*.ts"
73+
]
74+
},
75+
"ava": {
76+
"extensions": [
77+
"ts"
78+
],
79+
"require": [
80+
"ts-node/register",
81+
"source-map-support/register"
82+
],
83+
"files": [
84+
"test/*.ts",
85+
"test/**/*.ts",
86+
"!test/types.ts"
87+
],
88+
"cache": true,
89+
"concurrency": 5,
90+
"failFast": true,
91+
"verbose": true
92+
},
93+
"xo": {
94+
"envs": [
95+
"node"
96+
],
97+
"extends": [
98+
"xo-typescript"
99+
],
100+
"extensions": [
101+
"ts"
102+
],
103+
"prettier": true,
104+
"semicolon": false,
105+
"space": 4,
106+
"rules": {
107+
"unicorn/catch-error-name": [
108+
"error",
109+
{
110+
"caughtErrorsIgnorePattern": "^_$"
111+
}
112+
],
113+
"unicorn/filename-case": [
114+
"error",
115+
{
116+
"case": "camelCase"
117+
}
118+
],
119+
"capitalized-comments": 0,
120+
"ava/no-ignored-test-files": 0,
121+
"ava/no-import-test-files": 0,
122+
"@typescript-eslint/prefer-readonly-parameter-types": 0
123+
}
124+
}
75125
}

0 commit comments

Comments
 (0)