-
Notifications
You must be signed in to change notification settings - Fork 110
Updates to latest eslint, mocha and leveldb #188
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fee509d
fix: update to latest eslint
brianleroux 243b425
fix: node18 and higher
brianleroux c2c18ed
chore: updates reqs
brianleroux ee0832f
fix: upgraded to latest Level and Mocha
brianleroux d74f038
chore: make min node version 20
brianleroux 379cbad
3.2.3-RC.0
brianleroux 3ffe10d
fix: remove my editor nonsense
brianleroux File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # Product Overview | ||
brianleroux marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Dynalite is a fast, in-memory implementation of Amazon DynamoDB built on LevelDB. It provides a local DynamoDB-compatible server for development and testing purposes. | ||
|
|
||
| ## Key Features | ||
| - Full DynamoDB API compatibility (matches live instances closely) | ||
| - Fast in-memory or persistent storage via LevelDB | ||
| - Supports both CLI and programmatic usage | ||
| - SSL support with self-signed certificates | ||
| - Configurable table state transition timings | ||
| - Comprehensive validation matching AWS DynamoDB | ||
|
|
||
| ## Use Cases | ||
| - Local development and testing | ||
| - Fast startup alternative to DynamoDB Local (no JVM overhead) | ||
| - CI/CD pipelines requiring DynamoDB functionality | ||
| - Offline development environments | ||
|
|
||
| ## Target Compatibility | ||
| - Matches AWS DynamoDB behavior including limits and error messages | ||
| - Tested against live DynamoDB instances across regions | ||
| - Supports DynamoDB API versions: DynamoDB_20111205, DynamoDB_20120810 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| # Project Structure | ||
|
|
||
| ## Root Files | ||
| - `index.js` - Main server module and HTTP request handler | ||
| - `cli.js` - Command-line interface entry point | ||
| - `package.json` - Project configuration and dependencies | ||
|
|
||
| ## Core Directories | ||
|
|
||
| ### `/actions/` | ||
| Contains implementation modules for each DynamoDB operation: | ||
| - Each file corresponds to a DynamoDB API action (e.g., `listTables.js`, `putItem.js`) | ||
| - Functions accept `(store, data, callback)` parameters | ||
| - Return results via callback with `(err, data)` signature | ||
|
|
||
| ### `/validations/` | ||
| Input validation and type checking for API operations: | ||
| - `index.js` - Core validation framework and utilities | ||
| - Individual validation files match action names (e.g., `listTables.js`) | ||
| - Each exports `types` object defining parameter validation rules | ||
| - May include `custom` validation functions | ||
|
|
||
| ### `/db/` | ||
| Database layer and expression parsing: | ||
| - `index.js` - Core database operations and utilities | ||
| - `*.pegjs` - PEG.js grammar files for DynamoDB expressions | ||
| - `*Parser.js` - Generated parsers (built from .pegjs files) | ||
|
|
||
| ### `/test/` | ||
| Comprehensive test suite: | ||
| - `helpers.js` - Test utilities and shared functions | ||
| - Individual test files match action names | ||
| - Uses Mocha framework with `should` assertions | ||
| - Supports both local and remote DynamoDB testing | ||
|
|
||
| ### `/ssl/` | ||
| SSL certificate files for HTTPS support: | ||
| - Self-signed certificates for development | ||
| - Used when `--ssl` flag is enabled | ||
|
|
||
| ## Architecture Patterns | ||
|
|
||
| ### Action Pattern | ||
| ```javascript | ||
| // actions/operationName.js | ||
| module.exports = function operationName(store, data, cb) { | ||
| // Implementation | ||
| cb(null, result) | ||
| } | ||
| ``` | ||
|
|
||
| ### Validation Pattern | ||
| ```javascript | ||
| // validations/operationName.js | ||
| exports.types = { | ||
| ParameterName: { | ||
| type: 'String', | ||
| required: true, | ||
| // additional constraints | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### Database Operations | ||
| - Use `store.tableDb` for table metadata | ||
| - Use `store.getItemDb(tableName)` for item storage | ||
| - Use `store.getIndexDb()` for secondary indexes | ||
| - All operations are asynchronous with callbacks | ||
|
|
||
| ## Naming Conventions | ||
| - Files use camelCase matching DynamoDB operation names | ||
| - Action functions use camelCase (e.g., `listTables`, `putItem`) | ||
| - Database keys use specific encoding schemes for sorting | ||
| - Test files mirror the structure of implementation files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # Technology Stack | ||
|
|
||
| ## Core Technologies | ||
| - **Runtime**: Node.js (>=16) | ||
| - **Database**: LevelDB via LevelUP with memdown for in-memory storage | ||
| - **HTTP Server**: Node.js built-in http/https modules | ||
| - **Parsing**: PEG.js for expression parsing (condition, projection, update expressions) | ||
| - **Cryptography**: Node.js crypto module for hashing and SSL | ||
| - **Async Control**: async library for flow control | ||
|
|
||
| ## Key Dependencies | ||
| - `levelup` + `leveldown`/`memdown` - Database layer | ||
| - `subleveldown` - Database partitioning | ||
| - `big.js` - Precise decimal arithmetic for DynamoDB numbers | ||
| - `buffer-crc32` - CRC32 checksums for response validation | ||
| - `lazy` - Stream processing utilities | ||
| - `pegjs` - Parser generator for expressions | ||
| - `minimist` - CLI argument parsing | ||
|
|
||
| ## Build System | ||
| - **Build Command**: `npm run build` - Compiles PEG.js grammar files to JavaScript parsers | ||
| - **Test Command**: `npm test` - Runs linting and Mocha test suite | ||
| - **Lint Command**: `npm run lint` - ESLint with @architect/eslint-config | ||
| - **Coverage**: `npm run coverage` - Test coverage via nyc | ||
|
|
||
| ## Development Commands | ||
| ```bash | ||
| # Install dependencies | ||
| npm install | ||
|
|
||
| # Build parsers from grammar files | ||
| npm run build | ||
|
|
||
| # Run tests (includes linting) | ||
| npm test | ||
|
|
||
| # Run with coverage | ||
| npm run coverage | ||
|
|
||
| # Start server programmatically | ||
| node index.js | ||
|
|
||
| # Start CLI server | ||
| node cli.js --port 4567 | ||
| ``` | ||
|
|
||
| ## Parser Generation | ||
| The project uses PEG.js to generate parsers from grammar files in `/db/*.pegjs`: | ||
| - `conditionParser.pegjs` → `conditionParser.js` | ||
| - `projectionParser.pegjs` → `projectionParser.js` | ||
| - `updateParser.pegjs` → `updateParser.js` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.