@dealmore/terraform-next-build
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -31,2 +31,3 @@ "use strict"; | ||
const archiver_1 = __importDefault(require("archiver")); | ||
const util = __importStar(require("util")); | ||
function getFiles(basePath) { | ||
@@ -88,5 +89,5 @@ return build_utils_1.glob('**', { | ||
} | ||
async function buildCommand({ skipDownload = false } = {}) { | ||
async function buildCommand({ skipDownload = false, logLevel, deleteBuildCache = true, cwd, }) { | ||
let buildOutput = null; | ||
const mode = skipDownload ? 'local' : 'download'; | ||
const cwd = process.cwd(); | ||
// On download create a tmp dir where the files can be downloaded | ||
@@ -127,3 +128,3 @@ const tmpDir = mode === 'download' ? tmp_1.default.dirSync() : null; | ||
} | ||
await writeOutput({ | ||
buildOutput = { | ||
buildId, | ||
@@ -134,6 +135,11 @@ routes: buildResult.routes, | ||
outputDir: outputDir, | ||
}); | ||
console.log('buildResult:', buildResult); | ||
}; | ||
await writeOutput(buildOutput); | ||
if (logLevel === 'verbose') { | ||
console.log(util.format('Routes:\n%s', JSON.stringify(buildResult.routes, null, 2))); | ||
} | ||
console.log('Build successful!'); | ||
} | ||
catch (err) { | ||
console.log('Build failed:'); | ||
console.error(err); | ||
@@ -144,7 +150,8 @@ // If an error occurs make the task fail | ||
// Cleanup tmpDir | ||
if (tmpDir) { | ||
if (tmpDir && deleteBuildCache) { | ||
fs.emptyDirSync(tmpDir.name); | ||
tmpDir.removeCallback(); | ||
} | ||
return buildOutput; | ||
} | ||
exports.default = buildCommand; |
@@ -28,9 +28,17 @@ "use strict"; | ||
.command('build', 'Build the next.js project', (yargs_) => { | ||
return yargs_.option('skipDownload', { | ||
return yargs_ | ||
.option('skipDownload', { | ||
type: 'boolean', | ||
description: 'Runs the build in the current working directory', | ||
}) | ||
.option('verbose', { | ||
type: 'boolean', | ||
description: 'Run with verbose logging', | ||
}); | ||
}, async ({ skipDownload }) => { | ||
}, async ({ skipDownload, verbose }) => { | ||
const cwd = process.cwd(); | ||
(await Promise.resolve().then(() => __importStar(require('./commands/build')))).default({ | ||
skipDownload, | ||
logLevel: verbose ? 'verbose' : 'none', | ||
cwd, | ||
}); | ||
@@ -37,0 +45,0 @@ }) |
{ | ||
"name": "@dealmore/terraform-next-build", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"main": "index.js", | ||
@@ -20,3 +20,3 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@dealmore/next-tf": "2.6.10", | ||
"@dealmore/next-tf": "2.6.19", | ||
"@vercel/build-utils": "^2.4.0", | ||
@@ -23,0 +23,0 @@ "@vercel/frameworks": "^0.0.15", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22093
253
+ Added@dealmore/next-tf@2.6.19(transitive)
- Removed@dealmore/next-tf@2.6.10(transitive)
Updated@dealmore/next-tf@2.6.19