@learnpack/learnpack 5.0.14 → 5.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -11
- package/lib/utils/checkNotInstalled.js +7 -1
- package/oclif.manifest.json +1 -1
- package/package.json +152 -152
- package/src/utils/checkNotInstalled.ts +8 -1
- package/src/utils/incrementVersion.js +65 -0
package/README.md
CHANGED
@@ -21,7 +21,7 @@ $ npm install -g @learnpack/learnpack
|
|
21
21
|
$ learnpack COMMAND
|
22
22
|
running command...
|
23
23
|
$ learnpack (-v|--version|version)
|
24
|
-
@learnpack/learnpack/5.0.
|
24
|
+
@learnpack/learnpack/5.0.15 win32-x64 node-v20.16.0
|
25
25
|
$ learnpack --help [COMMAND]
|
26
26
|
USAGE
|
27
27
|
$ learnpack COMMAND
|
@@ -75,7 +75,7 @@ DESCRIPTION
|
|
75
75
|
12. If there is a file within the exercises folder but not inside of any particular exercise's folder. (Warning)
|
76
76
|
```
|
77
77
|
|
78
|
-
_See code: [src\commands\audit.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.
|
78
|
+
_See code: [src\commands\audit.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.15/src\commands\audit.ts)_
|
79
79
|
|
80
80
|
## `learnpack clean`
|
81
81
|
|
@@ -90,7 +90,7 @@ DESCRIPTION
|
|
90
90
|
Extra documentation goes here
|
91
91
|
```
|
92
92
|
|
93
|
-
_See code: [src\commands\clean.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.
|
93
|
+
_See code: [src\commands\clean.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.15/src\commands\clean.ts)_
|
94
94
|
|
95
95
|
## `learnpack download [PACKAGE]`
|
96
96
|
|
@@ -108,7 +108,7 @@ DESCRIPTION
|
|
108
108
|
Extra documentation goes here
|
109
109
|
```
|
110
110
|
|
111
|
-
_See code: [src\commands\download.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.
|
111
|
+
_See code: [src\commands\download.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.15/src\commands\download.ts)_
|
112
112
|
|
113
113
|
## `learnpack help [COMMAND]`
|
114
114
|
|
@@ -139,7 +139,7 @@ OPTIONS
|
|
139
139
|
-h, --grading show CLI help
|
140
140
|
```
|
141
141
|
|
142
|
-
_See code: [src\commands\init.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.
|
142
|
+
_See code: [src\commands\init.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.15/src\commands\init.ts)_
|
143
143
|
|
144
144
|
## `learnpack login [PACKAGE]`
|
145
145
|
|
@@ -157,7 +157,7 @@ DESCRIPTION
|
|
157
157
|
Extra documentation goes here
|
158
158
|
```
|
159
159
|
|
160
|
-
_See code: [src\commands\login.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.
|
160
|
+
_See code: [src\commands\login.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.15/src\commands\login.ts)_
|
161
161
|
|
162
162
|
## `learnpack logout [PACKAGE]`
|
163
163
|
|
@@ -175,7 +175,7 @@ DESCRIPTION
|
|
175
175
|
Extra documentation goes here
|
176
176
|
```
|
177
177
|
|
178
|
-
_See code: [src\commands\logout.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.
|
178
|
+
_See code: [src\commands\logout.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.15/src\commands\logout.ts)_
|
179
179
|
|
180
180
|
## `learnpack plugins`
|
181
181
|
|
@@ -306,7 +306,7 @@ OPTIONS
|
|
306
306
|
-h, --help show CLI help
|
307
307
|
```
|
308
308
|
|
309
|
-
_See code: [src\commands\publish.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.
|
309
|
+
_See code: [src\commands\publish.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.15/src\commands\publish.ts)_
|
310
310
|
|
311
311
|
## `learnpack start`
|
312
312
|
|
@@ -327,7 +327,7 @@ OPTIONS
|
|
327
327
|
-w, --watch Watch for file changes
|
328
328
|
```
|
329
329
|
|
330
|
-
_See code: [src\commands\start.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.
|
330
|
+
_See code: [src\commands\start.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.15/src\commands\start.ts)_
|
331
331
|
|
332
332
|
## `learnpack test [EXERCISESLUG]`
|
333
333
|
|
@@ -341,7 +341,7 @@ ARGUMENTS
|
|
341
341
|
EXERCISESLUG The name of the exercise to test
|
342
342
|
```
|
343
343
|
|
344
|
-
_See code: [src\commands\test.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.
|
344
|
+
_See code: [src\commands\test.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.15/src\commands\test.ts)_
|
345
345
|
|
346
346
|
## `learnpack translate`
|
347
347
|
|
@@ -352,7 +352,7 @@ USAGE
|
|
352
352
|
$ learnpack translate
|
353
353
|
```
|
354
354
|
|
355
|
-
_See code: [src\commands\translate.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.
|
355
|
+
_See code: [src\commands\translate.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.15/src\commands\translate.ts)_
|
356
356
|
<!-- commandsstop -->
|
357
357
|
|
358
358
|
> > > > > > > 0cb3e56d84c197f9d008836bb573eade212b7e57
|
@@ -160,7 +160,13 @@ const checkNotInstalledDependencies = async (neededPlugins) => {
|
|
160
160
|
await installDependencies(jsPluginsDependencies, "npm");
|
161
161
|
}
|
162
162
|
if (pytestNeeded) {
|
163
|
-
|
163
|
+
try {
|
164
|
+
await exec("python -m pip install --upgrade pip");
|
165
|
+
}
|
166
|
+
catch (error) {
|
167
|
+
console_1.default.error("Error upgrading pip. Please install pip manually, run: pip install --upgrade pip");
|
168
|
+
console_1.default.debug(error);
|
169
|
+
}
|
164
170
|
const { stdout, stderr } = await exec("pip list");
|
165
171
|
if (stderr) {
|
166
172
|
console_1.default.error(`Error executing pip list. Use debug for more info`);
|
package/oclif.manifest.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":"5.0.
|
1
|
+
{"version":"5.0.15","commands":{"audit":{"id":"audit","description":"learnpack audit is the command in charge of creating an auditory of the repository\n...\nlearnpack audit checks for the following information in a repository:\n 1. The configuration object has slug, repository and description. (Error)\n 2. The command learnpack clean has been run. (Error)\n 3. If a markdown or test file doesn't have any content. (Error)\n 4. The links are accessing to valid servers. (Error)\n 5. The relative images are working (If they have the shortest path to the image or if the images exists in the assets). (Error)\n 6. The external images are working (If they are pointing to a valid server). (Error)\n 7. The exercises directory names are valid. (Error)\n 8. If an exercise doesn't have a README file. (Error)\n 9. The exercises array (Of the config file) has content. (Error)\n 10. The exercses have the same translations. (Warning)\n 11. The .gitignore file exists. (Warning)\n 12. If there is a file within the exercises folder but not inside of any particular exercise's folder. (Warning)\n","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[]},"clean":{"id":"clean","description":"Clean the configuration object\n ...\n Extra documentation goes here\n ","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[]},"download":{"id":"download","description":"Describe the command here\n...\nExtra documentation goes here\n","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"init":{"id":"init","description":"Create a new learning package: Book, Tutorial or Exercise","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"grading":{"name":"grading","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"login":{"id":"login","description":"Describe the command here\n ...\n Extra documentation goes here\n ","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"logout":{"id":"logout","description":"Describe the command here\n ...\n Extra documentation goes here\n ","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"publish":{"id":"publish","description":"Builds the project by copying necessary files and directories into a zip file","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"start":{"id":"start","description":"Runs a small server with all the exercise instructions","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"port":{"name":"port","type":"option","char":"p","description":"server port"},"host":{"name":"host","type":"option","char":"h","description":"server host"},"disableGrading":{"name":"disableGrading","type":"boolean","char":"D","description":"disble grading functionality","allowNo":false},"watch":{"name":"watch","type":"boolean","char":"w","description":"Watch for file changes","allowNo":false},"editor":{"name":"editor","type":"option","char":"e","description":"[preview, extension]","options":["extension","preview"]},"version":{"name":"version","type":"option","char":"v","description":"E.g: 1.0.1"},"grading":{"name":"grading","type":"option","char":"g","description":"[isolated, incremental]","options":["isolated","incremental"]},"debug":{"name":"debug","type":"boolean","char":"d","description":"debugger mode for more verbage","allowNo":false}},"args":[]},"test":{"id":"test","description":"Test exercises","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"exerciseSlug","description":"The name of the exercise to test","required":false,"hidden":false}]},"translate":{"id":"translate","description":"List all the lessons, the user is able of select many of them to translate to the given languages","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[]}}}
|
package/package.json
CHANGED
@@ -1,152 +1,152 @@
|
|
1
|
-
{
|
2
|
-
"name": "@learnpack/learnpack",
|
3
|
-
"description": "Seamlessly build, sell and/or take interactive & auto-graded tutorials, start learning now or build a new tutorial to your audience.",
|
4
|
-
"version": "5.0.
|
5
|
-
"author": "Alejandro Sanchez @alesanchezr",
|
6
|
-
"contributors": [
|
7
|
-
{
|
8
|
-
"name": "Alejandro Sanchez",
|
9
|
-
"url": "https://www.x.com/alesanchezr"
|
10
|
-
},
|
11
|
-
{
|
12
|
-
"name": "Charly Chacón",
|
13
|
-
"email": "charlyjchaconc@gmail.com",
|
14
|
-
"url": "https://www.linkedin.com/in/charlytoc/"
|
15
|
-
}
|
16
|
-
],
|
17
|
-
"bin": {
|
18
|
-
"learnpack": "bin/run"
|
19
|
-
},
|
20
|
-
"bugs": {
|
21
|
-
"url": "https://github.com/learnpack/learnpack-cli/issues"
|
22
|
-
},
|
23
|
-
"dependencies": {
|
24
|
-
"@oclif/command": "^1.6.1",
|
25
|
-
"@oclif/config": "^1.15.1",
|
26
|
-
"@oclif/plugin-help": "^3.1.0",
|
27
|
-
"@oclif/plugin-plugins": "^1.8.0",
|
28
|
-
"@oclif/plugin-warn-if-update-available": "^1.7.0",
|
29
|
-
"@types/archiver": "^6.0.2",
|
30
|
-
"archiver": "^7.0.1",
|
31
|
-
"axios": "^1.7.7",
|
32
|
-
"body-parser": "^1.19.0",
|
33
|
-
"chalk": "^4.1.0",
|
34
|
-
"chokidar": "^3.4.0",
|
35
|
-
"cli-ux": "^5.4.6",
|
36
|
-
"debounce": "^1.2.0",
|
37
|
-
"dotenv": "^8.2.0",
|
38
|
-
"enquirer": "^2.3.6",
|
39
|
-
"eslint-plugin-unicorn": "^38.0.1",
|
40
|
-
"espree": "^9.3.2",
|
41
|
-
"eta": "^1.2.0",
|
42
|
-
"express": "^4.17.1",
|
43
|
-
"front-matter": "^4.0.2",
|
44
|
-
"moment": "^2.27.0",
|
45
|
-
"node-emoji": "^1.10.0",
|
46
|
-
"node-fetch": "^2.7.0",
|
47
|
-
"node-persist": "^3.1.0",
|
48
|
-
"prompts": "^2.3.2",
|
49
|
-
"shelljs": "^0.8.4",
|
50
|
-
"socket.io": "^4.4.1",
|
51
|
-
"targz": "^1.0.1",
|
52
|
-
"tslib": "^1",
|
53
|
-
"validator": "^13.1.1",
|
54
|
-
"xxhashjs": "^0.2.2"
|
55
|
-
},
|
56
|
-
"devDependencies": {
|
57
|
-
"@oclif/dev-cli": "^1.22.2",
|
58
|
-
"@oclif/test": "^1.2.6",
|
59
|
-
"@types/chai": "^4",
|
60
|
-
"@types/debounce": "^1.2.1",
|
61
|
-
"@types/express": "^4.17.13",
|
62
|
-
"@types/fs-extra": "^8.1.0",
|
63
|
-
"@types/mocha": "^5",
|
64
|
-
"@types/mock-fs": "^4.13.1",
|
65
|
-
"@types/node": "^10.17.60",
|
66
|
-
"@types/node-persist": "^3.1.2",
|
67
|
-
"@types/prompts": "^2.0.14",
|
68
|
-
"@types/shelljs": "^0.8.9",
|
69
|
-
"@types/socket.io": "^3.0.2",
|
70
|
-
"@types/targz": "^1.0.1",
|
71
|
-
"@types/validator": "^13.7.0",
|
72
|
-
"@types/xxhashjs": "^0.2.2",
|
73
|
-
"@typescript-eslint/eslint-plugin": "^5.4.0",
|
74
|
-
"@typescript-eslint/parser": "^5.4.0",
|
75
|
-
"chai": "^4.2.0",
|
76
|
-
"chai-http": "^4.3.0",
|
77
|
-
"eslint": "^8.12.0",
|
78
|
-
"eslint-config-oclif": "^4.0",
|
79
|
-
"eslint-config-oclif-typescript": "^1.0.2",
|
80
|
-
"fs-extra": "^10.0.1",
|
81
|
-
"globby": "^10.0.2",
|
82
|
-
"husky": ">=6",
|
83
|
-
"lint-staged": ">=10",
|
84
|
-
"mocha": "^5.2.0",
|
85
|
-
"mock-fs": "^5.1.2",
|
86
|
-
"nock": "^13.2.2",
|
87
|
-
"nyc": "^14.1.1",
|
88
|
-
"pre-commit": "^1.2.2",
|
89
|
-
"prettier": "^2.4.1",
|
90
|
-
"ts-node": "^8",
|
91
|
-
"typescript": "^5.6.2"
|
92
|
-
},
|
93
|
-
"engines": {
|
94
|
-
"node": ">=14.0.0"
|
95
|
-
},
|
96
|
-
"files": [
|
97
|
-
"/bin",
|
98
|
-
"/npm-shrinkwrap.json",
|
99
|
-
"/oclif.manifest.json",
|
100
|
-
"/src",
|
101
|
-
"/lib"
|
102
|
-
],
|
103
|
-
"homepage": "https://github.com/learnpack/learnpack-cli",
|
104
|
-
"keywords": [
|
105
|
-
"oclif"
|
106
|
-
],
|
107
|
-
"license": "UNLICENSED",
|
108
|
-
"main": "lib/index.js",
|
109
|
-
"types": "lib/index.d.ts",
|
110
|
-
"oclif": {
|
111
|
-
"commands": "./lib/commands",
|
112
|
-
"bin": "learnpack",
|
113
|
-
"plugins": [
|
114
|
-
"@oclif/plugin-help",
|
115
|
-
"@oclif/plugin-plugins",
|
116
|
-
"@oclif/plugin-warn-if-update-available"
|
117
|
-
],
|
118
|
-
"permanent_plugins": [
|
119
|
-
"@oclif/plugin-help",
|
120
|
-
"@oclif/plugin-plugins",
|
121
|
-
"@oclif/plugin-warn-if-update-available"
|
122
|
-
]
|
123
|
-
},
|
124
|
-
"repository": {
|
125
|
-
"type": "git",
|
126
|
-
"url": "git+https://github.com/learnpack/learnpack-cli.git"
|
127
|
-
},
|
128
|
-
"pre-commit": {
|
129
|
-
"silent": true,
|
130
|
-
"run": [
|
131
|
-
"pre"
|
132
|
-
]
|
133
|
-
},
|
134
|
-
"scripts": {
|
135
|
-
"tsc": "tsc -b",
|
136
|
-
"postpack": "rm -f oclif.manifest.json && eslint . --ext .ts --config .eslintrc",
|
137
|
-
"prepack": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme",
|
138
|
-
"pre": "node ./test/precommit/index.ts",
|
139
|
-
"test": "NODE_ENV=test nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
|
140
|
-
"version": "oclif-dev readme && git add README.md",
|
141
|
-
"prepare": "husky install"
|
142
|
-
},
|
143
|
-
"lint-staged": {
|
144
|
-
"*.{js,ts}": [
|
145
|
-
"eslint --cache --fix"
|
146
|
-
],
|
147
|
-
"*.{js,css,md,ts}": "prettier --write"
|
148
|
-
},
|
149
|
-
"directories": {
|
150
|
-
"test": "test"
|
151
|
-
}
|
152
|
-
}
|
1
|
+
{
|
2
|
+
"name": "@learnpack/learnpack",
|
3
|
+
"description": "Seamlessly build, sell and/or take interactive & auto-graded tutorials, start learning now or build a new tutorial to your audience.",
|
4
|
+
"version": "5.0.15",
|
5
|
+
"author": "Alejandro Sanchez @alesanchezr",
|
6
|
+
"contributors": [
|
7
|
+
{
|
8
|
+
"name": "Alejandro Sanchez",
|
9
|
+
"url": "https://www.x.com/alesanchezr"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"name": "Charly Chacón",
|
13
|
+
"email": "charlyjchaconc@gmail.com",
|
14
|
+
"url": "https://www.linkedin.com/in/charlytoc/"
|
15
|
+
}
|
16
|
+
],
|
17
|
+
"bin": {
|
18
|
+
"learnpack": "bin/run"
|
19
|
+
},
|
20
|
+
"bugs": {
|
21
|
+
"url": "https://github.com/learnpack/learnpack-cli/issues"
|
22
|
+
},
|
23
|
+
"dependencies": {
|
24
|
+
"@oclif/command": "^1.6.1",
|
25
|
+
"@oclif/config": "^1.15.1",
|
26
|
+
"@oclif/plugin-help": "^3.1.0",
|
27
|
+
"@oclif/plugin-plugins": "^1.8.0",
|
28
|
+
"@oclif/plugin-warn-if-update-available": "^1.7.0",
|
29
|
+
"@types/archiver": "^6.0.2",
|
30
|
+
"archiver": "^7.0.1",
|
31
|
+
"axios": "^1.7.7",
|
32
|
+
"body-parser": "^1.19.0",
|
33
|
+
"chalk": "^4.1.0",
|
34
|
+
"chokidar": "^3.4.0",
|
35
|
+
"cli-ux": "^5.4.6",
|
36
|
+
"debounce": "^1.2.0",
|
37
|
+
"dotenv": "^8.2.0",
|
38
|
+
"enquirer": "^2.3.6",
|
39
|
+
"eslint-plugin-unicorn": "^38.0.1",
|
40
|
+
"espree": "^9.3.2",
|
41
|
+
"eta": "^1.2.0",
|
42
|
+
"express": "^4.17.1",
|
43
|
+
"front-matter": "^4.0.2",
|
44
|
+
"moment": "^2.27.0",
|
45
|
+
"node-emoji": "^1.10.0",
|
46
|
+
"node-fetch": "^2.7.0",
|
47
|
+
"node-persist": "^3.1.0",
|
48
|
+
"prompts": "^2.3.2",
|
49
|
+
"shelljs": "^0.8.4",
|
50
|
+
"socket.io": "^4.4.1",
|
51
|
+
"targz": "^1.0.1",
|
52
|
+
"tslib": "^1",
|
53
|
+
"validator": "^13.1.1",
|
54
|
+
"xxhashjs": "^0.2.2"
|
55
|
+
},
|
56
|
+
"devDependencies": {
|
57
|
+
"@oclif/dev-cli": "^1.22.2",
|
58
|
+
"@oclif/test": "^1.2.6",
|
59
|
+
"@types/chai": "^4",
|
60
|
+
"@types/debounce": "^1.2.1",
|
61
|
+
"@types/express": "^4.17.13",
|
62
|
+
"@types/fs-extra": "^8.1.0",
|
63
|
+
"@types/mocha": "^5",
|
64
|
+
"@types/mock-fs": "^4.13.1",
|
65
|
+
"@types/node": "^10.17.60",
|
66
|
+
"@types/node-persist": "^3.1.2",
|
67
|
+
"@types/prompts": "^2.0.14",
|
68
|
+
"@types/shelljs": "^0.8.9",
|
69
|
+
"@types/socket.io": "^3.0.2",
|
70
|
+
"@types/targz": "^1.0.1",
|
71
|
+
"@types/validator": "^13.7.0",
|
72
|
+
"@types/xxhashjs": "^0.2.2",
|
73
|
+
"@typescript-eslint/eslint-plugin": "^5.4.0",
|
74
|
+
"@typescript-eslint/parser": "^5.4.0",
|
75
|
+
"chai": "^4.2.0",
|
76
|
+
"chai-http": "^4.3.0",
|
77
|
+
"eslint": "^8.12.0",
|
78
|
+
"eslint-config-oclif": "^4.0",
|
79
|
+
"eslint-config-oclif-typescript": "^1.0.2",
|
80
|
+
"fs-extra": "^10.0.1",
|
81
|
+
"globby": "^10.0.2",
|
82
|
+
"husky": ">=6",
|
83
|
+
"lint-staged": ">=10",
|
84
|
+
"mocha": "^5.2.0",
|
85
|
+
"mock-fs": "^5.1.2",
|
86
|
+
"nock": "^13.2.2",
|
87
|
+
"nyc": "^14.1.1",
|
88
|
+
"pre-commit": "^1.2.2",
|
89
|
+
"prettier": "^2.4.1",
|
90
|
+
"ts-node": "^8",
|
91
|
+
"typescript": "^5.6.2"
|
92
|
+
},
|
93
|
+
"engines": {
|
94
|
+
"node": ">=14.0.0"
|
95
|
+
},
|
96
|
+
"files": [
|
97
|
+
"/bin",
|
98
|
+
"/npm-shrinkwrap.json",
|
99
|
+
"/oclif.manifest.json",
|
100
|
+
"/src",
|
101
|
+
"/lib"
|
102
|
+
],
|
103
|
+
"homepage": "https://github.com/learnpack/learnpack-cli",
|
104
|
+
"keywords": [
|
105
|
+
"oclif"
|
106
|
+
],
|
107
|
+
"license": "UNLICENSED",
|
108
|
+
"main": "lib/index.js",
|
109
|
+
"types": "lib/index.d.ts",
|
110
|
+
"oclif": {
|
111
|
+
"commands": "./lib/commands",
|
112
|
+
"bin": "learnpack",
|
113
|
+
"plugins": [
|
114
|
+
"@oclif/plugin-help",
|
115
|
+
"@oclif/plugin-plugins",
|
116
|
+
"@oclif/plugin-warn-if-update-available"
|
117
|
+
],
|
118
|
+
"permanent_plugins": [
|
119
|
+
"@oclif/plugin-help",
|
120
|
+
"@oclif/plugin-plugins",
|
121
|
+
"@oclif/plugin-warn-if-update-available"
|
122
|
+
]
|
123
|
+
},
|
124
|
+
"repository": {
|
125
|
+
"type": "git",
|
126
|
+
"url": "git+https://github.com/learnpack/learnpack-cli.git"
|
127
|
+
},
|
128
|
+
"pre-commit": {
|
129
|
+
"silent": true,
|
130
|
+
"run": [
|
131
|
+
"pre"
|
132
|
+
]
|
133
|
+
},
|
134
|
+
"scripts": {
|
135
|
+
"tsc": "tsc -b",
|
136
|
+
"postpack": "rm -f oclif.manifest.json && eslint . --ext .ts --config .eslintrc",
|
137
|
+
"prepack": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme",
|
138
|
+
"pre": "node ./test/precommit/index.ts",
|
139
|
+
"test": "NODE_ENV=test nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
|
140
|
+
"version": "oclif-dev readme && git add README.md",
|
141
|
+
"prepare": "husky install"
|
142
|
+
},
|
143
|
+
"lint-staged": {
|
144
|
+
"*.{js,ts}": [
|
145
|
+
"eslint --cache --fix"
|
146
|
+
],
|
147
|
+
"*.{js,css,md,ts}": "prettier --write"
|
148
|
+
},
|
149
|
+
"directories": {
|
150
|
+
"test": "test"
|
151
|
+
}
|
152
|
+
}
|
@@ -222,7 +222,14 @@ return true
|
|
222
222
|
}
|
223
223
|
|
224
224
|
if (pytestNeeded) {
|
225
|
-
|
225
|
+
try {
|
226
|
+
await exec("python -m pip install --upgrade pip")
|
227
|
+
} catch (error) {
|
228
|
+
Console.error(
|
229
|
+
"Error upgrading pip. Please install pip manually, run: pip install --upgrade pip"
|
230
|
+
)
|
231
|
+
Console.debug(error)
|
232
|
+
}
|
226
233
|
|
227
234
|
const { stdout, stderr } = await exec("pip list")
|
228
235
|
if (stderr) {
|
@@ -0,0 +1,65 @@
|
|
1
|
+
const fs = require("fs")
|
2
|
+
const path = require("path")
|
3
|
+
const readline = require("readline")
|
4
|
+
|
5
|
+
const packagePath = path.resolve(process.cwd(), "package.json")
|
6
|
+
|
7
|
+
try {
|
8
|
+
// Lee el archivo package.json
|
9
|
+
const packageJson = JSON.parse(fs.readFileSync(packagePath, "utf8"))
|
10
|
+
|
11
|
+
// Verifica que exista un campo "version"
|
12
|
+
if (!packageJson.version) {
|
13
|
+
throw new Error(
|
14
|
+
'El archivo package.json no contiene una propiedad "version".'
|
15
|
+
)
|
16
|
+
}
|
17
|
+
|
18
|
+
const [major, minor, patch] = packageJson.version.split(".").map(Number)
|
19
|
+
|
20
|
+
// Crear la interfaz para leer desde la terminal
|
21
|
+
const rl = readline.createInterface({
|
22
|
+
input: process.stdin,
|
23
|
+
output: process.stdout,
|
24
|
+
})
|
25
|
+
|
26
|
+
// Pregunta al usuario qué parte de la versión desea incrementar
|
27
|
+
rl.question(
|
28
|
+
"¿Qué parte de la versión deseas incrementar? (major, minor, patch): ",
|
29
|
+
answer => {
|
30
|
+
let newVersion
|
31
|
+
|
32
|
+
switch (answer.toLowerCase()) {
|
33
|
+
case "major":
|
34
|
+
newVersion = `${major + 1}.0.0`
|
35
|
+
break
|
36
|
+
case "minor":
|
37
|
+
newVersion = `${major}.${minor + 1}.0`
|
38
|
+
break
|
39
|
+
case "patch":
|
40
|
+
newVersion = `${major}.${minor}.${patch + 1}`
|
41
|
+
break
|
42
|
+
default:
|
43
|
+
console.error("Opción no válida. Usa: major, minor o patch.")
|
44
|
+
rl.close()
|
45
|
+
process.exit(1)
|
46
|
+
}
|
47
|
+
|
48
|
+
// Actualiza el archivo package.json
|
49
|
+
packageJson.version = newVersion
|
50
|
+
fs.writeFileSync(
|
51
|
+
packagePath,
|
52
|
+
JSON.stringify(packageJson, null, 2),
|
53
|
+
"utf8"
|
54
|
+
)
|
55
|
+
|
56
|
+
console.log(
|
57
|
+
`Versión actualizada: ${packageJson.version} -> ${newVersion}`
|
58
|
+
)
|
59
|
+
rl.close()
|
60
|
+
}
|
61
|
+
)
|
62
|
+
} catch (error) {
|
63
|
+
console.error(`Error: ${error.message}`)
|
64
|
+
process.exit(1)
|
65
|
+
}
|