Giter VIP home page Giter VIP logo

gulp-json-editor's People

Contributors

buuug7 avatar dependabot[bot] avatar greenkeeper[bot] avatar janpaepke avatar meesayen avatar morou avatar rejas avatar superfreeeee avatar thejoezack avatar zbennett10 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gulp-json-editor's Issues

Async function

Is it possible to pass async version of editor function? Somehow like the following (simplified):

gulp.src("./manifest.json")
  .pipe(jeditor(function(json, cb) {
    readFile('somefile', function (content) {
         json.version = content.version;
         cb(json);
    });
  }))
  .pipe(gulp.dest("./dest"));

An in-range update of mocha is breaking the build ๐Ÿšจ

The devDependency mocha was updated from 6.0.2 to 6.1.0.

๐Ÿšจ View failing branch.

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).

Release Notes for v6.1.0

6.1.0 / 2019-04-07

๐Ÿ”’ Security Fixes

  • #3845: Update dependency "js-yaml" to v3.13.0 per npm security advisory (@plroebuck)

๐ŸŽ‰ Enhancements

  • #3766: Make reporter constructor support optional options parameter (@plroebuck)
  • #3760: Add support for config files with .jsonc extension (@sstephant)

๐Ÿ“  Deprecations

These are soft-deprecated, and will emit a warning upon use. Support will be removed in (likely) the next major version of Mocha:

๐Ÿ› Fixes

  • #3829: Use cwd-relative pathname to load config file (@plroebuck)
  • #3745: Fix async calls of this.skip() in "before each" hooks (@juergba)
  • #3669: Enable --allow-uncaught for uncaught exceptions thrown inside hooks (@givanse)

and some regressions:

๐Ÿ“– Documentation

๐Ÿ”ฉ Other

  • #3830: Replace dependency "findup-sync" with "find-up" for faster startup (@cspotcode)
  • #3799: Update devDependencies to fix many npm vulnerabilities (@XhmikosR)
Commits

The new version differs by 28 commits.

  • f4fc95a Release v6.1.0
  • bd29dbd update CHANGELOG for v6.1.0 [ci skip]
  • aaf2b72 Use cwd-relative pathname to load config file (#3829)
  • b079d24 upgrade deps as per npm audit fix; closes #3854
  • e87c689 Deprecate this.skip() for "after all" hooks (#3719)
  • 81cfa90 Copy Suite property "root" when cloning; closes #3847 (#3848)
  • 8aa2fc4 Fix issue 3714, hide pound icon showing on hover header on docs page (#3850)
  • 586bf78 Update JS-YAML to address security issue (#3845)
  • d1024a3 Update doc examples "tests.html" (#3811)
  • 1d570e0 Delete "/docs/example/chai.js"
  • ade8b90 runner.js: "self.test" undefined in Browser (#3835)
  • 0098147 Replace findup-sync with find-up for faster startup (#3830)
  • d5ba121 Remove "package" flag from sample config file because it can only be passes as CLI arg (#3793)
  • a3089ad update package-lock
  • 75430ec Upgrade yargs-parser dependency to avoid loading 2 copies of yargs

There are 28 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 ๐ŸŒด

Out of date js-beautify

The js-beautify is out of date and prevents me from using the 'brace-style': 'collapse-preserve-inline' option, which was fixed for Node in 1.6.2.

Right now I'm trying to use npm shrinkwrap to work around this, which is a pain. Would be great just to see it updated. ๐Ÿ˜„

"Buffer.from(json)" happens crash

image
Uploading WX20180706-112514@2x.pngโ€ฆ

on node version 10.4.1 and 6.0.0 , both of them occur exception. Is it a bug?

TypeError: this is not a typed array. at Function.from (native) at DestroyableTransform._transform (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@gulp-json-editor/index.js:71:30) at DestroyableTransform.Transform._read (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_transform.js:184:10) at DestroyableTransform.Transform._write (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_transform.js:172:83) at doWrite (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_writable.js:428:64) at writeOrBuffer (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_writable.js:417:5) at DestroyableTransform.Writable.write (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_writable.js:334:11) at write (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_readable.js:623:24) at flow (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_readable.js:632:7) at DestroyableTransform.pipeOnReadable (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_readable.js:664:5) at emitNone (events.js:67:13) at DestroyableTransform.emit (events.js:166:7) at emitReadable_ (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_readable.js:448:10) at emitReadable (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_readable.js:444:5) at readableAddChunk (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_readable.js:187:9) at DestroyableTransform.Readable.push (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_readable.js:149:10) at DestroyableTransform.Transform.push (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_transform.js:145:32) at afterTransform (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_transform.js:101:12) at TransformState.afterTransform (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_transform.js:79:12) at DestroyableTransform.noop [as _transform] (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@through2/through2.js:26:3) at DestroyableTransform.Transform._read (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_transform.js:184:10) at DestroyableTransform.Transform._write (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_transform.js:172:12)

Fails piping after gulp-run

gulp.task('testing', function() {
    // return gulp.src('./testing.json')
    return run('./testing-generate').exec()
        .pipe(plumber())
        .pipe(rename("testing-result.json"))
        .pipe(jsonlint())
        .pipe(jsonedit(function(json) {
            return json;
        }))
        .pipe(gulp.dest('./'))
    ;
});
[06:04:34] Starting 'testing'...
[06:04:34] Plumber found unhandled error:
 Error in plugin 'gulp-json-editor'
Message:
    Streaming is not supported
[06:04:34] Finished 'testing' after 61 ms
$ ./testing-generate
{ "bar": true }

NPM ownership

Hi @morou
could you also transfer the ownership of this library in the npm registry to me? Otherwise I cannot release a new version :-(
Cheers and Thanks for all your work

Replace deprecated dependency gulp-util

gulp-util has been deprecated recently. Continuing to use this dependency may prevent the use of your library with the latest release of Gulp 4 so it is important to replace gulp-util.

The README.md lists alternatives for all the components so a simple replacement should be enough.

Your package is one of the most popular packages still relying on gulp-util, it would be good to publish a fixed version to npm as soon as possible.

See:

2.6.0 broke compatibility with npm 6

In my project the version 2.6.0 broke compatibility so I needed to reset to older versions, because of this error:
Invalid dependency type requested: alias

in these sub dependencies
4461 silly fetchPackageMetaData error for string-width-cjs@npm:string-width@^4.2.0 Invalid dependency type requested: alias
4462 silly fetchPackageMetaData error for strip-ansi-cjs@npm:strip-ansi@^6.0.1 Invalid dependency type requested: alias
4463 silly fetchPackageMetaData error for wrap-ansi-cjs@npm:wrap-ansi@^7.0.0 Invalid dependency type requested: alias

Expose option to skip beautification

I would like to be able to bypass the beautification process. I can see there's an existing variable that can be used, but it's hard-coded.

I would like this exposed as one of the beautification options.

I'll go ahead and submit a PR, unless I'm missing something.

Unexpected end of input?

events.js:141
      throw er; // Unhandled 'error' event
      ^
SyntaxError: Unexpected end of input
    at Object.parse (native)
    at Transform._transform (/Users/00831103/Workspace/project-2/node_modules/gulp-json-editor/index.js:65:45)
    at Transform._read (/Users/00831103/Workspace/project-2/node_modules/gulp-json-editor/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at Transform._write (/Users/00831103/Workspace/project-2/node_modules/gulp-json-editor/node_modules/readable-stream/lib/_stream_transform.js:172:12)
    at doWrite (/Users/00831103/Workspace/project-2/node_modules/gulp-json-editor/node_modules/readable-stream/lib/_stream_writable.js:237:10)
    at writeOrBuffer (/Users/00831103/Workspace/project-2/node_modules/gulp-json-editor/node_modules/readable-stream/lib/_stream_writable.js:227:5)
    at Transform.Writable.write (/Users/00831103/Workspace/project-2/node_modules/gulp-json-editor/node_modules/readable-stream/lib/_stream_writable.js:194:11)
    at write (/Users/00831103/Workspace/project-2/node_modules/gulp/node_modules/readable-stream/lib/_stream_readable.js:623:24)
    at flow (/Users/00831103/Workspace/project-2/node_modules/gulp/node_modules/readable-stream/lib/_stream_readable.js:632:7)
    at DestroyableTransform.pipeOnReadable (/Users/00831103/Workspace/project-2/node_modules/gulp/node_modules/readable-stream/lib/_stream_readable.js:664:5)

code is

var gulp = require('gulp');
var jeditor   = require('gulp-json-editor');
gulp.task('addjson','adds basic placeholder json',function(){
  return gulp.src('./aggregate.json')
  .pipe(jeditor(function(json) {
    json = "1.2.3";
    return json; // must return JSON object.
  }))
  .pipe(gulp.dest('.'));
});

Add option to insert empty object

Hey,

I might be stupid here, but is it not possible to delete the contents of an object, ie. I am trying to delete all dependencies and devDependencies from a package.json file, like this:

return gulp
    .src('package.json')
    .pipe(jsonEditor({
      'dependencies': {},
      'devDependencies': {}
    }))
    .pipe(gulp.dest(destination))

However, that doesn't seem to work. Any other way of emptying those objects using this gulp package?

Thanx in advance!

Merging JSON docs?

Would it be possible to take 2 or 3 JSON objects and merge them into one without duplicates?

I have 3 apps that each have their own menu configured in JSON. They each have menu items inside the same categories so each JSON will have Category1 and so on. I'd like to merge these JSON files together at build time so that at run time the menu doesn't care where the JSON comes from. It just builds the menu.

Is this kind of thing possible with gulp-json-editor?

Thanks,
Bob

An in-range update of eslint is breaking the build ๐Ÿšจ

The devDependency eslint was updated from 5.15.3 to 5.16.0.

๐Ÿšจ View failing branch.

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

eslint 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).

Release Notes for v5.16.0
  • dfef227 Build: gensite passes rulesMeta to formatter rendering (#11567) (Kevin Partington)
  • c06d38c Fix: Allow HTML formatter to handle no meta data (#11566) (Ilya Volodin)
  • 87a5c03 Docs: func-style: clarify when allowArrowFunctions is used (#11548) (Oliver Joseph Ash)
  • bc3e427 Update: pass rule meta to formatters RFC 10 (#11551) (Chris Meyer)
  • b452f27 Chore: Update README to pull in reviewer data (#11506) (Nicholas C. Zakas)
  • afe3d25 Upgrade: Bump js-yaml dependency to fix Denial of Service vulnerability (#11550) (Vernon de Goede)
  • 4fe7eb7 Chore: use nyc instead of istanbul (#11532) (Toru Nagashima)
  • f16af43 Chore: fix formatters/table test (#11534) (Toru Nagashima)
  • 78358a8 Docs: fix duplicate punctuation in CLI docs (#11528) (Teddy Katz)
Commits

The new version differs by 11 commits.

  • ded2f94 5.16.0
  • ea36e13 Build: changelog update for 5.16.0
  • dfef227 Build: gensite passes rulesMeta to formatter rendering (#11567)
  • c06d38c Fix: Allow HTML formatter to handle no meta data (#11566)
  • 87a5c03 Docs: func-style: clarify when allowArrowFunctions is used (#11548)
  • bc3e427 Update: pass rule meta to formatters RFC 10 (#11551)
  • b452f27 Chore: Update README to pull in reviewer data (#11506)
  • afe3d25 Upgrade: Bump js-yaml dependency to fix Denial of Service vulnerability (#11550)
  • 4fe7eb7 Chore: use nyc instead of istanbul (#11532)
  • f16af43 Chore: fix formatters/table test (#11534)
  • 78358a8 Docs: fix duplicate punctuation in CLI docs (#11528)

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 ๐ŸŒด

Expose beautify options

I'd like to set wrap_line_length = 80 in js-beautify so I can easily read the contents of long arrays. Would you consider exposing the beautify options as an options parameter to json-editor?

Boolean values

It's currently not possible to write boolean values into a JSON file. What happens when I try to overwrite an existing key a with boolean value, the entire key will be removed. A workaround is putting booleans in quotes, but thatโ€”of courseโ€”will only work as long as you don't have to differentiate between true and "true".

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.