@learnpack/learnpack 2.1.23 → 2.1.24
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 +10 -10
 - package/lib/commands/audit.js +15 -15
 - package/lib/commands/init.js +9 -3
 - package/oclif.manifest.json +1 -1
 - package/package.json +1 -1
 - package/src/commands/audit.ts +418 -418
 - package/src/commands/init.ts +170 -172
 
    
        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/2.1. 
     | 
| 
      
 24 
     | 
    
         
            +
            @learnpack/learnpack/2.1.24 win32-x64 node-v16.14.0
         
     | 
| 
       25 
25 
     | 
    
         
             
            $ learnpack --help [COMMAND]
         
     | 
| 
       26 
26 
     | 
    
         
             
            USAGE
         
     | 
| 
       27 
27 
     | 
    
         
             
              $ learnpack COMMAND
         
     | 
| 
         @@ -74,7 +74,7 @@ DESCRIPTION 
     | 
|
| 
       74 
74 
     | 
    
         
             
                   12. If there is a file within the exercises folder but not inside of any particular exercise's folder. (Warning)
         
     | 
| 
       75 
75 
     | 
    
         
             
            ```
         
     | 
| 
       76 
76 
     | 
    
         | 
| 
       77 
     | 
    
         
            -
            _See code: [src\commands\audit.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1. 
     | 
| 
      
 77 
     | 
    
         
            +
            _See code: [src\commands\audit.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.24/src\commands\audit.ts)_
         
     | 
| 
       78 
78 
     | 
    
         | 
| 
       79 
79 
     | 
    
         
             
            ## `learnpack clean`
         
     | 
| 
       80 
80 
     | 
    
         | 
| 
         @@ -89,7 +89,7 @@ DESCRIPTION 
     | 
|
| 
       89 
89 
     | 
    
         
             
                 Extra documentation goes here
         
     | 
| 
       90 
90 
     | 
    
         
             
            ```
         
     | 
| 
       91 
91 
     | 
    
         | 
| 
       92 
     | 
    
         
            -
            _See code: [src\commands\clean.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1. 
     | 
| 
      
 92 
     | 
    
         
            +
            _See code: [src\commands\clean.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.24/src\commands\clean.ts)_
         
     | 
| 
       93 
93 
     | 
    
         | 
| 
       94 
94 
     | 
    
         
             
            ## `learnpack download [PACKAGE]`
         
     | 
| 
       95 
95 
     | 
    
         | 
| 
         @@ -107,7 +107,7 @@ DESCRIPTION 
     | 
|
| 
       107 
107 
     | 
    
         
             
              Extra documentation goes here
         
     | 
| 
       108 
108 
     | 
    
         
             
            ```
         
     | 
| 
       109 
109 
     | 
    
         | 
| 
       110 
     | 
    
         
            -
            _See code: [src\commands\download.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1. 
     | 
| 
      
 110 
     | 
    
         
            +
            _See code: [src\commands\download.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.24/src\commands\download.ts)_
         
     | 
| 
       111 
111 
     | 
    
         | 
| 
       112 
112 
     | 
    
         
             
            ## `learnpack help [COMMAND]`
         
     | 
| 
       113 
113 
     | 
    
         | 
| 
         @@ -138,7 +138,7 @@ OPTIONS 
     | 
|
| 
       138 
138 
     | 
    
         
             
              -h, --grading  show CLI help
         
     | 
| 
       139 
139 
     | 
    
         
             
            ```
         
     | 
| 
       140 
140 
     | 
    
         | 
| 
       141 
     | 
    
         
            -
            _See code: [src\commands\init.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1. 
     | 
| 
      
 141 
     | 
    
         
            +
            _See code: [src\commands\init.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.24/src\commands\init.ts)_
         
     | 
| 
       142 
142 
     | 
    
         | 
| 
       143 
143 
     | 
    
         
             
            ## `learnpack login [PACKAGE]`
         
     | 
| 
       144 
144 
     | 
    
         | 
| 
         @@ -156,7 +156,7 @@ DESCRIPTION 
     | 
|
| 
       156 
156 
     | 
    
         
             
                 Extra documentation goes here
         
     | 
| 
       157 
157 
     | 
    
         
             
            ```
         
     | 
| 
       158 
158 
     | 
    
         | 
| 
       159 
     | 
    
         
            -
            _See code: [src\commands\login.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1. 
     | 
| 
      
 159 
     | 
    
         
            +
            _See code: [src\commands\login.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.24/src\commands\login.ts)_
         
     | 
| 
       160 
160 
     | 
    
         | 
| 
       161 
161 
     | 
    
         
             
            ## `learnpack logout [PACKAGE]`
         
     | 
| 
       162 
162 
     | 
    
         | 
| 
         @@ -174,7 +174,7 @@ DESCRIPTION 
     | 
|
| 
       174 
174 
     | 
    
         
             
                 Extra documentation goes here
         
     | 
| 
       175 
175 
     | 
    
         
             
            ```
         
     | 
| 
       176 
176 
     | 
    
         | 
| 
       177 
     | 
    
         
            -
            _See code: [src\commands\logout.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1. 
     | 
| 
      
 177 
     | 
    
         
            +
            _See code: [src\commands\logout.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.24/src\commands\logout.ts)_
         
     | 
| 
       178 
178 
     | 
    
         | 
| 
       179 
179 
     | 
    
         
             
            ## `learnpack plugins`
         
     | 
| 
       180 
180 
     | 
    
         | 
| 
         @@ -309,7 +309,7 @@ DESCRIPTION 
     | 
|
| 
       309 
309 
     | 
    
         
             
                 Extra documentation goes here
         
     | 
| 
       310 
310 
     | 
    
         
             
            ```
         
     | 
| 
       311 
311 
     | 
    
         | 
| 
       312 
     | 
    
         
            -
            _See code: [src\commands\publish.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1. 
     | 
| 
      
 312 
     | 
    
         
            +
            _See code: [src\commands\publish.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.24/src\commands\publish.ts)_
         
     | 
| 
       313 
313 
     | 
    
         | 
| 
       314 
314 
     | 
    
         
             
            ## `learnpack start`
         
     | 
| 
       315 
315 
     | 
    
         | 
| 
         @@ -330,7 +330,7 @@ OPTIONS 
     | 
|
| 
       330 
330 
     | 
    
         
             
              -w, --watch                         Watch for file changes
         
     | 
| 
       331 
331 
     | 
    
         
             
            ```
         
     | 
| 
       332 
332 
     | 
    
         | 
| 
       333 
     | 
    
         
            -
            _See code: [src\commands\start.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1. 
     | 
| 
      
 333 
     | 
    
         
            +
            _See code: [src\commands\start.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.24/src\commands\start.ts)_
         
     | 
| 
       334 
334 
     | 
    
         | 
| 
       335 
335 
     | 
    
         
             
            ## `learnpack test [EXERCISESLUG]`
         
     | 
| 
       336 
336 
     | 
    
         | 
| 
         @@ -344,5 +344,5 @@ ARGUMENTS 
     | 
|
| 
       344 
344 
     | 
    
         
             
              EXERCISESLUG  The name of the exercise to test
         
     | 
| 
       345 
345 
     | 
    
         
             
            ```
         
     | 
| 
       346 
346 
     | 
    
         | 
| 
       347 
     | 
    
         
            -
            _See code: [src\commands\test.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1. 
     | 
| 
      
 347 
     | 
    
         
            +
            _See code: [src\commands\test.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.24/src\commands\test.ts)_
         
     | 
| 
       348 
348 
     | 
    
         
             
            <!-- commandsstop -->
         
     | 
    
        package/lib/commands/audit.js
    CHANGED
    
    | 
         @@ -295,21 +295,21 @@ class AuditCommand extends SessionCommand_1.default { 
     | 
|
| 
       295 
295 
     | 
    
         
             
                    }
         
     | 
| 
       296 
296 
     | 
    
         
             
                }
         
     | 
| 
       297 
297 
     | 
    
         
             
            }
         
     | 
| 
       298 
     | 
    
         
            -
            AuditCommand.description = `learnpack audit is the command in charge of creating an auditory of the repository
         
     | 
| 
       299 
     | 
    
         
            -
            ...
         
     | 
| 
       300 
     | 
    
         
            -
            learnpack audit checks for the following information in a repository:
         
     | 
| 
       301 
     | 
    
         
            -
                1. The configuration object has slug, repository and description. (Error)
         
     | 
| 
       302 
     | 
    
         
            -
                2. The command learnpack clean has been run. (Error)
         
     | 
| 
       303 
     | 
    
         
            -
                3. If a markdown or test file doesn't have any content. (Error)
         
     | 
| 
       304 
     | 
    
         
            -
                4. The links are accessing to valid servers. (Error)
         
     | 
| 
       305 
     | 
    
         
            -
                5. The relative images are working (If they have the shortest path to the image or if the images exists in the assets). (Error)
         
     | 
| 
       306 
     | 
    
         
            -
                6. The external images are working (If they are pointing to a valid server). (Error)
         
     | 
| 
       307 
     | 
    
         
            -
                7. The exercises directory names are valid. (Error)
         
     | 
| 
       308 
     | 
    
         
            -
                8. If an exercise doesn't have a README file. (Error)
         
     | 
| 
       309 
     | 
    
         
            -
                9. The exercises array (Of the config file) has content. (Error)
         
     | 
| 
       310 
     | 
    
         
            -
                10. The exercses have the same translations. (Warning)
         
     | 
| 
       311 
     | 
    
         
            -
                11. The .gitignore file exists. (Warning)
         
     | 
| 
       312 
     | 
    
         
            -
                12. If there is a file within the exercises folder but not inside of any particular exercise's folder. (Warning)
         
     | 
| 
      
 298 
     | 
    
         
            +
            AuditCommand.description = `learnpack audit is the command in charge of creating an auditory of the repository
         
     | 
| 
      
 299 
     | 
    
         
            +
            ...
         
     | 
| 
      
 300 
     | 
    
         
            +
            learnpack audit checks for the following information in a repository:
         
     | 
| 
      
 301 
     | 
    
         
            +
                1. The configuration object has slug, repository and description. (Error)
         
     | 
| 
      
 302 
     | 
    
         
            +
                2. The command learnpack clean has been run. (Error)
         
     | 
| 
      
 303 
     | 
    
         
            +
                3. If a markdown or test file doesn't have any content. (Error)
         
     | 
| 
      
 304 
     | 
    
         
            +
                4. The links are accessing to valid servers. (Error)
         
     | 
| 
      
 305 
     | 
    
         
            +
                5. The relative images are working (If they have the shortest path to the image or if the images exists in the assets). (Error)
         
     | 
| 
      
 306 
     | 
    
         
            +
                6. The external images are working (If they are pointing to a valid server). (Error)
         
     | 
| 
      
 307 
     | 
    
         
            +
                7. The exercises directory names are valid. (Error)
         
     | 
| 
      
 308 
     | 
    
         
            +
                8. If an exercise doesn't have a README file. (Error)
         
     | 
| 
      
 309 
     | 
    
         
            +
                9. The exercises array (Of the config file) has content. (Error)
         
     | 
| 
      
 310 
     | 
    
         
            +
                10. The exercses have the same translations. (Warning)
         
     | 
| 
      
 311 
     | 
    
         
            +
                11. The .gitignore file exists. (Warning)
         
     | 
| 
      
 312 
     | 
    
         
            +
                12. If there is a file within the exercises folder but not inside of any particular exercise's folder. (Warning)
         
     | 
| 
       313 
313 
     | 
    
         
             
            `;
         
     | 
| 
       314 
314 
     | 
    
         
             
            AuditCommand.flags = {
         
     | 
| 
       315 
315 
     | 
    
         
             
            // name: flags.string({char: 'n', description: 'name to print'}),
         
     | 
    
        package/lib/commands/init.js
    CHANGED
    
    | 
         @@ -9,7 +9,6 @@ const cli_ux_1 = require("cli-ux"); 
     | 
|
| 
       9 
9 
     | 
    
         
             
            const eta = require("eta");
         
     | 
| 
       10 
10 
     | 
    
         
             
            const console_1 = require("../utils/console");
         
     | 
| 
       11 
11 
     | 
    
         
             
            const errors_1 = require("../utils/errors");
         
     | 
| 
       12 
     | 
    
         
            -
            const defaults_1 = require("../managers/config/defaults");
         
     | 
| 
       13 
12 
     | 
    
         
             
            const path = require("path");
         
     | 
| 
       14 
13 
     | 
    
         
             
            class InitComand extends BaseCommand_1.default {
         
     | 
| 
       15 
14 
     | 
    
         
             
                async run() {
         
     | 
| 
         @@ -70,10 +69,17 @@ class InitComand extends BaseCommand_1.default { 
     | 
|
| 
       70 
69 
     | 
    
         
             
                            },
         
     | 
| 
       71 
70 
     | 
    
         
             
                        },
         
     | 
| 
       72 
71 
     | 
    
         
             
                    ]);
         
     | 
| 
       73 
     | 
    
         
            -
                    const packageInfo =  
     | 
| 
      
 72 
     | 
    
         
            +
                    const packageInfo = {
         
     | 
| 
      
 73 
     | 
    
         
            +
                        grading: choices.grading,
         
     | 
| 
      
 74 
     | 
    
         
            +
                        difficulty: choices.difficulty,
         
     | 
| 
      
 75 
     | 
    
         
            +
                        duration: parseInt(choices.duration),
         
     | 
| 
      
 76 
     | 
    
         
            +
                        description: choices.description,
         
     | 
| 
      
 77 
     | 
    
         
            +
                        title: choices.title,
         
     | 
| 
      
 78 
     | 
    
         
            +
                        slug: choices.title
         
     | 
| 
       74 
79 
     | 
    
         
             
                            .toLowerCase()
         
     | 
| 
       75 
80 
     | 
    
         
             
                            .replace(/ /g, "-")
         
     | 
| 
       76 
     | 
    
         
            -
                            .replace(/[^\w-]+/g, "") 
     | 
| 
      
 81 
     | 
    
         
            +
                            .replace(/[^\w-]+/g, ""),
         
     | 
| 
      
 82 
     | 
    
         
            +
                    };
         
     | 
| 
       77 
83 
     | 
    
         
             
                    cli_ux_1.default.action.start("Initializing package");
         
     | 
| 
       78 
84 
     | 
    
         
             
                    const languages = ["en", "es"];
         
     | 
| 
       79 
85 
     | 
    
         
             
                    const templatesDir = path.resolve(__dirname, "../../src/utils/templates/" + choices.grading || "no-grading");
         
     | 
    
        package/oclif.manifest.json
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":"2.1. 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":"2.1.24","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":"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}]},"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":"[standalone, gitpod]","options":["standalone","gitpod"]},"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}]}}}
         
     | 
    
        package/package.json
    CHANGED