@architect/create
Advanced tools
Comparing version 4.2.0-RC.0 to 4.2.0-RC.1
@@ -16,2 +16,8 @@ # Architect Create changelog | ||
### Fixed | ||
- Respect incoming `cwd` property, instead of relying solely on `process.cwd()` | ||
- Ensure transpiled and compiled handlers aren't (re)created when they haven't been compiled | ||
--- | ||
@@ -18,0 +24,0 @@ |
{ | ||
"name": "@architect/create", | ||
"version": "4.2.0-RC.0", | ||
"version": "4.2.0-RC.1", | ||
"description": "Idempotently initialize Architect projects", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
let { resolve, sep } = require('path') | ||
module.exports = function getProjectName (params) { | ||
let { name, folder } = params | ||
let { cwd, name, folder } = params | ||
if (!folder) folder = process.cwd() | ||
else folder = resolve(process.cwd(), folder) | ||
if (!folder) folder = cwd | ||
else folder = resolve(cwd, folder) | ||
@@ -9,0 +9,0 @@ if (!name) { |
@@ -32,2 +32,3 @@ let { sep } = require('path') | ||
if (!update) update = updater('Create') | ||
params.cwd = params.cwd || process.cwd() | ||
@@ -41,3 +42,3 @@ // Node version check for the `npm init @architect` path | ||
} | ||
// TODO: This blows up 12 if required in global; move this back after 12 is EOL | ||
// TODO: This blows up Node.js 12 running `npm init @architect` if required in global; move this back after 12 is EOL | ||
// eslint-disable-next-line | ||
@@ -44,0 +45,0 @@ let _inventory = require('@architect/inventory') |
let { join } = require('path') | ||
let { existsSync, mkdirSync, writeFileSync } = require('fs') | ||
let { existsSync, mkdirSync, readdirSync, writeFileSync } = require('fs') | ||
let getSupportedRuntimes = require('./supported-runtimes') | ||
@@ -28,4 +28,7 @@ | ||
let lambdaRuntime = config.runtimeAlias || config.runtime | ||
let runtimeType = config?.runtimeConfig?.type | ||
if (existsSync(handlerFile)) return | ||
if ((!runtimeType || runtimeType === 'interpreted') && existsSync(handlerFile)) return | ||
// Don't try to (re)create handlers because the handlerFile isn't there; that may just mean it hasn't been compiled yet | ||
else if (runtimeType !== 'interpreted' && existsSync(src) && readdirSync(src).length) return | ||
else if (skip) { | ||
@@ -32,0 +35,0 @@ update.status(`Ignoring @${pragma} ${name}, runtime not supported: ${createRuntime || projectRuntime}`) |
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
58882
1040