Giter Club home page Giter Club logo

octonom's People

Contributors

andrenarchy avatar greenkeeper[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

octonom's Issues

implement 'reference' type

We still need an elegant way to resolve collections. Directly importing them will lead to cyclic dependencies and this i the road to hell. ;)

An in-range update of mocha is breaking the build 🚨

Version 5.0.1 of mocha was just published.

Branch Build failing 🚨
Dependency mocha
Current Version 5.0.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

mocha is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 15 commits.

  • 09ce746 Release v5.0.1
  • 70027b6 update changelog for v5.0.1 [ci skip]
  • 44aae9f add working wallaby config
  • 412cf27 [Update] license year
  • b7377b3 rename help-wanted to "help wanted" in stale.yml
  • d975a6a fix memory leak when run in v8; closes #3119
  • 3509029 update .gitignore to only ignore root mocha.js [ci skip]
  • b57f623 fix: When using --delay, .only() no longer works. Issue #1838
  • cd74322 Slight copy update on docs for test directory
  • f687d2b update docs for the glob
  • 14fc030 Add all supported wallaby editors
  • 2e7e4c0 rename "common-mistake" label to "faq"
  • bca57f4 clarify docs on html, xunit and 3p reporters; closes #1906
  • 2fe2d01 Revert "fix travis "before script" script"
  • c0ac1b9 fix travis "before script" script

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Proxify nested objects, models, and arrays

Hooks and sanitization are not run on nested objects of a model instance:

class Person extends Model {
  @Property({type: 'object', definition: {foo: {type: string}}})
  public obj: {foo: string};
}
const person = new Person({});
person.obj = {foo: 'bar'}; // OK, triggers hooks
person.obj.foo = 'baz'; // NOT OK, doesn't trigger hooks

Add hooks to Model

A model should have hooks for events like beforeSet, afterSet, beforeSave, afterSave, ...

An in-range update of @types/sinon is breaking the build 🚨

Version 5.0.1 of @types/sinon was just published.

Branch Build failing 🚨
Dependency @types/sinon
Current Version 5.0.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

@types/sinon is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Add support for mixins

Mixins could do the job of defining and updating fields like createdAt or updatedAt. Example:

class PersonBase extends Model<PersonBase> {
  @Model.Property({type: 'string'})
  public name: string;
}

export const Person = Timestamp(PersonBase);

const person = new Person({name: 'Rosa Luxemburg'});

// the following should print the current timestamp
console.log(person.createdAt);
console.log(person.updatedAt);

A mixin of the following form works but the constructor's data argument has a wrong type then:

export type Constructor<T = {}> = new (...args: any[]) => T;
export function Timestamp<TBase extends Constructor>(base: TBase) {
  const newClass = class extends base {
    public createdAt: Date;

    constructor(...args: any[]) {
      super(...args);

      const date = new Date();
      if (!this.createdAt) {
        this.createdAt = date;
      }
    }
  };

  // ideally we'd use the decorator on the property as usual but
  // typescript doesn't like this yet, see
  // https://github.com/Microsoft/TypeScript/issues/7342
  Model.Property({type: 'date'})(newClass.prototype, 'createdAt');

  return newClass;
}

Timestamp: add createdAt+updatedAt schemas

Instead of deriving from Timestamp we could have a CreatedAt and UpdatedAt schemas that can be used like this:

@CreatedAt()
public createdAt: Date;

This allows users to use their own property names which is not possible with the current Timstamp class approach.

An in-range update of @types/mocha is breaking the build 🚨

Version 5.2.1 of @types/mocha was just published.

Branch Build failing 🚨
Dependency @types/mocha
Current Version 5.2.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

@types/mocha is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Add Model inheritance tests

We need tests that verify that 2 derived classes (from a base model class) get separate static properties (schema, hooks).

Make property schemas classes

Instead of using interfaces for schemas we can make Octonom much more extensible by creating a base class SchemaValue or PropertyValue and derive classes like String, Array, Model, ... from it. The class should implement all we need (sanitize, validate). Users can then easily create their own classes.

An in-range update of @types/chai is breaking the build 🚨

Version 4.0.7 of @types/chai was just published.

Branch Build failing 🚨
Dependency @types/chai
Current Version 4.0.6
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

@types/chai is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/mocha is breaking the build 🚨

Version 2.2.48 of @types/mocha was just published.

Branch Build failing 🚨
Dependency @types/mocha
Current Version 2.2.47
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

@types/mocha is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Fix type inference in ArrayCollection and ModelArray

Currently one has to explicitly specify the generic parameter for ArrayCollection and ModelArray (and possibly others), e.g. new ArrayCollection<Person>(Person) instead of new ArrayCollection(Person). Otherwise the type is a generic ArrayCollection<Model>.

An in-range update of sinon is breaking the build 🚨

Version 4.2.3 of sinon was just published.

Branch Build failing 🚨
Dependency sinon
Current Version 4.2.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

sinon is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 7 commits.

  • b5968ab Update docs/changelog.md and set new release id in docs/_config.yml
  • 9cbf3f2 Add release documentation for v4.2.3
  • 45cf330 4.2.3
  • 8f54d73 Update History.md and AUTHORS for new release
  • a401b34 Update package-lock.json
  • a21e4f7 Replace formatio with @sinonjs/formatio
  • f4e44ac Use comments in pull request template to get better descriptions with less template text

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of chai-as-promised is breaking the build 🚨

Version 7.1.0 of chai-as-promised just got published.

Branch Build failing 🚨
Dependency chai-as-promised
Current Version 7.0.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As chai-as-promised is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Release Notes 7.1.0

Fixes Chai's proxy protection for property assertions (when using Chai v4 or higher). (@meeber, #205)

Commits

The new version differs by 2 commits.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Instantiating timestamped class with required ModelSchema property causes stack overflow

Example:

import { Model, Property } from 'octonom';
import { Timestamp } from 'octonom-timestamp';

class Child extends Model {}

class Parent extends Timestamp(Model) {
  @Property.Model({required: true, model: Child})
  public child: Child;
}

const parent = new Parent(); // stack overflow

The conditions in setObject() for resetting values should be checked. Also the default value logic should be checked.

An in-range update of sinon is breaking the build 🚨

Version 4.1.6 of sinon was just published.

Branch Build failing 🚨
Dependency sinon
Current Version 4.1.5
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

sinon is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Commits

The new version differs by 10 commits.

  • 68c37ed Update docs/changelog.md and set new release id in docs/_config.yml
  • cd8ae51 Add release documentation for v4.1.6
  • 29e80be 4.1.6
  • a5c59a5 Update History.md and AUTHORS for new release
  • 0ae60b6 Merge pull request #1653 from mroderick/upgrade-dependencies
  • dcd4191 Upgrade browserify to latest
  • a316f02 Upgrade markdownlint-cli to latest
  • 78ebdb3 Upgrade lint-staged to latest
  • fcf967b Upgrade dependency supports-color
  • 7c3cb4f Enable StaleBot with default configuration (#1649)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

fix package.json issues

  • depending packages should also get the @types of octonom when they run npm install
  • add description
  • add repository
  • use prepare instead of prepublish

An in-range update of sinon is breaking the build 🚨

Version 5.1.0 of sinon was just published.

Branch Build failing 🚨
Dependency sinon
Current Version 5.0.10
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

sinon is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 39 commits.

  • e68ba0d Update docs/changelog.md and set new release id in docs/_config.yml
  • bb0ff41 Add release documentation for v5.1.0
  • 8f867f9 5.1.0
  • 39466a4 Update History.md and AUTHORS for new release
  • 8a4808b finished fixing ie tests
  • 53169e3 Merge pull request #1811 from mhmoudgmal/feature/in-matcher
  • 09f849c Remove notice
  • 01e69a9 cleaning up the fix for #1821
  • fabe894 fixed coveralls integration
  • 5a886bd Fix #1821: fake tests fails on IE 11
  • bed477a Revert PR #1807 to fix #1814
  • 878e2e8 clean up travis config
  • 5e49793 removed node v4; added node v10
  • 81a87d5 Improve tests readability
  • 9d30dcf Merge pull request #1809 from fatso83/esm-module

There are 39 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/sinon is breaking the build 🚨

Version 2.3.7 of @types/sinon was just published.

Branch Build failing 🚨
Dependency @types/sinon
Current Version 2.3.6
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

@types/sinon is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/chai is breaking the build 🚨

Version 4.0.9 of @types/chai was just published.

Branch Build failing 🚨
Dependency @types/chai
Current Version 4.0.8
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

@types/chai is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of sinon is breaking the build 🚨

Version 4.1.3 of sinon was just published.

Branch Build failing 🚨
Dependency sinon
Current Version 4.1.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

sinon is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 12 commits.

  • 39b0849 Update docs/changelog.md and set new release id in docs/_config.yml
  • 6f9af25 4.1.3
  • c6bd1de Update History.md and AUTHORS for new release
  • 911c498 Spy passes through calling with new (#1626)
  • 271d84a Update external_howtos.yml
  • e96ff8c CircleCI Integration (#1479)
  • 88e9132 Upgrade type-detect dependency to 4.0.5
  • 45c4d57 Move yieldsAsync* documentation to the first yieldsAsync*
  • 8c54024 Remove sinon.restore(object|method) from v3.x+ docs
  • 9ae6f73 Remove sinon.log from 2.x+ docs
  • 0111ed0 Update markdownlinter-cli to official v0.4.0
  • 109e7b7 Add markdownlint to dependencies

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Immutability FTW

A subtle issue you can find in most ORMs today is that you mutate model instances as you go and sync them with the remote database from time to time. It seems like an easy and convenient approach, but falls short if a model instance is used concurrently (esp. dangerous in JS with async code everywhere!).

Consider this:

const user = await User.findByName('Karl')
await Promise.all([
  renameUser(user, 'John'),
  changeBirthday(user, '1990-08-01')
])

async function renameUser (user, newName) {
  await something()
  user.name = newName
}

async function changeBirthday (user, birthday) {
  await somethingElse()
  user.birthday = birthday
  console.log(`User ${user.name}'s birthday is the ${birthday}.`)
  // Race Condition! Maybe `user.name` is still 'Karl', maybe it is already 'John'!
}

You can easily spend an hour of debugging to recognize the issue. And fixing it may be even harder.
So I'd like to propose a different approach:

const user = await User.findByName('Karl')
await renameUser(user, 'John')

async function renameUser (user, newName) {
  await something()
  // Returns an updated user instance, the old instance remains untouched
  user = user.setName(newName)
}

The setter methods could probably be easily derived from the field name. You could also track the change operations (setName, setBirthday, ...) since the last database sync and have a change history. Might be nice for debugging and to only update fields in the database that have actually changed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.