Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/batch get #656

Closed
wants to merge 409 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
409 commits
Select commit Hold shift + click to select a range
c796339
remove obsolete TODOs
ThomasAribart Apr 17, 2023
caf8acc
fix bug in conditions parsing
ThomasAribart Apr 17, 2023
1597da5
improve entityNameAttributeName error message
ThomasAribart Apr 17, 2023
957f031
improve invalidConditionAttributePath error message
ThomasAribart Apr 17, 2023
30aba21
improve putItemCommand error messages
ThomasAribart Apr 17, 2023
7280b7a
improve command error codes
ThomasAribart Apr 17, 2023
942a1e5
support anyOf attributes in commands
ThomasAribart Apr 19, 2023
bc23e37
support anyOf attributes in formatSavedItem
ThomasAribart Apr 20, 2023
8205a4b
make const method set default value as well
ThomasAribart Apr 21, 2023
9cb7b14
rework item error codes
ThomasAribart Apr 21, 2023
448d2bc
add ts 5.0.4 in pr tests
ThomasAribart Apr 21, 2023
fab0d6e
update pr workflow
ThomasAribart Apr 21, 2023
8aa08df
rename putItemParams error codes
ThomasAribart Apr 21, 2023
1546bde
use dynamodb toolbox errors in parseKeyInput
ThomasAribart Apr 21, 2023
396dd8c
fix typo in parsePutCommandInput error messages
ThomasAribart Apr 21, 2023
fc0f765
use DynamoDBToolboxError in formatSavedItem
ThomasAribart Apr 21, 2023
76a147a
implement last missing errors
ThomasAribart Apr 21, 2023
58ad96d
allow anyOf in conditions & filters
ThomasAribart Apr 24, 2023
0c66ac7
close TODOs in commands tests
ThomasAribart Apr 24, 2023
2b9e906
support renaming savedAs attributes for record elements
ThomasAribart Apr 24, 2023
c838b6f
add validation of item schema in entity constructor
ThomasAribart Apr 24, 2023
92371fb
remove unnecessary TODOs
ThomasAribart Apr 24, 2023
fe0452d
rework cloneInputAndAddDefaults code
ThomasAribart Apr 24, 2023
ee53bbd
move cloneInputAndAddDefaults utils in new validation root folder
ThomasAribart Apr 24, 2023
c87c688
create parseClonedInput shared util
ThomasAribart Apr 28, 2023
964bf88
use new util in parseKeyInput
ThomasAribart Apr 28, 2023
a2fbf6e
use new util in parsePutItemInput
ThomasAribart Apr 28, 2023
b196c88
validate record keys in conditions
ThomasAribart Apr 28, 2023
6e55d7d
validate attribute value in conditions
ThomasAribart Apr 28, 2023
96e20b0
add support for timestamp (no renaming / no aliasing)
ThomasAribart May 12, 2023
5fa147d
enable customizing timestamps fields & aliases
ThomasAribart May 12, 2023
ea3f925
split commands/types file in folder
ThomasAribart May 15, 2023
de15baa
move condition/types to types/condition
ThomasAribart May 15, 2023
7b93646
split condition file in paths & condition
ThomasAribart May 15, 2023
50f605f
add attributes field in getItem interface (but not implement it for now)
ThomasAribart May 15, 2023
6abade1
move conditionParser into classes/conditionParser
ThomasAribart May 15, 2023
bd17585
rework conditionParser to factorize appendAttributePath with expressi…
ThomasAribart May 15, 2023
07ee3cc
create ProjectionParser similar to ConditionParser
ThomasAribart May 15, 2023
11894ba
create & use parseProjection util
ThomasAribart May 15, 2023
a923295
support projection expressions in formatSavedItem
ThomasAribart May 15, 2023
91633a0
test (and fix) projection expressions
ThomasAribart May 15, 2023
65c7a13
type getItem response Item according to projected attributes
ThomasAribart May 15, 2023
266860d
remove obsolete TODO
ThomasAribart May 15, 2023
98488a0
fix some bugs in type inference
ThomasAribart May 19, 2023
50f5015
add @aws-sdk/client-dynamodb and @aws-sdk/lib-dynamodb as peer depend…
ThomasAribart May 26, 2023
ee8e520
export attribute and attr short hands
ThomasAribart May 26, 2023
ef6698d
make any attributes return unknown in types
ThomasAribart May 26, 2023
6f08ead
consistently make Record types partial
ThomasAribart May 26, 2023
7d57b25
rework command API
ThomasAribart May 29, 2023
2f2bb4f
rename item to schema
ThomasAribart May 29, 2023
f6697a4
remove onlyOnce required option while update is not implemented
ThomasAribart May 31, 2023
c7d1acf
provide entity to parseCondition instead of schema
ThomasAribart May 31, 2023
3188ff5
provide entity to parseExpression instead of schema
ThomasAribart May 31, 2023
2f43c4d
rework timestamps options
ThomasAribart Jun 2, 2023
c4a174a
rename entity name attribute to entity attribute
ThomasAribart Jun 2, 2023
f97caf4
remove playground code
ThomasAribart Jun 9, 2023
4d421ff
Revert "remove playground code"
ThomasAribart Jun 29, 2023
d5627bc
enable hiding timestamp attributes
ThomasAribart Jun 29, 2023
04cac11
extend FormattedItem options
ThomasAribart Jun 29, 2023
2015e05
add partial option to FormattedItem
ThomasAribart Jun 29, 2023
29dae42
add partial option to formatSavedItem util
ThomasAribart Jun 29, 2023
03ce834
correctly handle partial items in putItemCommand
ThomasAribart Jun 29, 2023
60a7c06
remove params caching in commands
ThomasAribart Jun 29, 2023
496eb0e
improve implementation of anyOf attributes parsing
ThomasAribart Jun 29, 2023
9b962ac
split default in putDefault and updateDefault
Jul 3, 2023
e9a41fe
factorize defaults checking
Jul 3, 2023
39b5b2a
make cloneInputAndAddDefaults use expected default
ThomasAribart Jul 5, 2023
0f88931
prepare updateCommand implementation
ThomasAribart Jul 6, 2023
0f06ba0
use key default in all commands if attribute is key
ThomasAribart Jul 10, 2023
064ce13
take PR feedbacks
ThomasAribart Jul 10, 2023
7322c09
remove prepare script
ThomasAribart Jul 10, 2023
ce3b449
reset npm-lock
ThomasAribart Jul 10, 2023
5279d72
fix some typos
ThomasAribart Jul 10, 2023
6aecbf0
remove PutItem generic (keep only PutItemInput)
ThomasAribart Jul 10, 2023
2efa4e2
move PutItemInput and KeyInput types in commands folder
ThomasAribart Jul 10, 2023
dbed5e4
rework UpdateItemInput as well
ThomasAribart Jul 10, 2023
6712c72
rework KeyInput as well
ThomasAribart Jul 10, 2023
b078287
Merge pull request #556 from jeremydaly/clean-some-code
ThomasAribart Jul 10, 2023
c4fdc82
start implementing update command
ThomasAribart Jul 12, 2023
c9cd20c
Merge pull request #561 from jeremydaly/create-update-command
ThomasAribart Jul 12, 2023
9d18811
move classes to utils/expressionParsers
ThomasAribart Jul 17, 2023
7e128a7
add prefix to current expression attribute names & values
ThomasAribart Jul 17, 2023
e29f594
simplify PossiblyUndefinedResolvedAttribute and Item definitions
Jul 24, 2023
3d69809
use ADDITIONAL_RESOLUTIONS everywhere
Jul 24, 2023
5f9e4a9
rename RESOLUTIONS to EXTENSIONS for clarity
Jul 24, 2023
6bf7bb8
Merge pull request #564 from jeremydaly/implement-update-item-validation
ThomasAribart Jul 24, 2023
3a47ee2
rename ResolvedAttribute to AttributeValue for more clarity
Jul 24, 2023
b461988
create BasicValues next to ExtendedValues
Jul 24, 2023
4af22bf
Merge pull request #565 from jeremydaly/implement-update-item-validat…
ThomasAribart Jul 24, 2023
2def480
start using extensions with , and
Jul 26, 2023
6c73f6a
Merge pull request #567 from jeremydaly/implement-update-item-validat…
ThomasAribart Jul 26, 2023
b8087aa
rename handleExtension to cloneExtension
Aug 2, 2023
5a7cc02
validate udpate inputs
Aug 2, 2023
149c18c
use If helper type everywhere
Aug 2, 2023
9391463
Merge pull request #568 from jeremydaly/implement-update-item-validat…
ThomasAribart Aug 2, 2023
64d19a0
enable updating or removing list elements
Aug 2, 2023
5ba2392
enable complete override of maps and records
Aug 2, 2023
b6638d9
rename update symbols and utils
Aug 2, 2023
d99bc7d
support append and prepend operations
Aug 2, 2023
63909d0
temporary comment failing test
Aug 2, 2023
bd730de
Merge pull request #569 from jeremydaly/complete-update-item-validation
ThomasAribart Aug 2, 2023
ebd64dd
enable reference other attributes
Aug 7, 2023
c9b47ed
split cloneExtension file by attribute types
Aug 7, 2023
4a6c2dc
split parseExtension file by attribute types
Aug 7, 2023
83636b1
support references in append/prepend operations
Aug 7, 2023
015e159
enable fallbacks in references
Aug 7, 2023
fda7e68
Merge pull request #570 from jeremydaly/finish-updateItem-api
ThomasAribart Aug 7, 2023
27b3f4c
implement sum and subtract api
Aug 9, 2023
5daba03
Merge pull request #571 from jeremydaly/implement-sum-and-subtract-api
ThomasAribart Aug 9, 2023
310db0d
fix mistake in prepend and append types
Aug 9, 2023
4b0f4a1
Merge pull request #572 from jeremydaly/fix-mistake-in-prepend-and-ap…
ThomasAribart Aug 9, 2023
3536c58
create update expression parsers
Aug 9, 2023
484706d
Merge pull request #573 from jeremydaly/create-update-expression-parsers
ThomasAribart Aug 10, 2023
f8232c0
handle extensions while renaming inputs
Aug 21, 2023
414f977
parse delete operations
Aug 21, 2023
ff0ef88
parse add operations
Aug 21, 2023
29e5039
parse REMOVE operations
Aug 21, 2023
3db4b46
improve list support
Aug 21, 2023
2036a04
small improvement
Aug 21, 2023
93f5d0b
Merge pull request #575 from jeremydaly/parse-update-items
ThomasAribart Aug 21, 2023
c0a50ac
move some code around
Aug 23, 2023
2df92fa
handle explicit set operations
Aug 23, 2023
45533f0
support leaf updates
Aug 23, 2023
70d66cd
reduce updateItemParams noise by placing defaulted attributes last
Aug 23, 2023
0bda49a
Merge pull request #576 from jeremydaly/parse-update-items-2
ThomasAribart Aug 23, 2023
eb331a7
support sum subtract append and prepend in update expressions
Aug 30, 2023
01caf89
Merge pull request #579 from jeremydaly/support-sum-subtract-append-a…
ThomasAribart Aug 30, 2023
9ca3b53
provide descriptions to Symbols
Sep 4, 2023
3113b8c
finish update item command
Sep 4, 2023
a1fac86
decouple PutItemInput from UpdateItemInput types
Sep 4, 2023
2ac9280
fix typing issue
Sep 4, 2023
cb246d1
rework some types
Sep 4, 2023
dedde91
Merge pull request #582 from jeremydaly/finish-update-item-command
ThomasAribart Sep 4, 2023
2c71fbc
finalize update item command
Sep 6, 2023
28c85cb
enable providing table names via getters
Sep 11, 2023
ece00af
Merge pull request #584 from jeremydaly/enable-providing-table-name-v…
ThomasAribart Sep 11, 2023
6fd8f30
rework and export some types
Sep 11, 2023
a257276
install ts-node
Sep 11, 2023
7c4aecf
create test-tools
Sep 11, 2023
69f13bd
Merge pull request #585 from jeremydaly/create-test-tools
ThomasAribart Sep 11, 2023
9064e31
use symbols instead of public properties
Sep 13, 2023
691c5f3
create CommandResults class
Sep 13, 2023
5a30e6d
enable mocking delete commands
Sep 13, 2023
cb83463
enable mocking update commands
Sep 13, 2023
ed79a3d
simplify code
Sep 13, 2023
d27c2eb
Merge pull request #586 from jeremydaly/create-test-tools-2
ThomasAribart Sep 13, 2023
359c091
remove obsolete type
Sep 18, 2023
1448101
create UpdateDefaultsComputer
Sep 18, 2023
ab8857e
rework entity class to handle updateDefaults
Sep 18, 2023
bcb43c3
Merge pull request #587 from jeremydaly/enable-dependant-update-defaults
ThomasAribart Sep 18, 2023
400f561
enable providing incremental updates in primitives (but not really we…
Sep 20, 2023
3230d91
use new updateDefault in internal attributes
Sep 20, 2023
ae5dc46
rollback test update
Sep 20, 2023
58d6894
Merge pull request #591 from jeremydaly/enable-update-operations-in-u…
ThomasAribart Sep 20, 2023
21d60ca
fix publish script
Sep 21, 2023
4a59afe
Merge pull request #594 from jeremydaly/fix-deploy-script
ThomasAribart Sep 21, 2023
b435179
fix: bug in timestamp options
Sep 25, 2023
662f8ed
Merge pull request #596 from jeremydaly/fix-bug-in-timestamp-options
ThomasAribart Sep 25, 2023
7cbb213
fix bug in defaults computer
Sep 27, 2023
9aec795
fix bug in key computer
Sep 27, 2023
256e7ee
Merge pull request #598 from jeremydaly/fix-minor-bugs
ThomasAribart Sep 27, 2023
b9a1ceb
fix small mistake in default computers typing
Sep 27, 2023
db865c0
Merge pull request #599 from jeremydaly/fix-minor-bug-2
ThomasAribart Sep 27, 2023
7074e3e
export test-tools
Oct 9, 2023
a2c9f81
Merge pull request #601 from jeremydaly/export-test-tools
ThomasAribart Oct 9, 2023
7038fe8
enable combining schemas with the .and method
Oct 11, 2023
a81160a
feat: export utility helpers in dynamodb-toolbox v1
guillaumeduboc Oct 12, 2023
776a4cb
Merge pull request #604 from guillaumeduboc/feat/v1-utility-helpers
ThomasAribart Oct 12, 2023
647c3d7
rework attribute interfaces to add link methods
Oct 18, 2023
bec3aea
modify rest of codebase to handle new formalism
Oct 23, 2023
9c63b7e
impact new formalism in cloneInput code
Oct 23, 2023
af326fd
enable key defaults
Oct 23, 2023
daf392b
fix issue with enum type widening
Oct 23, 2023
9d60d8e
Merge pull request #614 from jeremydaly/rework-defaults
ThomasAribart Oct 23, 2023
a94b7e4
start implementing scan command
Oct 25, 2023
c03793d
Merge pull request #617 from jeremydaly/start-scan-command
ThomasAribart Oct 25, 2023
f275ccc
enable passing ids to expression parsers
Oct 30, 2023
6d841b8
enable filtering by entities
Oct 30, 2023
7e3592d
Merge pull request #618 from jeremydaly/finish-implementing-scan-comm…
ThomasAribart Oct 30, 2023
6d47096
make options generic and type scan response according to Select value
Nov 1, 2023
e368009
improve select options typing + validation to handle more edge cases
Nov 1, 2023
9f88c1b
enable projection expressions in scan command
Nov 1, 2023
11ac57f
Merge pull request #621 from jeremydaly/finish-implementing-scan-comm…
ThomasAribart Nov 1, 2023
e174d99
straighten out commandName vs commandType
Nov 6, 2023
1a2c210
intersect all possible projection expressions instead of using 1 per …
Nov 6, 2023
d1f8fec
Merge pull request #623 from jeremydaly/rework-scan-command-to-use-un…
ThomasAribart Nov 13, 2023
af2b17b
enable providing indexes on tables
Nov 13, 2023
839f228
Merge pull request #625 from jeremydaly/enable-providing-indexes-on-t…
ThomasAribart Nov 13, 2023
b9861df
split Index in LocalIndex and GlobalIndex types
Nov 15, 2023
41ce306
define query type
Nov 15, 2023
3b3a2dd
Merge pull request #626 from jeremydaly/define-query-expression-type
ThomasAribart Nov 15, 2023
055a0d9
bootstrap query table command
Nov 17, 2023
ba92f0c
Merge pull request #627 from jeremydaly/bootstrap-query-table-command
ThomasAribart Nov 17, 2023
f4d0c50
create table query command class
Nov 20, 2023
709b18a
Merge pull request #629 from jeremydaly/create-table-query-comman
ThomasAribart Nov 20, 2023
5503c7c
enable setting maxPages options in queries and scans
ThomasAribart Nov 24, 2023
72bf5ab
Merge pull request #630 from jeremydaly/implement-maxPages-option-in-…
ThomasAribart Nov 24, 2023
d9ed860
remove obsolete type
Dec 1, 2023
70bc971
enable casting on any attribute types
Dec 4, 2023
b41866b
enable casting any attributes
Dec 4, 2023
53a58ce
improve type display
Dec 4, 2023
efd2370
Merge pull request #634 from jeremydaly/enable-casting-any-attribute-…
ThomasAribart Dec 5, 2023
5e6341e
export more utils from update command
Dec 13, 2023
f2b27ea
Merge pull request #639 from jeremydaly/export-more-utils-from-update…
ThomasAribart Dec 13, 2023
e68a4c5
fix bug when querying items with filtered attributes
Dec 20, 2023
8506459
run linter
Dec 20, 2023
bebb083
Merge pull request #637 from jeremydaly/fix-bug-when-querying-items-w…
ThomasAribart Dec 20, 2023
b51809c
refactor: rename command to operation, more generic
guiyom-e Dec 22, 2023
e3a41ac
refactor: rename commands folder to operations
guiyom-e Dec 22, 2023
e2da2e6
refactor: rename commands errors to operations
guiyom-e Dec 22, 2023
ca46a56
refactor: rename command generics to operation
guiyom-e Dec 22, 2023
dedffc0
Merge pull request #643 from guiyom-e/refactor/rename-command-to-oper…
ThomasAribart Dec 22, 2023
d6b5d24
refactor: change TableCommand signature
guillaumeduboc Dec 22, 2023
5f7943b
chore: remove awfully long types for build methods
guillaumeduboc Dec 22, 2023
5b35c11
enable setting transform prop on primitive attributes
Dec 22, 2023
03befa6
create prefix transformer
Dec 22, 2023
77a7c15
pass transform option to parsed attributes
ThomasAribart Dec 24, 2023
14c96fa
rename renameInput to collapseInput in prevision of transforms
ThomasAribart Dec 24, 2023
d48abf1
Merge pull request #644 from jeremydaly/create-transform-option
ThomasAribart Dec 24, 2023
c9ff812
improve parsing: add prop to parsed attributes
ThomasAribart Dec 24, 2023
81ce67c
remove failed rebase files
ThomasAribart Dec 24, 2023
070909f
rework collapseParsedInput to use transform
ThomasAribart Dec 24, 2023
230a752
use transform while parsing items
ThomasAribart Dec 24, 2023
691e089
use format option while formatting items
ThomasAribart Dec 24, 2023
ec7180e
Merge pull request #646 from jeremydaly/implement-transform-option
ThomasAribart Dec 24, 2023
b12ad2a
test and improve transform option
ThomasAribart Jan 1, 2024
4ed418d
apply transform options in filters & conditions
ThomasAribart Jan 1, 2024
964fedf
use generators instead of functions
ThomasAribart Jan 2, 2024
1382079
remove the need for collapsers
ThomasAribart Jan 4, 2024
41ea32f
Merge pull request #647 from jeremydaly/test-and-improve-transform-op…
ThomasAribart Jan 4, 2024
dd65a3e
use generators for cloning step as well
ThomasAribart Jan 5, 2024
864aa8b
Merge pull request #648 from jeremydaly/use-generators-for-cloning-st…
ThomasAribart Jan 5, 2024
0e8dab9
Merge pull request #645 from guillaumeduboc/chore/build-generic-type
ThomasAribart Jan 6, 2024
99d42e8
add and use freeze property on warm schemas
ThomasAribart Jan 8, 2024
81e4297
simplify naming of state constraints
ThomasAribart Jan 8, 2024
44c56de
Merge pull request #649 from jeremydaly/add-and-use-freeze-property-o…
ThomasAribart Jan 8, 2024
b7db27a
print pk and sk when detecting an invalid saved item
ThomasAribart Jan 8, 2024
da5a5f8
Merge pull request #650 from jeremydaly/print-pk-and-sk-when-detectin…
ThomasAribart Jan 8, 2024
cc5053a
hide operation properties with symbols
ThomasAribart Jan 8, 2024
606dd5c
Merge pull request #651 from jeremydaly/hide-operation-properties-wit…
ThomasAribart Jan 8, 2024
ac04cac
fix bug when providing incomplete object timestamp values
Jan 11, 2024
18ff2eb
Merge pull request #653 from jeremydaly/fix-bug-when-providing-object…
ThomasAribart Jan 11, 2024
183f1bb
feat: add PutBatchItemRequest
guillaumeduboc Dec 18, 2023
dcde2d4
feat: add DeleteBatchItemRequest
guillaumeduboc Dec 18, 2023
1085e39
feat: build command input for Batch Write
guillaumeduboc Dec 18, 2023
895a76f
feat: add options to Batch Write
guillaumeduboc Dec 19, 2023
d7a54d9
feat: define batchWrite helper
guillaumeduboc Jan 12, 2024
14f3c22
refactor: change requestType to internal property
guillaumeduboc Jan 12, 2024
cee183a
chore: rename TableCommand to TableOperation
guillaumeduboc Jan 12, 2024
0355d79
--wip-- [skip ci]
guillaumeduboc Jan 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 7 additions & 20 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,28 @@
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"prettier"
],
"plugins": ["@typescript-eslint", "prefer-arrow", "unused-imports", "prettier"],
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"root": true,
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"rules": {
"linebreak-style": [
"error",
"unix"
],
"prettier/prettier": "error",
"linebreak-style": ["error", "unix"],
"quotes": [
"error",
"single",
{
"allowTemplateLiterals": true
}
],
"semi": [
"error",
"never"
],
"indent": [
"error",
2,
{
"SwitchCase": 1,
"flatTernaryExpressions": true
}
],
"semi": ["error", "never"],
// TODO: remove this rule when all the code is fully migrated to TS, atm it just produces a lot of noise
"@typescript-eslint/ban-ts-comment": "off",
// TODO: remove this rule when all the code is fully migrated to TS, atm it just produces a lot of noise
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ jobs:
# Store the name of the release
# See https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions
- run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- run: echo "RELEASE_NPM_TAG=${{ github.event.release.prerelease && 'alpha' || 'latest' }}" >> $GITHUB_ENV
- run: npm ci
- run: npm version $RELEASE_VERSION --no-git-tag-version
- run: npm run build
- run: npm publish --access public
- run: npm publish --access public --tag $RELEASE_NPM_TAG
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
36 changes: 27 additions & 9 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ 14, 16, 18 ]
name: Node ${{ matrix.node }}
node: [14, 16, 18]
typescript: ['~4.7.4', '~4.8.3', '~4.9.5', '~5.0.4', 'latest']
name: Node ${{ matrix.node }} / TS ${{ matrix.typescript }}
steps:
- name: 'Checkout latest code'
uses: actions/checkout@v3
Expand All @@ -21,8 +22,12 @@ jobs:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm ci --legacy-peer-deps
- name: Install TS at correct version
run: npm i typescript@${{ matrix.typescript }}
- name: Run type check
run: npm run v1-check-types
- name: Run tests
run: npm run test
run: npm run v1-test

check_types:
name: 'Check types'
Expand All @@ -38,12 +43,8 @@ jobs:
node-version: '16'
- name: Install dependencies
run: npm ci --legacy-peer-deps
- name: Build
run: npm run build
- name: Check types
run: npm run check-types
- name: Test types
run: npm run test-types
- name: Check types (v1)
run: npm run v1-check-types

lint:
name: 'ESLint'
Expand All @@ -61,3 +62,20 @@ jobs:
run: npm ci --legacy-peer-deps
- name: Run ESLint
run: npm run lint

# prettier:
# name: 'Prettier'
# runs-on: ubuntu-latest
# steps:
# - name: Checkout latest code
# uses: actions/checkout@v3
# with:
# ref: ${{ github.event.pull_request.head.sha }}
# - name: Set up node
# uses: actions/setup-node@v3
# with:
# node-version: '16'
# - name: Install dependencies
# run: npm ci --legacy-peer-deps
# - name: Run Prettier
# run: npm run prettier
4 changes: 4 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@ module.exports = {
coveragePathIgnorePatterns: ['/__tests__/*'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest'
},
moduleNameMapper: {
'^v1/(.*)$': '<rootDir>/src/v1/$1',
v1: '<rootDir>/src/v1'
}
}