Skip to content

Commit

Permalink
initial pbj lib for es6 (#2)
Browse files Browse the repository at this point in the history
* Properly handle tag presence in MessageRef::fromString and add resolveQName to MessageResolver

Plus some unit tests

* Added support for dynamodb item

* Fixed test unit and related broken items

* Fixed unmarshal test unit

* Auto registers the schema with the MessageResolver for unit testing

* Added dynamodb integration test

* Added elastica document marshaler

* Fixed dynamodb integration test unit - ignore exceptions

* Implemented elastica mapping factory

* Cleanup integration/dynamo-db.test.js

* Added elastica integration unit test

* Removed extra space

* refactor - phase 1 - skeleton

* type system - booleanType skeleton

* stub tests for type guards (wip)

* rollup testing

* babel with es6 imports (wip)

* build testing (wip)

* build testing (wip)

* build testing (wip)

* build testing (wip)

* finish tests on booleanType

* adding tinyIntType and unit tests for that type

+ added AssertionFailed exception
+ added AbstractIntType which will be used for the other int types

* start on other int types (wip)

* adding smallIntType and unit tests for that type

+ moved type sampling to the test itself, it's simpler
+ added test helper for types (testing guards, encode and decode with samples)

* adding smallIntType and unit tests for that type

+ moved type sampling to the test itself, it's simpler
+ added test helper for types (testing guards, encode and decode with samples)

* finished the scalar int types and unit tests

* finished the numeric types except BigInt, IntEnum which are not scalar

* add trinaryType and unit tests

* add timestampType and unit tests

* starting string types

+ added AbstractStringType with basic guards and encode/decode
+ added remaining enums for DynamicFieldKind, FieldRule, Format
+ stubbed some more of the Field object
+ stubbed Message object
+ implemented TextType and created tests for it

* finished text and medium text

+ use Buffer.from(...).bytesLength to get byte size (for guard)
+ add text with emojis to guard tests

* stub stringType (wip)

* fix custom string pattern validation in stringType

+ only create the regex one time (in the field)
+ when creating a RegExp instance, don't include leading/trailing "/"

* fix custom string pattern validation in stringType

+ only create the regex one time (in the field)
+ when creating a RegExp instance, don't include leading/trailing "/"

* finish SchemaVersion and start SchemaQName

+ added unit tests SchemaQName and SchemaVersion
+ stubbed SchemaId and SchemaCurie
+ stubbed failing tests for "fromId" and "fromCurie" to SchemaQName
+ using flyweight for SchemaQName

* match up to php lib closer for sake of simplicity

+ export Type classes.
+ use "create" factory function in Type(s) to create instance
+ add unit tests to assert "create" factory on type always returns same instance

* match up to php lib closer for sake of simplicity2

+ export Type classes.
+ use "create" factory function in Type(s) to create instance
+ add unit tests to assert "create" factory on type always returns same instance

* match up to php lib closer for sake of simplicity3

+ export Type classes.
+ use "create" factory function in Type(s) to create instance
+ add unit tests to assert "create" factory on type always returns same instance

* use @gdbots/common v0.1.0

+ string type format validators (wip)
+ rename assert in tests to just "t".  less "t"yping

* finish StringType format rules with unit tests

* starting binary type (wip)

* finish binary types and IntEnum type

+ Binary, Blob and Medium Blob use utf8 and base-64 libs
+ Added unit tests for binary and int enum types
+ Created fixtures for IntEnum and StringEnum
+ Stubbed more methods to Field object for classProto and curies
+ Added more assertions to type testing (min, max and max bytes)

* finished IntEnumType and StringEnumType with tests

* finished BigIntType and SignedBigIntType with unit tests

* finished WellKnown/UuidIdentifier and UuidType with unit tests

* added WellKnown/TimeUuidIdentifier with unit tests

* added TimeUuidType with unit tests

* added WellKnown/Microtime with unit tests

* added MicrotimeType with unit tests

* added WellKnown GeoPoint with unit tests

* added GeoPointType with unit tests

* added IdentifierType with unit tests

* added DatedSlugIdentifier, SlugIdentifier with unit tests

* added DateType with unit tests

* added DateTimeType with unit tests

* added WellKnown/DynamicField and Type/DynamicFieldType with unit tests

* added SchemaCurie with unit tests

* some linter cleanup

* added SchemaCurie, MessageRef and MessageRefType with unit tests

* added SchemaId with unit tests

+ created InvalidArgumentException to remove some code duplication
+ added more tests for SchemaCurie
+ exporting all WellKnown from main index now

* remove old src/old tests that have been refactored

* added FieldBuilder with unit tests

* added FieldBuilder to main module exports

* remove eslint disable from MessageRef tests

* use just "anyOfCuries" as js lib won't be using the same style
of assertion that php does

* progress on Field object, guarding default and value (wip)

* completed Field object with unit tests

* completed Mixin with unit tests

* Schema with unit tests

+ createMessage method still incomplete, waiting for Message

* Schema with unit tests (wip)

+ add schema and mixin to index exports
+ remove old src and tests that have been refactored

* starting Message class (wip)

* Message class (wip)

* Message class (wip)

* get rid of all wildcard imports

* jsdoc fix

* Message class - list field operations complete with unit tests (wip)

* Message class - map field operations with unit tests (wip)

* Message class - map field operations with unit tests2 (wip)

* adding traits (wip)

* mixin wip

* starting serializers (wip)

* message type and object serializer mostly done (wip)

* message resolver (wip)

* add more tests for object serializer

* remove old source and tests

* refactoring directory names to match js community conventions

* finish MessageResolver with unit tests

* prepare for npm publish
  • Loading branch information
gdbrown authored Jul 1, 2017
1 parent a56a7b9 commit e63f514
Show file tree
Hide file tree
Showing 287 changed files with 16,582 additions and 8,990 deletions.
38 changes: 37 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
{
"presets": ["es2015"]
"env": {
"cjs": {
"presets": [
[
"env",
{
"targets": {
"node": "current"
},
"modules": "commonjs",
"useBuiltIns": true
}
]
],
"plugins": [
"transform-es2015-modules-commonjs"
]
},
"es6": {
"presets": [
[
"env",
{
"targets": {
"node": "current"
},
"modules": false,
"useBuiltIns": true
}
]
],
"plugins": [
"lodash",
"./build/use-lodash-es"
]
}
}
}
10 changes: 10 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
engines:
eslint:
enabled: true

ratings:
paths:
- '**.js'

exclude_paths:
- '/node_modules/*'
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/dist/
/*.js
21 changes: 21 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": "airbnb",
"globals": {
"document": true,
"window": true
},
"env": {
"browser": true
},
"parserOptions": {
"ecmaVersion": 8,
"sourceType": "module",
"ecmaFeatures": {
"impliedStrict": true
}
},
"rules": {
"jsx-a11y/img-has-alt": "off",
"react/jsx-space-before-closing": "off"
}
}
59 changes: 57 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,57 @@
dist/es6/
node_modules/
# Node App Files #
############
/node_modules/
/dist/
/*.js
/enums
/exceptions
/serializers
/types
/well-known

# Deployment/IDE Tools #
############
.buildpath
*.iml
.idea/
.project
.settings

# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so

# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip

# Logs and databases #
######################
*.log
*.sql
*.sqlite

# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db
11 changes: 11 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/.idea/
/build/
/dist/
/src/
/tests/
.babelrc
.codeclimate.yml
.editorconfig
.eslint*
.nvmrc
.travis.yml
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v8
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
language: node_js
node_js:
- 8
78 changes: 0 additions & 78 deletions Gruntfile.js

This file was deleted.

Loading

0 comments on commit e63f514

Please sign in to comment.