Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 7864e9e

Browse files
JSprumunozemilio
authored andcommitted
bf-luis-cli plugin initial commit (#336)
1 parent b40236a commit 7864e9e

File tree

13 files changed

+216
-0
lines changed

13 files changed

+216
-0
lines changed

packages/luis/.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
10+
[*.md]
11+
trim_trailing_whitespace = false

packages/luis/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*-debug.log
2+
*-error.log
3+
/.nyc_output
4+
/dist
5+
/lib
6+
/tmp
7+
/yarn.lock
8+
node_modules

packages/luis/README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
@microsoft/bf-luis-cli
2+
======================
3+
4+
5+
6+
[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
7+
[![Version](https://img.shields.io/npm/v/@microsoft/bf-luis-cli.svg)](https://npmjs.org/package/@microsoft/bf-luis-cli)
8+
[![Downloads/week](https://img.shields.io/npm/dw/@microsoft/bf-luis-cli.svg)](https://npmjs.org/package/@microsoft/bf-luis-cli)
9+
[![License](https://img.shields.io/npm/l/@microsoft/bf-luis-cli.svg)](https://github.com/packages/bf-luis-cli/blob/master/package.json)
10+
11+
<!-- toc -->
12+
* [Usage](#usage)
13+
* [Commands](#commands)
14+
<!-- tocstop -->
15+
# Usage
16+
<!-- usage -->
17+
```sh-session
18+
$ npm install -g @microsoft/bf-luis-cli
19+
$ oclif-example COMMAND
20+
running command...
21+
$ oclif-example (-v|--version|version)
22+
@microsoft/bf-luis-cli/0.0.0 win32-x64 node-v10.16.3
23+
$ oclif-example --help [COMMAND]
24+
USAGE
25+
$ oclif-example COMMAND
26+
...
27+
```
28+
<!-- usagestop -->
29+
# Commands
30+
<!-- commands -->
31+
* [`oclif-example hello [FILE]`](#oclif-example-hello-file)
32+
33+
## `oclif-example hello [FILE]`
34+
35+
describe the command here
36+
37+
```
38+
USAGE
39+
$ oclif-example hello [FILE]
40+
41+
OPTIONS
42+
-f, --force
43+
-h, --help show CLI help
44+
-n, --name=name name to print
45+
46+
EXAMPLE
47+
$ oclif-example hello
48+
hello world from ./src/hello.ts!
49+
```
50+
51+
_See code: [src\commands\hello.ts](https://github.com/packages/bf-luis-cli/blob/v0.0.0/src\commands\hello.ts)_
52+
<!-- commandsstop -->

packages/luis/bin/run

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env node
2+
3+
require('@oclif/command').run()
4+
.catch(require('@oclif/errors/handle'))

packages/luis/bin/run.cmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
3+
node "%~dp0\run" %*

packages/luis/package.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"name": "@microsoft/bf-luis-cli",
3+
"version": "0.0.0",
4+
"bugs": "https://github.com/packages/bf-luis-cli/issues",
5+
"dependencies": {
6+
"@oclif/command": "^1.5.19",
7+
"@oclif/config": "^1.13.3",
8+
"azure-cognitiveservices-luis-authoring": "2.1.1",
9+
"ms-rest": "2.5.3",
10+
"tslib": "^1.10.0"
11+
},
12+
"devDependencies": {
13+
"@oclif/dev-cli": "^1.22.2",
14+
"@oclif/plugin-help": "^2.2.1",
15+
"@oclif/test": "^1.2.5",
16+
"@oclif/tslint": "^3.1.1",
17+
"@types/chai": "^4.2.4",
18+
"@types/mocha": "^5.2.7",
19+
"@types/node": "^10.17.4",
20+
"chai": "^4.2.0",
21+
"globby": "^10.0.1",
22+
"mocha": "^5.2.0",
23+
"nyc": "^14.1.1",
24+
"rimraf": "^3.0.0",
25+
"ts-node": "^8.4.1",
26+
"tslint": "^5.20.1",
27+
"typescript": "^3.7.2"
28+
},
29+
"engines": {
30+
"node": ">=8.0.0"
31+
},
32+
"files": [
33+
"/lib",
34+
"/npm-shrinkwrap.json",
35+
"/oclif.manifest.json",
36+
"/yarn.lock"
37+
],
38+
"homepage": "https://github.com/packages/bf-luis-cli",
39+
"keywords": [
40+
"oclif-plugin"
41+
],
42+
"license": "MIT",
43+
"oclif": {
44+
"commands": "./lib/commands",
45+
"bin": "oclif-example",
46+
"devPlugins": [
47+
"@oclif/plugin-help"
48+
]
49+
},
50+
"repository": "packages/bf-luis-cli",
51+
"scripts": {
52+
"postpack": "rimraf oclif.manifest.json",
53+
"posttest": "tslint -p test -t stylish",
54+
"prepack": "rimraf lib && tsc -b && oclif-dev manifest && oclif-dev readme",
55+
"test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
56+
"version": "oclif-dev readme && git add README.md"
57+
}
58+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import {Command, flags} from '@oclif/command'
2+
3+
export default class Hello extends Command {
4+
static description = 'describe the command here'
5+
6+
static examples = [
7+
`$ oclif-example hello
8+
hello world from ./src/hello.ts!
9+
`,
10+
]
11+
12+
static flags = {
13+
help: flags.help({char: 'h'}),
14+
// flag with a value (-n, --name=VALUE)
15+
name: flags.string({char: 'n', description: 'name to print'}),
16+
// flag with no value (-f, --force)
17+
force: flags.boolean({char: 'f'}),
18+
}
19+
20+
static args = [{name: 'file'}]
21+
22+
async run() {
23+
const {args, flags} = this.parse(Hello)
24+
25+
const name = flags.name || 'world'
26+
this.log(`hello ${name} from .\\src\\commands\\hello.ts`)
27+
if (args.file && flags.force) {
28+
this.log(`you input --force and --file: ${args.file}`)
29+
}
30+
}
31+
}

packages/luis/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default {}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import {expect, test} from '@oclif/test'
2+
3+
describe('hello', () => {
4+
test
5+
.stdout()
6+
.command(['hello'])
7+
.it('runs hello', ctx => {
8+
expect(ctx.stdout).to.contain('hello world')
9+
})
10+
11+
test
12+
.stdout()
13+
.command(['hello', '--name', 'jeff'])
14+
.it('runs hello --name jeff', ctx => {
15+
expect(ctx.stdout).to.contain('hello jeff')
16+
})
17+
})

packages/luis/test/mocha.opts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
--require ts-node/register
2+
--watch-extensions ts
3+
--recursive
4+
--reporter spec
5+
--timeout 5000

0 commit comments

Comments
 (0)