From 05a1c70bc7ce09a0acc392cec4a1c2250b98495e Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Fri, 21 Feb 2020 03:40:16 -0800 Subject: [PATCH] Set up separate cli tool Summary: Discussed that we want this to be both a library and a CLI tool. Also added a README stub. Reviewed By: nikoant Differential Revision: D19969788 fbshipit-source-id: 2c54935ce5953d2053c7bdf601debe0e5e911647 --- pkg/LICENSE | 21 +++++++++++++++++++++ pkg/README.md | 8 ++++++++ pkg/package.json | 4 ++-- pkg/src/cli.ts | 14 ++++++++++++++ pkg/src/index.ts | 4 +--- 5 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 pkg/LICENSE create mode 100644 pkg/README.md create mode 100644 pkg/src/cli.ts diff --git a/pkg/LICENSE b/pkg/LICENSE new file mode 100644 index 000000000..b96dcb048 --- /dev/null +++ b/pkg/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Facebook, Inc. and its affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/pkg/README.md b/pkg/README.md new file mode 100644 index 000000000..4079d7d6d --- /dev/null +++ b/pkg/README.md @@ -0,0 +1,8 @@ +# flipper-pkg + +`flipper-pkg` is a **work-in-progress** tool for bundling and publishing +Flipper plugins. + +## License + +[MIT](LICENSE) \ No newline at end of file diff --git a/pkg/package.json b/pkg/package.json index fa568754f..cb7fe3982 100644 --- a/pkg/package.json +++ b/pkg/package.json @@ -29,7 +29,7 @@ "test": "jest --config jestconfig.json --passWithNoTests", "lint": "eslint -c ../../sonar/.eslintrc.js src/**/* --ext .js,.ts && tsc --noemit", "fix": "eslint -c ../../sonar/.eslintrc.js src/**/* --fix --ext .js,.ts", - "run": "yarn run build && node lib/index.js" + "run": "yarn run build && node lib/cli.js" }, "files": [ "lib/**/*" @@ -41,4 +41,4 @@ "dependencies": { "@types/node": "^12.12.12" } -} +} \ No newline at end of file diff --git a/pkg/src/cli.ts b/pkg/src/cli.ts new file mode 100644 index 000000000..33fc590c5 --- /dev/null +++ b/pkg/src/cli.ts @@ -0,0 +1,14 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +import {PKG} from '.'; + +(async () => { + console.log(`Hello, ${PKG}.`); +})(); diff --git a/pkg/src/index.ts b/pkg/src/index.ts index 93038d0e0..bf5765e4a 100644 --- a/pkg/src/index.ts +++ b/pkg/src/index.ts @@ -7,6 +7,4 @@ * @format */ -(async () => { - console.log('Hello, flipper-pkg.'); -})(); +export const PKG = 'flipper-pkg';