Skip to content

Commit 0bd74cc

Browse files
committed
Init commit
0 parents  commit 0bd74cc

36 files changed

+3881
-0
lines changed

.babelrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"presets": [
3+
["env", {
4+
"targets": {
5+
"node": 8
6+
}
7+
}],
8+
"flow"
9+
]
10+
}

.flowconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[ignore]
2+
3+
[include]
4+
5+
[libs]
6+
7+
[options]
8+
9+
[lints]

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
*.log
3+
lib

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v8.1.4

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2017-present James Kyle <[email protected]>
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

README.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# pyarn
2+
3+
This package implements the public api of Yarn Workspaces using a stripped down
4+
install process.
5+
6+
pyarn gets around having to implement the entire Yarn Workspace install process
7+
using the following rules:
8+
9+
1. You MUST specify ALL your dependencies in the **project** `package.json` in
10+
addition to the **workspace** `package.json`
11+
2. Dependencies installed in multiple workspaces MUST depend on the same
12+
version.
13+
14+
For example, if you have two workspaces that both depend on `react`, you must
15+
add `react` to the root project `package.json` and they must all be on the same
16+
version (i.e. `^15.5.1`).
17+
18+
You can still version workspaces independently and have different sets of
19+
dependencies in each workspace.
20+
21+
## Installation
22+
23+
```sh
24+
yarn global add pyarn
25+
```
26+
27+
## Usage
28+
29+
Create a repo that looks like this:
30+
31+
```
32+
project/
33+
package.json
34+
packages/
35+
foo/
36+
package.json
37+
bar/
38+
package.json
39+
```
40+
41+
In the root project `package.json`, you should specify a `pworkspaces` field
42+
like this:
43+
44+
```json
45+
{
46+
"name": "project",
47+
"pworkspaces": [
48+
"packages/*"
49+
]
50+
}
51+
```
52+
53+
Add a dependency to both the project `package.json` and a workspace
54+
`package.json`.
55+
56+
```js
57+
{
58+
"dependencies": {
59+
"react": "^15.5.1"
60+
}
61+
}
62+
```
63+
64+
Finally run `pyarn install` and you should get the proper `node_modules`.
65+
66+
```
67+
pyarn install v0.1.0
68+
[1/3] Installing project dependencies...
69+
----------------------------------------
70+
yarn install v0.27.5
71+
info No lockfile found.
72+
[1/4] Resolving packages...
73+
[2/4] Fetching packages...
74+
[3/4] Linking dependencies...
75+
[4/4] Building fresh packages...
76+
success Saved lockfile.
77+
Done in 0.84s.
78+
----------------------------------------
79+
[2/3] Linking workspace dependencies...
80+
[3/3] Linking workspace cross-dependencies...
81+
success Installed and linked workspaces.
82+
Done in 1.21s.
83+
```
84+
85+
## Status
86+
87+
Right now only the `install` command is implemented. The plan is to implement
88+
the entire Yarn Workspace API.

bin.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env node
2+
require('./lib/cli');

example/package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"private": true,
3+
"name": "fixture-project",
4+
"pworkspaces": [
5+
"packages/*"
6+
],
7+
"dependencies": {
8+
"react": "^15.6.1"
9+
}
10+
}

example/packages/bar/package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "bar-workspace-package",
3+
"version": "1.0.0",
4+
"dependencies": {
5+
"react": "^15.6.1"
6+
}
7+
}

example/packages/foo/package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "foo-workspace-package",
3+
"version": "1.0.0",
4+
"dependencies": {
5+
"react": "^15.6.1",
6+
"bar-workspace-package": "^1.0.0"
7+
}
8+
}

example/yarn.lock

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2+
# yarn lockfile v1
3+
4+
5+
asap@~2.0.3:
6+
version "2.0.6"
7+
resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46"
8+
9+
core-js@^1.0.0:
10+
version "1.2.7"
11+
resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636"
12+
13+
create-react-class@^15.6.0:
14+
version "15.6.0"
15+
resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.0.tgz#ab448497c26566e1e29413e883207d57cfe7bed4"
16+
dependencies:
17+
fbjs "^0.8.9"
18+
loose-envify "^1.3.1"
19+
object-assign "^4.1.1"
20+
21+
encoding@^0.1.11:
22+
version "0.1.12"
23+
resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb"
24+
dependencies:
25+
iconv-lite "~0.4.13"
26+
27+
fbjs@^0.8.9:
28+
version "0.8.14"
29+
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.14.tgz#d1dbe2be254c35a91e09f31f9cd50a40b2a0ed1c"
30+
dependencies:
31+
core-js "^1.0.0"
32+
isomorphic-fetch "^2.1.1"
33+
loose-envify "^1.0.0"
34+
object-assign "^4.1.0"
35+
promise "^7.1.1"
36+
setimmediate "^1.0.5"
37+
ua-parser-js "^0.7.9"
38+
39+
iconv-lite@~0.4.13:
40+
version "0.4.18"
41+
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.18.tgz#23d8656b16aae6742ac29732ea8f0336a4789cf2"
42+
43+
is-stream@^1.0.1:
44+
version "1.1.0"
45+
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
46+
47+
isomorphic-fetch@^2.1.1:
48+
version "2.2.1"
49+
resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9"
50+
dependencies:
51+
node-fetch "^1.0.1"
52+
whatwg-fetch ">=0.10.0"
53+
54+
js-tokens@^3.0.0:
55+
version "3.0.2"
56+
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
57+
58+
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1:
59+
version "1.3.1"
60+
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
61+
dependencies:
62+
js-tokens "^3.0.0"
63+
64+
node-fetch@^1.0.1:
65+
version "1.7.1"
66+
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.1.tgz#899cb3d0a3c92f952c47f1b876f4c8aeabd400d5"
67+
dependencies:
68+
encoding "^0.1.11"
69+
is-stream "^1.0.1"
70+
71+
object-assign@^4.1.0, object-assign@^4.1.1:
72+
version "4.1.1"
73+
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
74+
75+
promise@^7.1.1:
76+
version "7.3.1"
77+
resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf"
78+
dependencies:
79+
asap "~2.0.3"
80+
81+
prop-types@^15.5.10:
82+
version "15.5.10"
83+
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.10.tgz#2797dfc3126182e3a95e3dfbb2e893ddd7456154"
84+
dependencies:
85+
fbjs "^0.8.9"
86+
loose-envify "^1.3.1"
87+
88+
react@^15.6.1:
89+
version "15.6.1"
90+
resolved "https://registry.yarnpkg.com/react/-/react-15.6.1.tgz#baa8434ec6780bde997cdc380b79cd33b96393df"
91+
dependencies:
92+
create-react-class "^15.6.0"
93+
fbjs "^0.8.9"
94+
loose-envify "^1.1.0"
95+
object-assign "^4.1.0"
96+
prop-types "^15.5.10"
97+
98+
setimmediate@^1.0.5:
99+
version "1.0.5"
100+
resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285"
101+
102+
ua-parser-js@^0.7.9:
103+
version "0.7.14"
104+
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.14.tgz#110d53fa4c3f326c121292bbeac904d2e03387ca"
105+
106+
whatwg-fetch@>=0.10.0:
107+
version "2.0.3"
108+
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84"

flow-typed/npm/chalk_v1.x.x.js

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
// flow-typed signature: b1a2d646047879188d7e44cb218212b5
2+
// flow-typed version: b43dff3e0e/chalk_v1.x.x/flow_>=v0.19.x
3+
4+
type $npm$chalk$StyleElement = {
5+
open: string;
6+
close: string;
7+
};
8+
9+
type $npm$chalk$Chain = $npm$chalk$Style & (...text: any[]) => string;
10+
11+
type $npm$chalk$Style = {
12+
// General
13+
reset: $npm$chalk$Chain;
14+
bold: $npm$chalk$Chain;
15+
dim: $npm$chalk$Chain;
16+
italic: $npm$chalk$Chain;
17+
underline: $npm$chalk$Chain;
18+
inverse: $npm$chalk$Chain;
19+
strikethrough: $npm$chalk$Chain;
20+
21+
// Text colors
22+
black: $npm$chalk$Chain;
23+
red: $npm$chalk$Chain;
24+
green: $npm$chalk$Chain;
25+
yellow: $npm$chalk$Chain;
26+
blue: $npm$chalk$Chain;
27+
magenta: $npm$chalk$Chain;
28+
cyan: $npm$chalk$Chain;
29+
white: $npm$chalk$Chain;
30+
gray: $npm$chalk$Chain;
31+
grey: $npm$chalk$Chain;
32+
33+
// Background colors
34+
bgBlack: $npm$chalk$Chain;
35+
bgRed: $npm$chalk$Chain;
36+
bgGreen: $npm$chalk$Chain;
37+
bgYellow: $npm$chalk$Chain;
38+
bgBlue: $npm$chalk$Chain;
39+
bgMagenta: $npm$chalk$Chain;
40+
bgCyan: $npm$chalk$Chain;
41+
bgWhite: $npm$chalk$Chain;
42+
};
43+
44+
type $npm$chalk$StyleMap = {
45+
// General
46+
reset: $npm$chalk$StyleElement;
47+
bold: $npm$chalk$StyleElement;
48+
dim: $npm$chalk$StyleElement;
49+
italic: $npm$chalk$StyleElement;
50+
underline: $npm$chalk$StyleElement;
51+
inverse: $npm$chalk$StyleElement;
52+
strikethrough: $npm$chalk$StyleElement;
53+
54+
// Text colors
55+
black: $npm$chalk$StyleElement;
56+
red: $npm$chalk$StyleElement;
57+
green: $npm$chalk$StyleElement;
58+
yellow: $npm$chalk$StyleElement;
59+
blue: $npm$chalk$StyleElement;
60+
magenta: $npm$chalk$StyleElement;
61+
cyan: $npm$chalk$StyleElement;
62+
white: $npm$chalk$StyleElement;
63+
gray: $npm$chalk$StyleElement;
64+
65+
// Background colors
66+
bgBlack: $npm$chalk$StyleElement;
67+
bgRed: $npm$chalk$StyleElement;
68+
bgGreen: $npm$chalk$StyleElement;
69+
bgYellow: $npm$chalk$StyleElement;
70+
bgBlue: $npm$chalk$StyleElement;
71+
bgMagenta: $npm$chalk$StyleElement;
72+
bgCyan: $npm$chalk$StyleElement;
73+
bgWhite: $npm$chalk$StyleElement;
74+
};
75+
76+
declare module "chalk" {
77+
declare var enabled: boolean;
78+
declare var supportsColor: boolean;
79+
declare var styles: $npm$chalk$StyleMap;
80+
81+
declare function stripColor(value: string): any;
82+
declare function hasColor(str: string): boolean;
83+
84+
// General
85+
declare var reset: $npm$chalk$Chain;
86+
declare var bold: $npm$chalk$Chain;
87+
declare var dim: $npm$chalk$Chain;
88+
declare var italic: $npm$chalk$Chain;
89+
declare var underline: $npm$chalk$Chain;
90+
declare var inverse: $npm$chalk$Chain;
91+
declare var strikethrough: $npm$chalk$Chain;
92+
93+
// Text colors
94+
declare var black: $npm$chalk$Chain;
95+
declare var red: $npm$chalk$Chain;
96+
declare var green: $npm$chalk$Chain;
97+
declare var yellow: $npm$chalk$Chain;
98+
declare var blue: $npm$chalk$Chain;
99+
declare var magenta: $npm$chalk$Chain;
100+
declare var cyan: $npm$chalk$Chain;
101+
declare var white: $npm$chalk$Chain;
102+
declare var gray: $npm$chalk$Chain;
103+
declare var grey: $npm$chalk$Chain;
104+
105+
// Background colors
106+
declare var bgBlack: $npm$chalk$Chain;
107+
declare var bgRed: $npm$chalk$Chain;
108+
declare var bgGreen: $npm$chalk$Chain;
109+
declare var bgYellow: $npm$chalk$Chain;
110+
declare var bgBlue: $npm$chalk$Chain;
111+
declare var bgMagenta: $npm$chalk$Chain;
112+
declare var bgCyan: $npm$chalk$Chain;
113+
declare var bgWhite: $npm$chalk$Chain;
114+
}

0 commit comments

Comments
 (0)