Skip to content

Commit

Permalink
feat: remove flow #70
Browse files Browse the repository at this point in the history
BREAKING CHANGE: remove flow definitions
  • Loading branch information
@jotadeveloper authored and sergiohgz committed Jul 25, 2019
1 parent 5f61009 commit 2218b74
Show file tree
Hide file tree
Showing 15 changed files with 630 additions and 2,777 deletions.
2 changes: 1 addition & 1 deletion core/types/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
lib/
.idea/
**/node_modules/**
**/__*-fixtures__/**
/**/*.d.ts
13 changes: 0 additions & 13 deletions core/types/.eslintrc

This file was deleted.

26 changes: 0 additions & 26 deletions core/types/.flowconfig

This file was deleted.

4 changes: 0 additions & 4 deletions core/types/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ npm-debug.log
lib/
node_modules/

# Istanbul
.nyc*
tests-report

# IDE
.vscode/*
.idea/
Expand Down
3 changes: 3 additions & 0 deletions core/types/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ test/
.travis.yml
src/
.idea/
.github/
scripts/
.DS_Store
12 changes: 0 additions & 12 deletions core/types/.prettierrc

This file was deleted.

20 changes: 3 additions & 17 deletions core/types/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Flow/Typescript types for Verdaccio
# Typescript types for Verdaccio

Typescript / Flow definitions for verdaccio plugins and internal code
Typescript definitions for verdaccio plugins and internal code

# Typescript
For usage with the library, the `tsconfig.json` should looks like this. Typescript is only available since `"@verdaccio/types": "5.0.0-beta.2"`.
Expand Down Expand Up @@ -29,20 +29,6 @@ For usage with the library, the `tsconfig.json` should looks like this. Typescri
}
```

# Flow

## Usage

To set up the types we need to add them to the `.flowconfig` flow configuration file.

```
[libs]
node_modules/@verdaccio/types/lib/
[options]
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
```

### Imports

```
Expand All @@ -55,7 +41,7 @@ import type {ILocalData, LocalStorage, Logger, Config} from '@verdaccio/types';
data: LocalStorage;
config: Config;
locked: boolean;
...
...
}
```

Expand Down
5 changes: 2 additions & 3 deletions core/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Stream, PassThrough } from "stream";

declare module "@verdaccio/types" {
type StringValue = string | void | null;

type StringValue = string | void | null;

type StorageList = Array<string>;
type Callback = Function;
Expand Down Expand Up @@ -460,7 +459,7 @@ type StringValue = string | void | null;
allow_publish?(user: RemoteUser, pkg: T & PackageAccess, cb: Callback): void;
allow_access?(user: RemoteUser, pkg: AllowAccess & PackageAccess, cb: Callback): void;
allow_publish?(user: RemoteUser, pkg: AllowAccess & PackageAccess, cb: Callback): void;
allow_unpublish?(user: RemoteUser, pkg: AllowAccess & PackageAccess, cb: Callback): void;s
allow_unpublish?(user: RemoteUser, pkg: AllowAccess & PackageAccess, cb: Callback): void;
apiJWTmiddleware?(helpers : any): Function;
}

Expand Down
50 changes: 10 additions & 40 deletions core/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,12 @@
"type": "git",
"url": "git://github.com/verdaccio/flow-types"
},
"main": "lib/types.js.flow",
"main": "index.d.ts",
"types": "index.d.ts",
"scripts": {
"precommit": "lint-staged",
"lint": "eslint .",
"prepublish": "npm run build",
"format": "prettier --write",
"test": "tsc --noEmit",
"release": "standard-version -a -s",
"build": "npm run build:flow",
"build:flow": "mkdir -p lib && cp src/flow/types.js lib/types.js.flow",
"test": "npm run lint && flow check"
"build": "echo \"no buid required\""
},
"keywords": [
"flow-type",
Expand All @@ -26,37 +22,11 @@
"private": false,
"license": "MIT",
"devDependencies": {
"@octokit/rest": "^16.25.0",
"@types/node": "10.12.18",
"babel-eslint": "10.0.1",
"eslint": "5.12.0",
"eslint-config-prettier": "3.3.0",
"eslint-plugin-flow-typed": "1.0.1",
"eslint-plugin-flowtype": "3.2.1",
"eslint-plugin-prettier": "3.0.1",
"flow-bin": "0.90.0",
"get-stdin": "^7.0.0",
"husky": "0.14.3",
"lint-staged": "8.1.0",
"prettier": "1.15.3",
"standard-version": "4.4.0",
"typescript": "3.2.4"
},
"peerDependencies": {
"@types/node": "10.12.18",
"flow-bin": "0.90.0",
"typescript": "3.2.4"
},
"lint-staged": {
"linters": {
"package.json": [
"prettier --write",
"git add"
],
"*.js": [
"eslint --fix",
"git add"
]
}
"@octokit/rest": "^16.28.6",
"@types/node": "12.6.8",
"get-stdin": "7.0.0",
"husky": "3.0.1",
"standard-version": "6.0.1",
"typescript": "^3.5.3"
}
}
5 changes: 0 additions & 5 deletions core/types/renovate.json

This file was deleted.

Loading

0 comments on commit 2218b74

Please sign in to comment.