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"
},
"scripts": {
"reset": "rimraf lib *.tsbuildinfo",
"build": "tsc -b",
"prepack": "rimraf lib *.tsbuildinfo && tsc -b",
"prepublishOnly": "yarn test",
"test": "jest --config jestconfig.json"
"prepack": "yarn reset && yarn build"
},
"files": [
"lib/**/*",

View File

@@ -24,13 +24,9 @@
"typescript": "^3.7.2"
},
"scripts": {
"reset": "rimraf lib *.tsbuildinfo",
"build": "tsc -b",
"prepare": "yarn run 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",
"prepack": "yarn reset && yarn build",
"run": "yarn run build && node lib/cli.js"
},
"files": [

View File

@@ -4,55 +4,53 @@
Flipper plugins.
<!-- toc -->
* [flipper-pkg](#flipper-pkg)
* [Usage](#usage)
* [Commands](#commands)
<!-- tocstop -->
# Usage
<!-- usage -->
```sh-session
$ npm install -g mycli
$ mycli COMMAND
$ npm install -g flipper-pkg
$ flipper-pkg COMMAND
running command...
$ mycli (-v|--version|version)
mycli/0.0.0 darwin-x64 node-v12.14.0
$ mycli --help [COMMAND]
$ flipper-pkg (-v|--version|version)
flipper-pkg/0.35.0 darwin-x64 node-v12.15.0
$ flipper-pkg --help [COMMAND]
USAGE
$ mycli COMMAND
$ flipper-pkg COMMAND
...
```
<!-- usagestop -->
# Commands
<!-- commands -->
* [`mycli hello [FILE]`](#mycli-hello-file)
* [`mycli help [COMMAND]`](#mycli-help-command)
* [`flipper-pkg bundle DIRECTORY`](#flipper-pkg-bundle-directory)
* [`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
$ mycli hello [FILE]
$ flipper-pkg bundle DIRECTORY
OPTIONS
-f, --force
-h, --help show CLI help
-n, --name=name name to print
-o, --output=output [default: .] Where to output the bundle, file or directory. Defaults to '.'.
EXAMPLE
$ mycli hello
hello world from ./src/hello.ts!
$ flipper-pkg bundle path/to/plugin
```
_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
$ mycli help [COMMAND]
$ flipper-pkg help [COMMAND]
ARGUMENTS
COMMAND command to show help for

View File

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

View File

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