Commit b5da1cfb authored by Steve Streza's avatar Steve Streza
Browse files

Fix lerna

parent 869b11a9
Pipeline #700 failed with stage
in 4 minutes and 20 seconds
{
"packages": [
"packages/*"
],
"version": "0.0.0"
"packages": ["packages/*"],
"hoist": false,
"version": "0.0.0"
}
......@@ -2,11 +2,12 @@
"name": "@microjournal/accessor-api",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"main": "lib/index.js",
"paths": {
"@microjournal": ["packages"]
},
"scripts": {
"build": "tsc -p .",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
......@@ -15,5 +16,8 @@
"dependencies": {
"@microjournal/accessor": "1.0.0",
"rxjs": "^6.3.3"
},
"devDependencies": {
"typescript": "^3.2.2"
}
}
......@@ -2,11 +2,12 @@
"name": "@microjournal/accessor-empty",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"main": "lib/index.js",
"paths": {
"@microjournal": ["packages"]
},
"scripts": {
"build": "tsc -p .",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
......@@ -14,6 +15,7 @@
"license": "ISC",
"dependencies": {
"@microjournal/accessor": "1.0.0",
"rxjs": "^6.3.3"
"rxjs": "^6.3.3",
"typescript": "^3.2.2"
}
}
......@@ -2,11 +2,12 @@
"name": "@microjournal/accessor-folder",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"main": "lib/accessor-folder/index.js",
"paths": {
"@microjournal": ["packages"]
},
"scripts": {
"build": "tsc -p .",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
......@@ -22,6 +23,7 @@
},
"devDependencies": {
"@types/bluebird": "^3.5.25",
"@types/mkdirp": "^0.5.2"
"@types/mkdirp": "^0.5.2",
"typescript": "^3.2.2"
}
}
......@@ -3,5 +3,6 @@
"compilerOptions": {
"outDir": "./lib"
},
"include": ["./index.ts"]
"include": ["./index.ts"],
"exclude": ["node_modules"]
}
......@@ -2,11 +2,12 @@
"name": "@microjournal/accessor",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"main": "lib/index.js",
"paths": {
"@microjournal": ["packages"]
},
"scripts": {
"build": "tsc -p .",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
......@@ -14,5 +15,8 @@
"license": "ISC",
"dependencies": {
"rxjs": "^6.3.3"
},
"devDependencies": {
"typescript": "^3.2.2"
}
}
......@@ -2,36 +2,27 @@ import DataStore from "@microjournal/data-store";
import FolderAccessor from "@microjournal/accessor-folder";
import { join as joinPath } from "path"
import { homedir } from "os"
import * as Yargs from 'yargs'
import * as Commander from "commander"
Yargs
.usage("$0 [opts] <command> [args]")
.env("MICROJOURNAL")
.option("path", {
alias: "p",
default: joinPath(homedir(), ".microjournal"),
type: "string",
describe: "The path to the journal (defaults to ~/.microjournal"
})
.command("create <message>", "creates a new journal entry", yargs => yargs
.positional("message", {
alias: "m",
type: "string",
describe: "The message to post"
})
.positional("journal", {
alias: "j",
type: "string",
default: "default",
describe: "The name of the journal (defaults to \"default\")"
})
.demandOption(["message"])
, (argv: { [key: string]: any }) => {
const accessor = new FolderAccessor(argv.path);
const store = new DataStore(accessor);
const createStore = () => {
const path = (Commander.path as string) || joinPath(homedir(), ".microjournal")
const accessor = new FolderAccessor(path);
const store = new DataStore(accessor);
return store
}
Commander
.version("0.0.1")
.option("-p, --path <path>", "The path to the journal (defaults to ~/.microjournal)")
.option("-j, --journal <name>", "The name of the journal (defaults to personal)")
Commander
.command("create <message>")
.description("creates a new journal entry")
.action(message => {
const journal = (Commander.journal as string) || "personal"
const store = createStore();
const message: string = argv.message
const journal: string = argv.journal
if (message && journal) {
store.accessor
.create(journal, {
......@@ -46,12 +37,14 @@ Yargs
process.exit(1)
}
});
}
}
})
.command("journals", "lists journals", yargs => yargs, (argv: { [key: string]: any }) => {
const accessor = new FolderAccessor(argv.path);
const store = new DataStore(accessor);
Commander
.command("journals")
.description("lists journals")
.action(() => {
const store = createStore();
store.accessor.listJournals()
.subscribe({
next: j => {
......@@ -59,6 +52,30 @@ Yargs
}
})
})
Commander
.command("list [journal]")
.description("lists the contents of the journal")
.action(journal => {
const store = createStore()
if (journal) {
store.accessor.list(journal)
.subscribe({
next: entry => {
if (entry.date) {
console.log("" + entry.date.toLocaleDateString() + " " + entry.date.toLocaleTimeString() + ": " + entry.data.message)
}
else {
console.log("" + entry.data.message)
}
}
})
}
})
Commander.parse(process.argv)
/*
.command("list [journal]", "lists the contents of the journal", yargs => yargs
.positional("journal", {
type: "string",
......@@ -116,3 +133,4 @@ Yargs
})
.help()
.argv
*/
\ No newline at end of file
......@@ -2498,8 +2498,7 @@
"commander": {
"version": "2.19.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz",
"integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==",
"dev": true
"integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg=="
},
"component-emitter": {
"version": "1.2.1",
......@@ -7944,6 +7943,12 @@
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=",
"dev": true
},
"typescript": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.2.tgz",
"integrity": "sha512-VCj5UiSyHBjwfYacmDuc/NOk4QQixbE+Wn7MFJuS0nRuPQbof132Pw4u53dm264O8LPc2MVsc7RJNml5szurkg==",
"dev": true
},
"unicode-canonical-property-names-ecmascript": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz",
......
......@@ -2,14 +2,14 @@
"name": "@microjournal/cli",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"main": "lib/index.js",
"paths": {
"@microjournal": [
"packages"
]
},
"scripts": {
"build": "parcel build index.ts",
"build": "tsc -p .",
"mj": "ts-node index.ts",
"test": "echo \"Error: no test specified\" && exit 1"
},
......@@ -19,9 +19,11 @@
"dependencies": {
"@microjournal/accessor-folder": "1.0.0",
"@microjournal/data-store": "1.0.0",
"commander": "^2.19.0",
"yargs": "^12.0.5"
},
"devDependencies": {
"@types/node": "^10.12.18",
"@types/yargs": "^12.0.5",
"babel-core": "^6.26.3",
"babel-plugin-transform-es2015-for-of": "^6.23.0",
......@@ -29,10 +31,11 @@
"babel-preset-es2015": "^6.24.1",
"parcel-bundler": "^1.11.0",
"parcel-plugin-shebang": "^1.2.3",
"ts-node": "^7.0.1"
"ts-node": "^7.0.1",
"typescript": "^3.2.2"
},
"bin": {
"mj": "build/index.js"
"mj": "lib/index.js"
},
"engines": {
"node": "6"
......
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./lib"
"outDir": "./lib",
"types": [
"@types/node"
]
},
"include": ["./index.ts"]
}
{
"name": "@microjournal/data-store",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@microjournal/accessor": {
"version": "1.0.0",
"requires": {
"rxjs": "6.3.3"
},
"dependencies": {
"rxjs": {
"version": "6.3.3",
"bundled": true,
"requires": {
"tslib": "1.9.3"
}
},
"tslib": {
"version": "1.9.3",
"bundled": true
}
}
},
"typescript": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.2.tgz",
"integrity": "sha512-VCj5UiSyHBjwfYacmDuc/NOk4QQixbE+Wn7MFJuS0nRuPQbof132Pw4u53dm264O8LPc2MVsc7RJNml5szurkg==",
"dev": true
}
}
}
......@@ -2,11 +2,14 @@
"name": "@microjournal/data-store",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"main": "lib/index.js",
"paths": {
"@microjournal": ["packages"]
"@microjournal": [
"packages"
]
},
"scripts": {
"build": "tsc -p .",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
......@@ -14,5 +17,8 @@
"license": "ISC",
"dependencies": {
"@microjournal/accessor": "1.0.0"
},
"devDependencies": {
"typescript": "^3.2.2"
}
}
......@@ -2,11 +2,12 @@
"name": "@microjournal/journal",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"main": "lib/index.js",
"paths": {
"@microjournal": ["packages"]
},
"scripts": {
"build": "tsc -p .",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
......@@ -15,5 +16,8 @@
"dependencies": {
"@microjournal/accessor": "1.0.0",
"rxjs": "^6.3.3"
},
"devDependencies": {
"typescript": "^3.2.2"
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment