@aptre/common 0.16.4 → 0.16.6

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.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { ExampleMsg } from './example.pb.js';
3
+ import { OtherMsg } from './other/other.pb.js';
4
+ describe('ExampleMsg', () => {
5
+ it('should create an empty message', () => {
6
+ const msg = ExampleMsg.create();
7
+ expect(msg).toEqual({});
8
+ });
9
+ it('should create a message with an example field', () => {
10
+ const msg = ExampleMsg.create({ exampleField: 'hello' });
11
+ expect(msg).toEqual({ exampleField: 'hello' });
12
+ });
13
+ it('should create a message with an other message field', () => {
14
+ const other = OtherMsg.create({ fooField: 1 });
15
+ const msg = ExampleMsg.create({ otherMsg: other });
16
+ expect(msg).toEqual({ otherMsg: { fooField: 1 } });
17
+ });
18
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vite").UserConfig;
2
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import { configDefaults, defineConfig } from 'vitest/config';
2
+ import { resolve } from 'path';
3
+ export default defineConfig({
4
+ test: {
5
+ exclude: [...configDefaults.exclude, 'dist', 'vendor'],
6
+ alias: {
7
+ "@go/*": resolve(__dirname, "./vendor/*"),
8
+ },
9
+ },
10
+ });
package/go.mod.tools CHANGED
@@ -11,11 +11,11 @@ replace (
11
11
  require (
12
12
  github.com/aperturerobotics/goprotowrap v0.3.1 // latest
13
13
  github.com/aperturerobotics/protobuf-go-lite v0.6.5 // latest
14
- github.com/aperturerobotics/starpc v0.32.9 // latest
14
+ github.com/aperturerobotics/starpc v0.32.10 // latest
15
15
  )
16
16
 
17
17
  require (
18
- github.com/golangci/golangci-lint v1.58.1 // latest
18
+ github.com/golangci/golangci-lint v1.58.2 // latest
19
19
  github.com/goreleaser/goreleaser v1.26.1 // latest
20
20
  github.com/psampaz/go-mod-outdated v0.9.0 // latest
21
21
  golang.org/x/tools v0.21.0 // latest
@@ -38,7 +38,7 @@ require (
38
38
  github.com/Abirdcfly/dupword v0.0.14 // indirect
39
39
  github.com/AlekSi/pointer v1.2.0 // indirect
40
40
  github.com/Antonboom/errname v0.1.13 // indirect
41
- github.com/Antonboom/nilnil v0.1.8 // indirect
41
+ github.com/Antonboom/nilnil v0.1.9 // indirect
42
42
  github.com/Antonboom/testifylint v1.2.0 // indirect
43
43
  github.com/Azure/azure-sdk-for-go v68.0.0+incompatible // indirect
44
44
  github.com/Azure/azure-sdk-for-go/sdk/azcore v1.10.0 // indirect
@@ -168,7 +168,7 @@ require (
168
168
  github.com/emirpasic/gods v1.18.1 // indirect
169
169
  github.com/ettle/strcase v0.2.0 // indirect
170
170
  github.com/evanphx/json-patch/v5 v5.6.0 // indirect
171
- github.com/fatih/color v1.16.0 // indirect
171
+ github.com/fatih/color v1.17.0 // indirect
172
172
  github.com/fatih/structtag v1.2.0 // indirect
173
173
  github.com/felixge/httpsnoop v1.0.4 // indirect
174
174
  github.com/firefart/nonamedreturns v1.0.5 // indirect
@@ -228,7 +228,7 @@ require (
228
228
  github.com/google/go-github/v62 v62.0.0 // indirect
229
229
  github.com/google/go-querystring v1.1.0 // indirect
230
230
  github.com/google/ko v0.15.2 // indirect
231
- github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b // indirect
231
+ github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 // indirect
232
232
  github.com/google/rpmpack v0.6.1-0.20240329070804-c2247cbb881a // indirect
233
233
  github.com/google/s2a-go v0.1.7 // indirect
234
234
  github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 // indirect
@@ -289,7 +289,7 @@ require (
289
289
  github.com/kunwardeep/paralleltest v1.0.10 // indirect
290
290
  github.com/kylelemons/godebug v1.1.0 // indirect
291
291
  github.com/kyoh86/exportloopref v0.1.11 // indirect
292
- github.com/lasiar/canonicalheader v1.0.6 // indirect
292
+ github.com/lasiar/canonicalheader v1.1.1 // indirect
293
293
  github.com/ldez/gomoddirectives v0.2.4 // indirect
294
294
  github.com/ldez/tagliatelle v0.5.0 // indirect
295
295
  github.com/leonklingele/grouper v1.1.2 // indirect
@@ -367,7 +367,7 @@ require (
367
367
  github.com/sashamelentyev/usestdlibvars v1.25.0 // indirect
368
368
  github.com/scylladb/go-set v1.0.3-0.20200225121959-cc7b2070d91e // indirect
369
369
  github.com/secure-systems-lab/go-securesystemslib v0.8.0 // indirect
370
- github.com/securego/gosec/v2 v2.19.0 // indirect
370
+ github.com/securego/gosec/v2 v2.20.0 // indirect
371
371
  github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
372
372
  github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect
373
373
  github.com/shopspring/decimal v1.2.0 // indirect
@@ -419,7 +419,7 @@ require (
419
419
  github.com/ykadowak/zerologlint v0.1.5 // indirect
420
420
  gitlab.com/bosi/decorder v0.4.2 // indirect
421
421
  gitlab.com/digitalxero/go-conventional-commit v1.0.7 // indirect
422
- go-simpler.org/musttag v0.12.1 // indirect
422
+ go-simpler.org/musttag v0.12.2 // indirect
423
423
  go-simpler.org/sloglint v0.6.0 // indirect
424
424
  go.mongodb.org/mongo-driver v1.14.0 // indirect
425
425
  go.opencensus.io v0.24.0 // indirect
package/go.sum.tools CHANGED
@@ -27,6 +27,7 @@ github.com/Antonboom/errname v0.1.13 h1:JHICqsewj/fNckzrfVSe+T33svwQxmjC+1ntDsHO
27
27
  github.com/Antonboom/errname v0.1.13/go.mod h1:uWyefRYRN54lBg6HseYCFhs6Qjcy41Y3Jl/dVhA87Ns=
28
28
  github.com/Antonboom/nilnil v0.1.8 h1:97QG7xrLq4TBK2U9aFq/I8Mcgz67pwMIiswnTA9gIn0=
29
29
  github.com/Antonboom/nilnil v0.1.8/go.mod h1:iGe2rYwCq5/Me1khrysB4nwI7swQvjclR8/YRPl5ihQ=
30
+ github.com/Antonboom/nilnil v0.1.9/go.mod h1:iGe2rYwCq5/Me1khrysB4nwI7swQvjclR8/YRPl5ihQ=
30
31
  github.com/Antonboom/testifylint v1.2.0 h1:015bxD8zc5iY8QwTp4+RG9I4kIbqwvGX9TrBbb7jGdM=
31
32
  github.com/Antonboom/testifylint v1.2.0/go.mod h1:rkmEqjqVnHDRNsinyN6fPSLnoajzFwsCcguJgwADBkw=
32
33
  github.com/Azure/azure-sdk-for-go v68.0.0+incompatible h1:fcYLmCpyNYRnvJbPerq7U0hS+6+I79yEDJBqVNcqUzU=
@@ -143,6 +144,7 @@ github.com/aperturerobotics/protobuf-go-lite v0.6.5 h1:AuPPcZ7ZaJe9ZYYC4gF7/5/Xb
143
144
  github.com/aperturerobotics/protobuf-go-lite v0.6.5/go.mod h1:YTbfnUj3feSULhs8VgepAHFnF3wUc0CPj4jd2axy21I=
144
145
  github.com/aperturerobotics/starpc v0.32.9 h1:RVhpoLzY5SMz+9To4mg1sqO70LpWDLvRYCKJQnYKv/s=
145
146
  github.com/aperturerobotics/starpc v0.32.9/go.mod h1:V/wN7Y+OHchsdZ8DcTS1qSUVs7yWJZuaGA0g/aLiq1w=
147
+ github.com/aperturerobotics/starpc v0.32.10/go.mod h1:nc3qveJAMZJlRpHZyHm0yvESvCbU0xx38mc/nMvpb0o=
146
148
  github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
147
149
  github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
148
150
  github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
@@ -368,6 +370,7 @@ github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJ
368
370
  github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4=
369
371
  github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
370
372
  github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
373
+ github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
371
374
  github.com/fatih/set v0.2.1 h1:nn2CaJyknWE/6txyUDGwysr3G5QC6xWB/PtVjPBbeaA=
372
375
  github.com/fatih/set v0.2.1/go.mod h1:+RKtMCH+favT2+3YecHGxcc0b4KyVWA1QWWJUs4E0CI=
373
376
  github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4=
@@ -498,6 +501,7 @@ github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e h1:ULcKCDV1LOZPFxGZ
498
501
  github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e/go.mod h1:Pm5KhLPA8gSnQwrQ6ukebRcapGb/BG9iUkdaiCcGHJM=
499
502
  github.com/golangci/golangci-lint v1.58.1 h1:IYKjkt7nofq/mYXiDUyJiBZQi5kxD0jPCjBy6VXxjz8=
500
503
  github.com/golangci/golangci-lint v1.58.1/go.mod h1:IX9uSbhwDDOVTcceKZWmshlally+fOQYv1pZhIJCMNw=
504
+ github.com/golangci/golangci-lint v1.58.2/go.mod h1:QH/aRLQIdNuOqEiki+4En6/k2SmeOsRJU/oiYffM1Ow=
501
505
  github.com/golangci/misspell v0.5.1 h1:/SjR1clj5uDjNLwYzCahHwIOPmQgoH04AyQIiWGbhCM=
502
506
  github.com/golangci/misspell v0.5.1/go.mod h1:keMNyY6R9isGaSAu+4Q8NMBwMPkh15Gtc8UCVoDtAWo=
503
507
  github.com/golangci/modinfo v0.3.4 h1:oU5huX3fbxqQXdfspamej74DFX0kyGLkw1ppvXoJ8GA=
@@ -538,6 +542,7 @@ github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdf
538
542
  github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk=
539
543
  github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b h1:RMpPgZTSApbPf7xaVel+QkoGPRLFLrwFO89uDUHEGf0=
540
544
  github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik=
545
+ github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw=
541
546
  github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
542
547
  github.com/google/rpmpack v0.6.1-0.20240329070804-c2247cbb881a h1:JJBdjSfqSy3mnDT0940ASQFghwcZ4y4cb6ttjAoXqwE=
543
548
  github.com/google/rpmpack v0.6.1-0.20240329070804-c2247cbb881a/go.mod h1:uqVAUVQLq8UY2hCDfmJ/+rtO3aw7qyhc90rCVEabEfI=
@@ -712,6 +717,7 @@ github.com/kyoh86/exportloopref v0.1.11 h1:1Z0bcmTypkL3Q4k+IDHMWTcnCliEZcaPiIe0/
712
717
  github.com/kyoh86/exportloopref v0.1.11/go.mod h1:qkV4UF1zGl6EkF1ox8L5t9SwyeBAZ3qLMd6up458uqA=
713
718
  github.com/lasiar/canonicalheader v1.0.6 h1:LJiiZ/MzkqibXOL2v+J8+WZM21pM0ivrBY/jbm9f5fo=
714
719
  github.com/lasiar/canonicalheader v1.0.6/go.mod h1:GfXTLQb3O1qF5qcSTyXTnfNUggUNyzbkOSpzZ0dpUJo=
720
+ github.com/lasiar/canonicalheader v1.1.1/go.mod h1:cXkb3Dlk6XXy+8MVQnF23CYKWlyA7kfQhSw2CcZtZb0=
715
721
  github.com/ldez/gomoddirectives v0.2.4 h1:j3YjBIjEBbqZ0NKtBNzr8rtMHTOrLPeiwTkfUJZ3alg=
716
722
  github.com/ldez/gomoddirectives v0.2.4/go.mod h1:oWu9i62VcQDYp9EQ0ONTfqLNh+mDLWWDO+SO0qSQw5g=
717
723
  github.com/ldez/tagliatelle v0.5.0 h1:epgfuYt9v0CG3fms0pEgIMNPuFf/LpPIfjk4kyqSioo=
@@ -924,6 +930,7 @@ github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbm
924
930
  github.com/secure-systems-lab/go-securesystemslib v0.8.0/go.mod h1:UH2VZVuJfCYR8WgMlCU1uFsOUU+KeyrTWcSS73NBOzU=
925
931
  github.com/securego/gosec/v2 v2.19.0 h1:gl5xMkOI0/E6Hxx0XCY2XujA3V7SNSefA8sC+3f1gnk=
926
932
  github.com/securego/gosec/v2 v2.19.0/go.mod h1:hOkDcHz9J/XIgIlPDXalxjeVYsHxoWUc5zJSHxcB8YM=
933
+ github.com/securego/gosec/v2 v2.20.0/go.mod h1:hkiArbBZLwK1cehBcg3oFWUlYPWTBffPwwJVWChu83o=
927
934
  github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
928
935
  github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
929
936
  github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
@@ -1080,6 +1087,7 @@ go-simpler.org/assert v0.7.0 h1:OzWWZqfNxt8cLS+MlUp6Tgk1HjPkmgdKBq9qvy8lZsA=
1080
1087
  go-simpler.org/assert v0.7.0/go.mod h1:74Eqh5eI6vCK6Y5l3PI8ZYFXG4Sa+tkr70OIPJAUr28=
1081
1088
  go-simpler.org/musttag v0.12.1 h1:yaMcjl/uyVnd1z6GqIhBiFH/PoqNN9f2IgtU7bp7W/0=
1082
1089
  go-simpler.org/musttag v0.12.1/go.mod h1:46HKu04A3Am9Lne5kKP0ssgwY3AeIlqsDzz3UxKROpY=
1090
+ go-simpler.org/musttag v0.12.2/go.mod h1:uN1DVIasMTQKk6XSik7yrJoEysGtR2GRqvWnI9S7TYM=
1083
1091
  go-simpler.org/sloglint v0.6.0 h1:0YcqSVG7LI9EVBfRPhgPec79BH6X6mwjFuUR5Mr7j1M=
1084
1092
  go-simpler.org/sloglint v0.6.0/go.mod h1:+kJJtebtPePWyG5boFwY46COydAggADDOHM22zOvzBk=
1085
1093
  go.mongodb.org/mongo-driver v1.14.0 h1:P98w8egYRjYe3XDjxhYJagTokP/H6HzlsnojRgZRd80=
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aptre/common",
3
3
  "description": "Common project configuration files and dependencies.",
4
- "version": "0.16.4",
4
+ "version": "0.16.6",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "name": "Aperture Robotics LLC.",
@@ -54,9 +54,10 @@
54
54
  "format:js:changed": "git diff --name-only --diff-filter=d HEAD | grep '\\(\\.ts\\|\\.tsx\\|\\.html\\|\\.css\\|\\.scss\\)$' | xargs -I {} prettier --write {}",
55
55
  "format:js:all": "prettier --write './!(vendor|dist)/**/(*.ts|*.tsx|*.js|*.html|*.css)'",
56
56
  "gen": "rimraf ./.tools && go mod tidy && cd ./tools && go mod tidy && cd ../ && bash embed.bash && npm run format && make genproto",
57
- "test": "make test && npm run check",
58
- "test:js": "echo No JS tests.",
59
57
  "demo": "make demo",
58
+ "test": "npm run test:js && npm run test:go",
59
+ "test:js": "vitest run && npm run typecheck",
60
+ "test:go": "make test",
60
61
  "lint": "npm run lint:go && npm run lint:js",
61
62
  "lint:go": "make lint",
62
63
  "lint:js": "ESLINT_USE_FLAT_CONFIG=false eslint -c .eslintrc.cjs ./",
@@ -78,11 +79,12 @@
78
79
  "@aptre/protobuf-es-lite": "^0.4.4",
79
80
  "@typescript-eslint/eslint-plugin": "^7.8.0",
80
81
  "@typescript-eslint/parser": "^7.8.0",
81
- "eslint": "^9.2.0",
82
+ "eslint": "^8.0.0",
82
83
  "eslint-config-prettier": "^9.0.0",
83
84
  "eslint-plugin-react-hooks": "^4.6.1",
84
85
  "eslint-plugin-unused-imports": "^3.2.0",
85
- "starpc": "^0.32.9"
86
+ "starpc": "^0.32.10",
87
+ "vitest": "^1.6.0"
86
88
  },
87
89
  "resolutions": {
88
90
  "@aptre/protobuf-es-lite": "0.4.4"