Skip to content

Commit 5b0d78b

Browse files
committed
Regroup packages with yarn workspaces
1 parent 82b08d9 commit 5b0d78b

File tree

199 files changed

+13726
-18067
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

199 files changed

+13726
-18067
lines changed

bin/run

-6
This file was deleted.

editor/yarn.lock

-12,612
This file was deleted.

package.json

+14-60
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{
2-
"name": "tuture",
2+
"name": "tuture-monorepo",
33
"version": "3.0.0-alpha10",
4+
"private": true,
45
"description": "Write tutorials from the future, with the power of Git and community.",
5-
"main": "index.ts",
6-
"preferGlobal": true,
6+
"workspaces": [
7+
"packages/*"
8+
],
79
"keywords": [
810
"learn-by-doing",
911
"learn-by-examples",
@@ -19,29 +21,19 @@
1921
"lint": "eslint \"**/*.{js,jsx,ts,tsx}\" --fix",
2022
"test": "jest",
2123
"test:watch": "jest --watch",
22-
"build:editor": "cd editor && yarn && yarn build",
23-
"build:cli": "tsc",
24-
"build": "yarn clean && yarn build:editor && yarn build:cli && cp -r editor/build build/editor",
24+
"build": "rollup -c",
2525
"clean": "rimraf build",
26-
"pkg": "./scripts/pack.sh",
2726
"prepack": "yarn build && rimraf build/**/*.map"
2827
},
2928
"repository": {
3029
"type": "git",
3130
"url": "https://github.com/tuture-dev/tuture.git"
3231
},
3332
"license": "MIT",
34-
"bin": {
35-
"tuture": "./bin/run"
36-
},
3733
"bugs": {
3834
"url": "https://github.com/tuture-dev/tuture/issues"
3935
},
4036
"homepage": "https://github.com/tuture-dev/tuture#readme",
41-
"files": [
42-
"/bin",
43-
"/build"
44-
],
4537
"husky": {
4638
"hooks": {
4739
"pre-commit": "lint-staged"
@@ -53,44 +45,12 @@
5345
"eslint . --fix"
5446
]
5547
},
56-
"dependencies": {
57-
"@oclif/command": "^1.4.36",
58-
"@oclif/config": "^1.6.33",
59-
"@oclif/plugin-help": "^2.0.5",
60-
"chalk": "^2.4.2",
61-
"editure": "^0.1.2",
62-
"editure-constants": "^0.1.2",
63-
"express": "^4.16.3",
64-
"fs-extra": "^7.0.0",
65-
"get-port": "^5.1.1",
66-
"globby": "^8.0.1",
67-
"inquirer": "^6.0.0",
68-
"micromatch": "^3.1.10",
69-
"morgan": "^1.9.1",
70-
"open": "^6.4.0",
71-
"parse-diff": "^0.4.2",
72-
"rc": "^1.2.8",
73-
"simple-git": "^1.129.0",
74-
"slate": "^0.57.1",
75-
"socket.io": "^2.1.1",
76-
"tmp": "^0.0.33",
77-
"which": "^1.3.1",
78-
"winston": "^3.1.0"
79-
},
8048
"devDependencies": {
81-
"@types/express": "^4.16.0",
49+
"@rollup/plugin-node-resolve": "^7.1.1",
8250
"@types/faker": "^4.1.10",
83-
"@types/fs-extra": "^5.0.4",
84-
"@types/inquirer": "^0.0.42",
8551
"@types/jest": "^23.3.1",
86-
"@types/js-yaml": "^3.11.2",
8752
"@types/lodash.clonedeep": "^4.5.6",
88-
"@types/micromatch": "^3.1.0",
89-
"@types/morgan": "^1.7.35",
90-
"@types/multer": "^1.3.7",
9153
"@types/rc": "^1.1.0",
92-
"@types/request": "^2.47.1",
93-
"@types/socket.io": "^1.4.38",
9454
"@types/tmp": "^0.0.33",
9555
"@types/which": "^1.3.1",
9656
"@typescript-eslint/eslint-plugin": "^2.19.2",
@@ -112,21 +72,19 @@
11272
"jest": "^24.9.0",
11373
"lint-staged": "^10.0.7",
11474
"lodash.clonedeep": "^4.5.0",
115-
"pkg": "^4.4.0",
11675
"prettier": "^1.19.1",
11776
"pretty-quick": "^2.0.1",
11877
"rimraf": "^2.6.2",
78+
"rollup": "^1.31.0",
79+
"rollup-plugin-babel": "^4.3.3",
80+
"rollup-plugin-commonjs": "^10.1.0",
81+
"rollup-plugin-css-only": "^2.0.0",
82+
"rollup-plugin-json": "^4.0.0",
83+
"rollup-plugin-jsx": "^1.0.3",
84+
"rollup-plugin-typescript2": "^0.26.0",
11985
"ts-jest": "^24.1.0",
12086
"typescript": "^3.8.3"
12187
},
122-
"types": "lib/index.d.ts",
123-
"oclif": {
124-
"commands": "./build/commands",
125-
"bin": "tuture",
126-
"plugins": [
127-
"@oclif/plugin-help"
128-
]
129-
},
13088
"jest": {
13189
"transform": {
13290
"^.+\\.tsx?$": "ts-jest"
@@ -145,9 +103,5 @@
145103
],
146104
"testURL": "http://localhost/",
147105
"verbose": true
148-
},
149-
"pkg": {
150-
"scripts": "bin/run",
151-
"assets": "build/**/*"
152106
}
153107
}

packages/cli/.editorconfig

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
10+
[*.md]
11+
trim_trailing_whitespace = false

packages/cli/.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*-debug.log
2+
*-error.log
3+
/.nyc_output
4+
/dist
5+
/lib
6+
/package-lock.json
7+
/tmp
8+
node_modules

packages/cli/README.md

+179
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
@tuture/cli
2+
===========
3+
4+
CLI for Tuture
5+
6+
[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
7+
[![Version](https://img.shields.io/npm/v/@tuture/cli.svg)](https://npmjs.org/package/@tuture/cli)
8+
[![Downloads/week](https://img.shields.io/npm/dw/@tuture/cli.svg)](https://npmjs.org/package/@tuture/cli)
9+
[![License](https://img.shields.io/npm/l/@tuture/cli.svg)](https://github.com//cli/blob/master/package.json)
10+
11+
<!-- toc -->
12+
* [Usage](#usage)
13+
* [Commands](#commands)
14+
<!-- tocstop -->
15+
# Usage
16+
<!-- usage -->
17+
```sh-session
18+
$ npm install -g @tuture/cli
19+
$ tuture COMMAND
20+
running command...
21+
$ tuture (-v|--version|version)
22+
@tuture/cli/0.0.2 darwin-x64 node-v12.10.0
23+
$ tuture --help [COMMAND]
24+
USAGE
25+
$ tuture COMMAND
26+
...
27+
```
28+
<!-- usagestop -->
29+
# Commands
30+
<!-- commands -->
31+
* [`tuture build`](#tuture-build)
32+
* [`tuture commit`](#tuture-commit)
33+
* [`tuture destroy`](#tuture-destroy)
34+
* [`tuture help [COMMAND]`](#tuture-help-command)
35+
* [`tuture init`](#tuture-init)
36+
* [`tuture pull`](#tuture-pull)
37+
* [`tuture push`](#tuture-push)
38+
* [`tuture reload`](#tuture-reload)
39+
* [`tuture sync`](#tuture-sync)
40+
* [`tuture up`](#tuture-up)
41+
42+
## `tuture build`
43+
44+
Build tutorial into a markdown document
45+
46+
```
47+
USAGE
48+
$ tuture build
49+
50+
OPTIONS
51+
-h, --help show CLI help
52+
-o, --out=out name of output directory
53+
--hexo hexo compatibility mode
54+
```
55+
56+
## `tuture commit`
57+
58+
Commit your tutorial to VCS (Git)
59+
60+
```
61+
USAGE
62+
$ tuture commit
63+
64+
OPTIONS
65+
-h, --help show CLI help
66+
-m, --message=message commit message
67+
```
68+
69+
## `tuture destroy`
70+
71+
Delete all tuture files
72+
73+
```
74+
USAGE
75+
$ tuture destroy
76+
77+
OPTIONS
78+
-f, --force destroy without confirmation
79+
-h, --help show CLI help
80+
```
81+
82+
## `tuture help [COMMAND]`
83+
84+
display help for tuture
85+
86+
```
87+
USAGE
88+
$ tuture help [COMMAND]
89+
90+
ARGUMENTS
91+
COMMAND command to show help for
92+
93+
OPTIONS
94+
--all see all commands in CLI
95+
```
96+
97+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v2.2.3/src/commands/help.ts)_
98+
99+
## `tuture init`
100+
101+
Initialize a tuture tutorial
102+
103+
```
104+
USAGE
105+
$ tuture init
106+
107+
OPTIONS
108+
-h, --help show CLI help
109+
-y, --yes do not ask for prompts
110+
```
111+
112+
## `tuture pull`
113+
114+
Pull the remote tuture branch to local
115+
116+
```
117+
USAGE
118+
$ tuture pull
119+
120+
OPTIONS
121+
-h, --help show CLI help
122+
-r, --remote=remote name of remote to pull
123+
```
124+
125+
## `tuture push`
126+
127+
Push the tuture branch to remote
128+
129+
```
130+
USAGE
131+
$ tuture push
132+
133+
OPTIONS
134+
-h, --help show CLI help
135+
-r, --remote=remote name of remote to push
136+
```
137+
138+
## `tuture reload`
139+
140+
Update workspace with latest commit history
141+
142+
```
143+
USAGE
144+
$ tuture reload
145+
146+
OPTIONS
147+
-h, --help show CLI help
148+
```
149+
150+
## `tuture sync`
151+
152+
Synchronize workspace with local/remote branch
153+
154+
```
155+
USAGE
156+
$ tuture sync
157+
158+
OPTIONS
159+
-h, --help show CLI help
160+
-m, --message=message commit message
161+
--configureRemotes configure remotes before synchronization
162+
--continue continue synchronization after resolving conflicts
163+
--noPull do not pull from remote
164+
--noPush do not push to remote
165+
```
166+
167+
## `tuture up`
168+
169+
Render and edit tutorial in browser
170+
171+
```
172+
USAGE
173+
$ tuture up
174+
175+
OPTIONS
176+
-h, --help show CLI help
177+
-p, --port=port which port to use for editor server
178+
```
179+
<!-- commandsstop -->

packages/cli/bin/run

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env node
2+
3+
require('@oclif/command').run()
4+
.then(require('@oclif/command/flush'))
5+
.catch(require('@oclif/errors/handle'))

packages/cli/bin/run.cmd

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
3+
node "%~dp0\run" %*

0 commit comments

Comments
 (0)