This repository has been archived by the owner on Mar 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
166 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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 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 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,67 @@ | ||
'use strict' | ||
|
||
const prompt = require('prompt') | ||
const colors = require("colors/safe") | ||
const fs = require('fs') | ||
let manifest_template = require('./manifest_template.json') | ||
|
||
const manifestSchema = { | ||
properties: { | ||
name: { | ||
description: colors.green('Enter your Plugin name'), | ||
message: colors.red('Invalid plugin name'), | ||
required: true | ||
}, | ||
bundle: { | ||
description: colors.green('Enter your Plugin bundle'), | ||
pattern: /^\w{2,}[.][\w-]{1,}[.][\w-]{2,}$/g, | ||
message: colors.red('Invalid bundle. \nPlugin bundle must be reverse domain style, example: "se.infomaker.dashboard-plugin"'), | ||
required: true | ||
} | ||
} | ||
} | ||
|
||
fs.readFile('./manifest.json', (err, data) => { | ||
if (err) { | ||
prompt.stop = () => { | ||
if (prompt.stopped || !prompt.started) { | ||
return | ||
} | ||
|
||
prompt.emit('stop') | ||
prompt.stopped = true | ||
prompt.started = false | ||
prompt.paused = false | ||
|
||
return prompt | ||
} | ||
|
||
console.log(colors.yellow('Dashboard Plugin setup. Follow the setup to create a manifest.json. These values can be changed in the manifest at a later time after the setup.\n')) | ||
|
||
prompt.start() | ||
|
||
prompt.get(manifestSchema, (err, result) => { | ||
console.log('\n') | ||
console.log(`\t ${colors.cyan('Plugin Name: ' + result.name)}`) | ||
console.log(`\t ${colors.cyan('Plugin Bundle: ' + result.bundle)}`) | ||
console.log('\n') | ||
|
||
manifest_template.name = result.name | ||
manifest_template.bundle = result.bundle | ||
|
||
fs.writeFile('./manifest.json', JSON.stringify(manifest_template, null, 4), 'utf8', err => { | ||
if (!err) { | ||
console.log(`\t ${colors.bgWhite(colors.black("-----------------------------------"))}`) | ||
console.log(`\t ${colors.bgWhite(colors.black('🎉 manifest file has been updated 🎉.'))}`) | ||
console.log(`\t ${colors.bgWhite(colors.black("-----------------------------------"))}`) | ||
} else { | ||
console.log('Failed to update manifest.json') | ||
} | ||
}) | ||
|
||
prompt.stop() | ||
}) | ||
} else { | ||
return | ||
} | ||
}) |
This file contains 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 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 |
---|---|---|
|
@@ -202,7 +202,7 @@ [email protected]: | |
version "0.9.0" | ||
resolved "https://registry.yarnpkg.com/async/-/async-0.9.0.tgz#ac3613b1da9bed1b47510bb4651b8931e47146c7" | ||
|
||
async@^0.9.0: | ||
async@^0.9.0, async@~0.9.0: | ||
version "0.9.2" | ||
resolved "https://registry.yarnpkg.com/async/-/async-0.9.2.tgz#aea74d5e61c1f899613bf64bda66d4c78f2fd17d" | ||
|
||
|
@@ -214,6 +214,10 @@ async@~0.2.6: | |
version "0.2.10" | ||
resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1" | ||
|
||
async@~1.0.0: | ||
version "1.0.0" | ||
resolved "https://registry.yarnpkg.com/async/-/async-1.0.0.tgz#f8fc04ca3a13784ade9e1641af98578cfbd647a9" | ||
|
||
asynckit@^0.4.0: | ||
version "0.4.0" | ||
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" | ||
|
@@ -1219,11 +1223,11 @@ colormin@^1.0.5: | |
css-color-names "0.0.4" | ||
has "^1.0.1" | ||
|
||
[email protected]: | ||
[email protected], [email protected]: | ||
version "1.0.3" | ||
resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" | ||
|
||
colors@~1.1.2: | ||
colors@1.1.2, colors@^1.1.2, colors@~1.1.2: | ||
version "1.1.2" | ||
resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" | ||
|
||
|
@@ -1466,6 +1470,10 @@ currently-unhandled@^0.4.1: | |
dependencies: | ||
array-find-index "^1.0.1" | ||
|
||
[email protected]: | ||
version "1.0.3" | ||
resolved "https://registry.yarnpkg.com/cycle/-/cycle-1.0.3.tgz#21e80b2be8580f98b468f379430662b046c34ad2" | ||
|
||
d@^0.1.1, d@~0.1.1: | ||
version "0.1.1" | ||
resolved "https://registry.yarnpkg.com/d/-/d-0.1.1.tgz#da184c535d18d8ee7ba2aa229b914009fae11309" | ||
|
@@ -1496,6 +1504,10 @@ decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: | |
version "1.2.0" | ||
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" | ||
|
||
deep-equal@~0.2.1: | ||
version "0.2.2" | ||
resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-0.2.2.tgz#84b745896f34c684e98f2ce0e42abaf43bba017d" | ||
|
||
deep-extend@~0.4.0: | ||
version "0.4.1" | ||
resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.1.tgz#efe4113d08085f4e6f9687759810f807469e2253" | ||
|
@@ -1930,6 +1942,10 @@ [email protected]: | |
version "1.0.2" | ||
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550" | ||
|
||
[email protected]: | ||
version "0.1.8" | ||
resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" | ||
|
||
fast-levenshtein@~2.0.4: | ||
version "2.0.5" | ||
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.5.tgz#bd33145744519ab1c36c3ee9f31f08e9079b67f2" | ||
|
@@ -2419,6 +2435,10 @@ [email protected]: | |
version "0.0.0" | ||
resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-0.0.0.tgz#b3ffdfe734b2a3d4a9efd58e8654c91fce86eafd" | ||
|
||
[email protected]: | ||
version "0.3.6" | ||
resolved "https://registry.yarnpkg.com/i/-/i-0.3.6.tgz#d96c92732076f072711b6b10fd7d4f65ad8ee23d" | ||
|
||
icss-replace-symbols@^1.0.2: | ||
version "1.0.2" | ||
resolved "https://registry.yarnpkg.com/icss-replace-symbols/-/icss-replace-symbols-1.0.2.tgz#cb0b6054eb3af6edc9ab1d62d01933e2d4c8bfa5" | ||
|
@@ -2725,7 +2745,7 @@ isobject@^2.0.0: | |
dependencies: | ||
isarray "1.0.0" | ||
|
||
isstream@~0.1.2: | ||
isstream@0.1.x, isstream@~0.1.2: | ||
version "0.1.2" | ||
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" | ||
|
||
|
@@ -3183,7 +3203,7 @@ mississippi@~1.2.0: | |
stream-each "^1.1.0" | ||
through2 "^2.0.0" | ||
|
||
[email protected], "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: | ||
[email protected], [email protected], "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: | ||
version "0.5.1" | ||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" | ||
dependencies: | ||
|
@@ -3213,6 +3233,10 @@ natural-compare@^1.4.0: | |
version "1.4.0" | ||
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" | ||
|
||
[email protected]: | ||
version "1.0.1" | ||
resolved "https://registry.yarnpkg.com/ncp/-/ncp-1.0.1.tgz#d15367e5cb87432ba117d2bf80fdf45aecfb4246" | ||
|
||
[email protected]: | ||
version "0.6.1" | ||
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" | ||
|
@@ -3749,6 +3773,14 @@ pkg-dir@^1.0.0: | |
dependencies: | ||
find-up "^1.0.0" | ||
|
||
[email protected]: | ||
version "0.3.1" | ||
resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.3.1.tgz#5b29f6a81f70717142e09e765bbeab97b4f81e21" | ||
|
||
[email protected]: | ||
version "0.4.1" | ||
resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.4.1.tgz#b5418ef0439de5425fc4995042dced14fb2a84ff" | ||
|
||
pluralize@^1.2.1: | ||
version "1.2.1" | ||
resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" | ||
|
@@ -4027,6 +4059,17 @@ progress@^1.1.8: | |
version "1.1.8" | ||
resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" | ||
|
||
[email protected]: | ||
version "1.0.0" | ||
resolved "https://registry.yarnpkg.com/prompt/-/prompt-1.0.0.tgz#8e57123c396ab988897fb327fd3aedc3e735e4fe" | ||
dependencies: | ||
colors "^1.1.2" | ||
pkginfo "0.x.x" | ||
read "1.0.x" | ||
revalidator "0.1.x" | ||
utile "0.3.x" | ||
winston "2.1.x" | ||
|
||
promzard@^0.3.0: | ||
version "0.3.0" | ||
resolved "https://registry.yarnpkg.com/promzard/-/promzard-0.3.0.tgz#26a5d6ee8c7dee4cb12208305acfb93ba382a9ee" | ||
|
@@ -4193,7 +4236,7 @@ read-pkg@^1.0.0, read-pkg@^1.1.0: | |
normalize-package-data "^2.3.2" | ||
path-type "^1.0.0" | ||
|
||
read@1, read@~1.0.1, read@~1.0.7: | ||
read@1, read@1.0.x, read@~1.0.1, read@~1.0.7: | ||
version "1.0.7" | ||
resolved "https://registry.yarnpkg.com/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4" | ||
dependencies: | ||
|
@@ -4487,6 +4530,10 @@ retry@^0.10.0, retry@~0.10.0: | |
version "0.10.1" | ||
resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4" | ||
|
||
[email protected]: | ||
version "0.1.8" | ||
resolved "https://registry.yarnpkg.com/revalidator/-/revalidator-0.1.8.tgz#fece61bfa0c1b52a206bd6b18198184bdd523a3b" | ||
|
||
right-align@^0.1.1: | ||
version "0.1.3" | ||
resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" | ||
|
@@ -4499,6 +4546,12 @@ rimraf@2, rimraf@^2.2.8, rimraf@^2.5.2, rimraf@~2.5.1, rimraf@~2.5.4: | |
dependencies: | ||
glob "^7.0.5" | ||
|
||
[email protected]: | ||
version "2.6.2" | ||
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" | ||
dependencies: | ||
glob "^7.0.5" | ||
|
||
rimraf@~2.2.8: | ||
version "2.2.8" | ||
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.2.8.tgz#e439be2aaee327321952730f99a8929e4fc50582" | ||
|
@@ -4740,6 +4793,10 @@ sshpk@^1.7.0: | |
jsbn "~0.1.0" | ||
tweetnacl "~0.14.0" | ||
|
||
[email protected]: | ||
version "0.0.10" | ||
resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" | ||
|
||
"statuses@>= 1.3.0 < 2", statuses@~1.3.0: | ||
version "1.3.0" | ||
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.0.tgz#8e55758cb20e7682c1f4fce8dcab30bf01d1e07a" | ||
|
@@ -5114,6 +5171,17 @@ [email protected], util@~0.10.3: | |
dependencies: | ||
inherits "2.0.1" | ||
|
||
[email protected]: | ||
version "0.3.0" | ||
resolved "https://registry.yarnpkg.com/utile/-/utile-0.3.0.tgz#1352c340eb820e4d8ddba039a4fbfaa32ed4ef3a" | ||
dependencies: | ||
async "~0.9.0" | ||
deep-equal "~0.2.1" | ||
i "0.3.x" | ||
mkdirp "0.x.x" | ||
ncp "1.0.x" | ||
rimraf "2.x.x" | ||
|
||
[email protected]: | ||
version "1.0.0" | ||
resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.0.tgz#0294fb922bb9375153541c4f7096231f287c8af8" | ||
|
@@ -5247,6 +5315,18 @@ window-size@^0.2.0: | |
version "0.2.0" | ||
resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075" | ||
|
||
[email protected]: | ||
version "2.1.1" | ||
resolved "https://registry.yarnpkg.com/winston/-/winston-2.1.1.tgz#3c9349d196207fd1bdff9d4bc43ef72510e3a12e" | ||
dependencies: | ||
async "~1.0.0" | ||
colors "1.0.x" | ||
cycle "1.0.x" | ||
eyes "0.1.x" | ||
isstream "0.1.x" | ||
pkginfo "0.3.x" | ||
stack-trace "0.0.x" | ||
|
||
[email protected]: | ||
version "0.0.2" | ||
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" | ||
|