GithubHelp home page GithubHelp logo

commonform / cftemplate Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 2.0 44 KB

write Common Forms with npm and template tags

Home Page: https://www.npmjs.com/packages/cftemplate

License: Apache License 2.0

JavaScript 100.00%

cftemplate's Introduction

Common Form

NPM version

A dummy package for use as an npm peer dependency:

{
  "peerDependencies": {
	"commonform": "1.x"
  }
}

All packages that peer-depend on this package expect as arguments (or return as outputs) form objects that meet the validation criteria of the latest version of commonform-validate with the same peer dependency.

cftemplate's People

Contributors

anseljh avatar kemitchell avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

legalese anseljh

cftemplate's Issues

Crashes with 'invalid data'

After installing fresh from npm and putting together a super simple project:

Ansel@BACCHUS /cygdrive/c/Users/ansel/Code/kr-new-forms
$ cftemplate terms.cftemplate test.json
net.js:617
    throw new TypeError('invalid data');
    ^

TypeError: invalid data
    at Socket.write (net.js:617:11)
    at C:\Users\ansel\AppData\Roaming\npm\node_modules\cftemplate\cftemplate:21:22
    at C:\Users\ansel\AppData\Roaming\npm\node_modules\cftemplate\node_modules\plaintemplate\index.js:29:18
    at handler (C:\Users\ansel\AppData\Roaming\npm\node_modules\cftemplate\node_modules\map-async\index.js:30:36)
    at C:\Users\ansel\AppData\Roaming\npm\node_modules\cftemplate\node_modules\plaintemplate\index.js:29:18
    at handler (C:\Users\ansel\AppData\Roaming\npm\node_modules\cftemplate\node_modules\map-async\index.js:30:36)
    at C:\Users\ansel\AppData\Roaming\npm\node_modules\cftemplate\index.js:124:15
    at done (C:\Users\ansel\AppData\Roaming\npm\node_modules\cftemplate\node_modules\async.util.createtester\index.js:6:21)
    at C:\Users\ansel\AppData\Roaming\npm\node_modules\cftemplate\node_modules\async.util.once\index.js:6:12
    at C:\Users\ansel\AppData\Roaming\npm\node_modules\cftemplate\node_modules\async.eachofseries\index.js:26:28

I can add you to the repo if you want to take a look.

Here's what the tests output, too (npm test). Looks like mostly linebreak garbage from Windows/Cygwin:

Ansel@BACCHUS /cygdrive/c/Users/ansel/Code/cftemplate
$ npm test

> [email protected] test C:\Users\ansel\Code\cftemplate
> tape test.js

TAP version 13
# from-api
ok 1 null
ok 2 should be equal
# if-false
ok 3 null
ok 4 should be equal
# if-null
ok 5 null
ok 6 should be equal
# if-true
ok 7 null
ok 8 should be equal
# require-content-with-children
ok 9 null
not ok 10 should be equal
  ---
    operator: equal
    expected: |-
      'This is a test.\r\n\r\nSome text to start.\r\n\r\n    \\\\\r\n    One child.\r\n    \r\n\r\n    \\\\\r\n    Two children.\r\n    \r\n\r\nMore text.\r\n'
    actual: |-
      'This is a test.\r\n\r\nSome text to start.\n\n    \\\\\n    One child.\n    \n\n    \\\\\n    Two children.\n    \n\nMore text.\r\n'
  ...
# require-markup
ok 11 null
not ok 12 should be equal
  ---
    operator: equal
    expected: |-
      'This is a parent form.\r\n\r\n    \\\\\r\n    This is a child form.\r\n    \r\n'
    actual: |-
      'This is a parent form.\r\n\r\n    \\\\\n    This is a child form.\n    \r\n'
  ...
# require-nested-with-children
ok 13 null
not ok 14 should be equal
  ---
    operator: equal
    expected: |-
      '    \\\\\r\n    This is a test.\r\n\r\n    Some text to start.\r\n\r\n        \\\\\r\n        One child.\r\n    \r\n\r\n        \\\\\r\n        Two children.\r\n    \r\n\r\n    More text.\r\n'
    actual: |-
      '    \\\\\r\n    This is a test.\r\n\r\n    Some text to start.\n\n        \\\\\n        One child.\n    \n\n        \\\\\n        Two children.\n    \n\n    More text.\r\n'
  ...
# require-project
events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: getaddrinfo ENOTFOUND projects.commonform.org projects.commonform.org:443
    at errnoException (dns.js:26:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)
npm ERR! Test failed.  See above for more details.

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.