Fix npm publishing

Summary:
Fixed npm packaging/publishing scripts for "flipper-doctor", "flipper-pkg" and "flipper-babel-transformer".

Also removed scripts for testing and linting, because these packages are tested and linted by root level package.json.

Reviewed By: jknoxville

Differential Revision: D20839959

fbshipit-source-id: 4d9d037d4921fc97356c849054c389dfece05652
This commit is contained in:
Anton Nikolaev
2020-04-06 02:32:47 -07:00
committed by Facebook GitHub Bot
parent f1e8297800
commit 2690894ad0
5 changed files with 29 additions and 37 deletions

View File

@@ -39,10 +39,9 @@
"typescript": "^3.7.2" "typescript": "^3.7.2"
}, },
"scripts": { "scripts": {
"reset": "rimraf lib *.tsbuildinfo",
"build": "tsc -b", "build": "tsc -b",
"prepack": "rimraf lib *.tsbuildinfo && tsc -b", "prepack": "yarn reset && yarn build"
"prepublishOnly": "yarn test",
"test": "jest --config jestconfig.json"
}, },
"files": [ "files": [
"lib/**/*", "lib/**/*",

View File

@@ -24,13 +24,9 @@
"typescript": "^3.7.2" "typescript": "^3.7.2"
}, },
"scripts": { "scripts": {
"reset": "rimraf lib *.tsbuildinfo",
"build": "tsc -b", "build": "tsc -b",
"prepare": "yarn run build", "prepack": "yarn reset && yarn build",
"prepublishOnly": "yarn test && yarn run lint",
"preversion": "yarn run lint",
"test": "jest --config jestconfig.json --passWithNoTests",
"lint": "eslint -c ../.eslintrc.js src/**/* --ext .js,.ts && tsc --noemit",
"fix": "eslint -c ../.eslintrc.js src/**/* --fix --ext .js,.ts",
"run": "yarn run build && node lib/cli.js" "run": "yarn run build && node lib/cli.js"
}, },
"files": [ "files": [

View File

@@ -4,55 +4,53 @@
Flipper plugins. Flipper plugins.
<!-- toc --> <!-- toc -->
* [flipper-pkg](#flipper-pkg)
* [Usage](#usage) * [Usage](#usage)
* [Commands](#commands) * [Commands](#commands)
<!-- tocstop --> <!-- tocstop -->
# Usage # Usage
<!-- usage --> <!-- usage -->
```sh-session ```sh-session
$ npm install -g mycli $ npm install -g flipper-pkg
$ mycli COMMAND $ flipper-pkg COMMAND
running command... running command...
$ mycli (-v|--version|version) $ flipper-pkg (-v|--version|version)
mycli/0.0.0 darwin-x64 node-v12.14.0 flipper-pkg/0.35.0 darwin-x64 node-v12.15.0
$ mycli --help [COMMAND] $ flipper-pkg --help [COMMAND]
USAGE USAGE
$ mycli COMMAND $ flipper-pkg COMMAND
... ...
``` ```
<!-- usagestop --> <!-- usagestop -->
# Commands # Commands
<!-- commands --> <!-- commands -->
* [`mycli hello [FILE]`](#mycli-hello-file) * [`flipper-pkg bundle DIRECTORY`](#flipper-pkg-bundle-directory)
* [`mycli help [COMMAND]`](#mycli-help-command) * [`flipper-pkg help [COMMAND]`](#flipper-pkg-help-command)
## `mycli hello [FILE]` ## `flipper-pkg bundle DIRECTORY`
describe the command here bundle a plugin folder into a distributable archive
``` ```
USAGE USAGE
$ mycli hello [FILE] $ flipper-pkg bundle DIRECTORY
OPTIONS OPTIONS
-f, --force -o, --output=output [default: .] Where to output the bundle, file or directory. Defaults to '.'.
-h, --help show CLI help
-n, --name=name name to print
EXAMPLE EXAMPLE
$ mycli hello $ flipper-pkg bundle path/to/plugin
hello world from ./src/hello.ts!
``` ```
_See code: [src/commands/hello.ts](https://github.com/passy/mycli/blob/v0.0.0/src/commands/hello.ts)_ _See code: [src/commands/bundle.ts](https://github.com/facebook/flipper/blob/v0.35.0/src/commands/bundle.ts)_
## `mycli help [COMMAND]` ## `flipper-pkg help [COMMAND]`
display help for mycli display help for flipper-pkg
``` ```
USAGE USAGE
$ mycli help [COMMAND] $ flipper-pkg help [COMMAND]
ARGUMENTS ARGUMENTS
COMMAND command to show help for COMMAND command to show help for

View File

@@ -31,21 +31,19 @@
"globby": "^10", "globby": "^10",
"jest": "^25.1.0", "jest": "^25.1.0",
"prettier": "^2.0.0", "prettier": "^2.0.0",
"rimraf": "^3.0.2",
"ts-jest": "^25.2.1", "ts-jest": "^25.2.1",
"ts-node": "^8", "ts-node": "^8",
"typescript": "^3.7.2" "typescript": "^3.7.2"
}, },
"scripts": { "scripts": {
"reset": "rimraf lib *.tsbuildinfo",
"prebuild": "cd ../babel-transformer && yarn build", "prebuild": "cd ../babel-transformer && yarn build",
"build": "tsc -b", "build": "tsc -b",
"postpack": "rm -f oclif.manifest.json", "postpack": "rimraf oclif.manifest.json",
"prepack": "rm -rf lib && yarn build && oclif-dev manifest && oclif-dev readme", "prepack": "yarn reset && yarn build && oclif-dev manifest && oclif-dev readme",
"prepare": "yarn run build", "run": "yarn build && bin/run",
"prepublishOnly": "yarn test && yarn run lint", "version": "oclif-dev readme && hg add README.md"
"preversion": "yarn run lint",
"test": "jest --config jestconfig.json",
"run": "bin/run",
"version": "oclif-dev readme && git add README.md"
}, },
"engines": { "engines": {
"node": ">=8.0.0" "node": ">=8.0.0"

View File

@@ -118,6 +118,7 @@ export async function publishPackages({
} }
const publicPackages = workspaces.packages.filter((pkg) => !pkg.json.private); const publicPackages = workspaces.packages.filter((pkg) => !pkg.json.private);
for (const pkg of publicPackages) { for (const pkg of publicPackages) {
console.log(`Publishing ${pkg.json.name}...`);
execSync(cmd, {cwd: pkg.dir, stdio: 'inherit'}); execSync(cmd, {cwd: pkg.dir, stdio: 'inherit'});
} }
} }