@blockforfun/plugin-build
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -1,1 +0,1 @@ | ||
{"version":"0.0.1","commands":{"build":{"id":"build","description":"builds sqlite3 database from a BlockFor.fun git registry.","pluginName":"@blockforfun/plugin-build","pluginType":"core","aliases":[],"flags":{"ref":{"name":"ref","type":"option","char":"r","description":"git ref to read from","default":"refs/heads/master"},"spec":{"name":"spec","type":"option","char":"s","description":"git refspec to fetch","default":"refs/heads/*:refs/heads/*"},"fetch":{"name":"fetch","type":"option","char":"f","description":"git fetch repository URL"}},"args":[{"name":"target","description":"path to target sqlite3 database","required":true},{"name":"source","description":"git source repository URL or path","required":true}]}}} | ||
{"version":"0.0.2","commands":{"build":{"id":"build","description":"builds sqlite3 database from a BlockFor.fun git registry.","pluginName":"@blockforfun/plugin-build","pluginType":"core","aliases":[],"flags":{"ref":{"name":"ref","type":"option","char":"r","description":"git ref to read from","default":"refs/heads/master"},"spec":{"name":"spec","type":"option","char":"s","description":"git refspec to fetch","default":"refs/heads/*:refs/heads/*"},"fetch":{"name":"fetch","type":"option","char":"f","description":"git fetch repository URL"}},"args":[{"name":"target","description":"path to target sqlite3 database","required":true},{"name":"source","description":"git source repository URL or path","required":true}]}}} |
{ | ||
"name": "@blockforfun/plugin-build", | ||
"description": "BlockFor.fun CLI build plugin", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"author": "Mikael Karon <mikael@karon.se>", | ||
"bugs": "https://github.com/blockforfun/cli/issues", | ||
"dependencies": { | ||
"@es-git/core": "^0.9.0", | ||
"@es-git/fetch-mixin": "^0.9.0", | ||
"@es-git/load-as-mixin": "^0.9.0", | ||
"@es-git/memory-repo": "^0.9.0", | ||
"@es-git/mix": "^0.9.0", | ||
"@es-git/node-fs-repo": "^0.9.0", | ||
"@es-git/object-mixin": "^0.9.0", | ||
"@es-git/walkers-mixin": "^0.9.0", | ||
"@es-git/zlib-mixin": "^0.9.0", | ||
"@oclif/command": "^1.5.6", | ||
"@oclif/config": "^1.9.0", | ||
"babel-runtime": "^6.26.0", | ||
"micromatch": "^3.1.10", | ||
"node-fetch": "^2.3.0", | ||
"@blockforfun/plugin-git": "file:../plugin-git", | ||
"sqlite": "^3.0.0" | ||
@@ -23,0 +10,0 @@ }, |
@@ -22,3 +22,3 @@ @blockforfun/plugin-build | ||
$ oclif-example (-v|--version|version) | ||
@blockforfun/plugin-build/0.0.1 win32-x64 node-v10.10.0 | ||
@blockforfun/plugin-build/0.0.2 win32-x64 node-v10.10.0 | ||
$ oclif-example --help [COMMAND] | ||
@@ -52,3 +52,3 @@ USAGE | ||
_See code: [src\commands\build.js](https://github.com/blockforfun/cli/blob/v0.0.1/src\commands\build.js)_ | ||
_See code: [src\commands\build.js](https://github.com/blockforfun/cli/blob/v0.0.2/src\commands\build.js)_ | ||
<!-- commandsstop --> |
const {parse} = require('url') | ||
const sqlite = require('sqlite') | ||
const {Command, flags} = require('@oclif/command') | ||
const {MemRepo, FsRepo} = require('../lib/repo') | ||
const BaseCommand = require('@blockforfun/plugin-git/src/lib/command') | ||
const {MemRepo, FsRepo} = require('@blockforfun/plugin-git/src/lib/repo') | ||
class BuildCommand extends Command { | ||
async fetch(repo, url, options) { | ||
const {spec} = options | ||
this.log(`Fetching ${spec} from ${url}`) | ||
return repo.fetch(url, spec, {progress: p => process.stdout.write(p)}) | ||
} | ||
async tree(repo, url, options) { | ||
const {ref, fetch: _fetch = url.href} = options | ||
if (!url.protocol) { | ||
this.log(`Mounting ${url.href}`) | ||
} | ||
if (url.protocol || options.fetch) { | ||
await this.fetch(repo, _fetch, options) | ||
} | ||
this.log(`Reading from ${ref}...`) | ||
const object = await repo.loadObject(await repo.getRef(ref)) | ||
if (!object) { | ||
throw new Error(`Can't find ${ref}`) | ||
} | ||
return object.body.tree | ||
} | ||
class BuildCommand extends BaseCommand { | ||
async build(repo, url, path, options) { | ||
@@ -75,19 +53,4 @@ this.log(`Opening ${path}...`) | ||
] | ||
BuildCommand.flags = { | ||
ref: flags.string({ | ||
char: 'r', | ||
description: 'git ref to read from', | ||
default: 'refs/heads/master', | ||
}), | ||
spec: flags.string({ | ||
char: 's', | ||
description: 'git refspec to fetch', | ||
default: 'refs/heads/*:refs/heads/*', | ||
}), | ||
fetch: flags.string({ | ||
char: 'f', | ||
description: 'git fetch repository URL', | ||
}), | ||
} | ||
BuildCommand.flags = BaseCommand.flags | ||
module.exports = BuildCommand |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
2
0
5259
4
51
- Removed@es-git/core@^0.9.0
- Removed@es-git/fetch-mixin@^0.9.0
- Removed@es-git/load-as-mixin@^0.9.0
- Removed@es-git/memory-repo@^0.9.0
- Removed@es-git/mix@^0.9.0
- Removed@es-git/node-fs-repo@^0.9.0
- Removed@es-git/object-mixin@^0.9.0
- Removed@es-git/walkers-mixin@^0.9.0
- Removed@es-git/zlib-mixin@^0.9.0
- Removed@oclif/command@^1.5.6
- Removed@oclif/config@^1.9.0
- Removedbabel-runtime@^6.26.0
- Removedmicromatch@^3.1.10
- Removednode-fetch@^2.3.0
- Removed@es-git/core@0.9.0(transitive)
- Removed@es-git/fetch-mixin@0.9.0(transitive)
- Removed@es-git/http-transport@0.9.0(transitive)
- Removed@es-git/load-as-mixin@0.9.0(transitive)
- Removed@es-git/memory-repo@0.9.0(transitive)
- Removed@es-git/mix@0.9.0(transitive)
- Removed@es-git/node-fs-repo@0.9.0(transitive)
- Removed@es-git/object-mixin@0.9.0(transitive)
- Removed@es-git/packfile@0.9.0(transitive)
- Removed@es-git/walkers-mixin@0.9.0(transitive)
- Removed@es-git/zlib-mixin@0.9.0(transitive)
- Removed@nodelib/fs.scandir@2.1.5(transitive)
- Removed@nodelib/fs.stat@2.0.5(transitive)
- Removed@nodelib/fs.walk@1.2.8(transitive)
- Removed@oclif/command@1.8.36(transitive)
- Removed@oclif/config@1.18.161.18.17(transitive)
- Removed@oclif/errors@1.3.6(transitive)
- Removed@oclif/help@1.0.15(transitive)
- Removed@oclif/linewrap@1.0.0(transitive)
- Removed@oclif/parser@3.8.17(transitive)
- Removedansi-regex@5.0.1(transitive)
- Removedansi-styles@4.3.0(transitive)
- Removedarr-diff@4.0.0(transitive)
- Removedarr-flatten@1.1.0(transitive)
- Removedarr-union@3.1.0(transitive)
- Removedarray-union@2.1.0(transitive)
- Removedarray-unique@0.3.2(transitive)
- Removedassign-symbols@1.0.0(transitive)
- Removedatob@2.1.2(transitive)
- Removedbabel-runtime@6.26.0(transitive)
- Removedbase@0.11.2(transitive)
- Removedbraces@2.3.23.0.3(transitive)
- Removedcache-base@1.0.1(transitive)
- Removedchalk@4.1.2(transitive)
- Removedclass-utils@0.3.6(transitive)
- Removedclean-stack@3.0.1(transitive)
- Removedcollection-visit@1.0.0(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedcomponent-emitter@1.3.1(transitive)
- Removedcopy-descriptor@0.1.1(transitive)
- Removedcore-js@2.6.12(transitive)
- Removeddebug@2.6.94.3.7(transitive)
- Removeddecode-uri-component@0.2.2(transitive)
- Removeddefine-property@0.2.51.0.02.0.2(transitive)
- Removeddir-glob@3.0.1(transitive)
- Removedemoji-regex@8.0.0(transitive)
- Removedescape-string-regexp@4.0.0(transitive)
- Removedexpand-brackets@2.1.4(transitive)
- Removedextend-shallow@2.0.13.0.2(transitive)
- Removedextglob@2.0.4(transitive)
- Removedfast-glob@3.3.2(transitive)
- Removedfastq@1.17.1(transitive)
- Removedfill-range@4.0.07.1.1(transitive)
- Removedfor-in@1.0.2(transitive)
- Removedfragment-cache@0.2.1(transitive)
- Removedfs-extra@8.1.0(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-value@2.0.6(transitive)
- Removedglob-parent@5.1.2(transitive)
- Removedglobby@11.1.0(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedhas-value@0.3.11.0.0(transitive)
- Removedhas-values@0.1.41.0.0(transitive)
- Removedhasown@2.0.2(transitive)
- Removedignore@5.3.2(transitive)
- Removedindent-string@4.0.0(transitive)
- Removedis-accessor-descriptor@1.0.1(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedis-data-descriptor@1.0.1(transitive)
- Removedis-descriptor@0.1.71.0.3(transitive)
- Removedis-docker@2.2.1(transitive)
- Removedis-extendable@0.1.11.0.1(transitive)
- Removedis-extglob@2.1.1(transitive)
- Removedis-fullwidth-code-point@3.0.0(transitive)
- Removedis-glob@4.0.3(transitive)
- Removedis-number@3.0.07.0.0(transitive)
- Removedis-plain-object@2.0.4(transitive)
- Removedis-windows@1.0.2(transitive)
- Removedis-wsl@2.2.0(transitive)
- Removedisobject@2.1.03.0.1(transitive)
- Removedjsonfile@4.0.0(transitive)
- Removedkind-of@3.2.24.0.06.0.3(transitive)
- Removedlodash@4.17.21(transitive)
- Removedmap-cache@0.2.2(transitive)
- Removedmap-visit@1.0.0(transitive)
- Removedmerge2@1.4.1(transitive)
- Removedmicromatch@3.1.104.0.8(transitive)
- Removedmixin-deep@1.3.2(transitive)
- Removedms@2.0.0(transitive)
- Removednanomatch@1.2.13(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removedobject-copy@0.1.0(transitive)
- Removedobject-visit@1.0.1(transitive)
- Removedobject.pick@1.3.0(transitive)
- Removedpako@0.2.91.0.11(transitive)
- Removedpascalcase@0.1.1(transitive)
- Removedpath-type@4.0.0(transitive)
- Removedpicomatch@2.3.1(transitive)
- Removedposix-character-classes@0.1.1(transitive)
- Removedqueue-microtask@1.2.3(transitive)
- Removedregenerator-runtime@0.11.1(transitive)
- Removedregex-not@1.0.2(transitive)
- Removedrepeat-element@1.1.4(transitive)
- Removedrepeat-string@1.6.1(transitive)
- Removedresolve-url@0.2.1(transitive)
- Removedret@0.1.15(transitive)
- Removedreusify@1.0.4(transitive)
- Removedrun-parallel@1.2.0(transitive)
- Removedsafe-regex@1.1.0(transitive)
- Removedsemver@7.6.3(transitive)
- Removedset-value@2.0.1(transitive)
- Removedslash@3.0.0(transitive)
- Removedsnapdragon@0.8.2(transitive)
- Removedsnapdragon-node@2.1.1(transitive)
- Removedsnapdragon-util@3.0.1(transitive)
- Removedsource-map@0.5.7(transitive)
- Removedsource-map-resolve@0.5.3(transitive)
- Removedsource-map-url@0.4.1(transitive)
- Removedsplit-string@3.1.0(transitive)
- Removedstatic-extend@0.1.2(transitive)
- Removedstring-width@4.2.3(transitive)
- Removedstrip-ansi@6.0.1(transitive)
- Removedsupports-color@7.2.0(transitive)
- Removedtext-encoding@0.6.4(transitive)
- Removedto-object-path@0.3.0(transitive)
- Removedto-regex@3.0.2(transitive)
- Removedto-regex-range@2.1.15.0.1(transitive)
- Removedtr46@0.0.3(transitive)
- Removedtslib@2.8.0(transitive)
- Removedunion-value@1.0.1(transitive)
- Removeduniversalify@0.1.2(transitive)
- Removedunset-value@1.0.0(transitive)
- Removedurix@0.1.0(transitive)
- Removeduse@3.1.1(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)
- Removedwidest-line@3.1.0(transitive)
- Removedwrap-ansi@6.2.07.0.0(transitive)