@code-engine/cli
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -49,3 +49,3 @@ "use strict"; | ||
if (partialBuild) { | ||
let message = `${changedFiles.length} files changed`; | ||
let message = `\n${changedFiles.length} files changed`; | ||
if (options.debug) { | ||
@@ -52,0 +52,0 @@ message += "\n " + changedFiles.map((file) => file.path).join("\n "); |
@@ -26,3 +26,3 @@ import { PluginDefinition } from "@code-engine/types"; | ||
* | ||
* Defaults to all files in the current directory. | ||
* Defaults to all files in the "./src/" directory. | ||
*/ | ||
@@ -29,0 +29,0 @@ source?: PluginDefinition | PluginDefinition[]; |
@@ -5,2 +5,3 @@ "use strict"; | ||
const validate_1 = require("@code-engine/validate"); | ||
const fs_1 = require("fs"); | ||
const ono_1 = require("ono"); | ||
@@ -34,4 +35,4 @@ const path_1 = require("path"); | ||
else if (!generator.source) { | ||
// Include all files in the CWD by default | ||
generator.source = "**/*"; | ||
// Include all files in "./src" by default | ||
generator.source = await resolveSource(cwd); | ||
} | ||
@@ -46,2 +47,16 @@ if (!generator.destination) { | ||
/** | ||
* Ensures that the "src" directory exists before defaulting to it. | ||
*/ | ||
async function resolveSource(cwd) { | ||
try { | ||
let src = path_1.resolve(cwd, "src"); | ||
let dir = await fs_1.promises.opendir(src); | ||
await dir.close(); | ||
} | ||
catch (error) { | ||
throw ono_1.ono(error, `No source was specified, and no "./src" directory was found.`); | ||
} | ||
return "./src/**/*"; | ||
} | ||
/** | ||
* Resolves the path of the specified CodeEngine generator | ||
@@ -48,0 +63,0 @@ */ |
{ | ||
"name": "@code-engine/cli", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "build tool | code generator | static site builder", | ||
@@ -82,7 +82,7 @@ "keywords": [ | ||
"dependencies": { | ||
"@code-engine/lib": "0.0.11", | ||
"@code-engine/utils": "0.0.12", | ||
"@code-engine/lib": "0.0.12", | ||
"@code-engine/utils": "0.0.14", | ||
"@code-engine/validate": "0.0.1", | ||
"code-engine-destination-filesystem": "0.0.4", | ||
"code-engine-source-filesystem": "0.0.3", | ||
"code-engine-destination-filesystem": "0.0.5", | ||
"code-engine-source-filesystem": "0.0.4", | ||
"command-line-args": "^5.1.1", | ||
@@ -89,0 +89,0 @@ "filesize": "^6.0.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
38525
637
1
+ Added@code-engine/lib@0.0.12(transitive)
+ Added@code-engine/utils@0.0.14(transitive)
+ Addedcode-engine-destination-filesystem@0.0.5(transitive)
+ Addedcode-engine-source-filesystem@0.0.4(transitive)
- Removed@code-engine/lib@0.0.11(transitive)
- Removed@code-engine/utils@0.0.5(transitive)
- Removedcode-engine-destination-filesystem@0.0.4(transitive)
- Removedcode-engine-source-filesystem@0.0.3(transitive)
Updated@code-engine/lib@0.0.12
Updated@code-engine/utils@0.0.14