Socket
Socket
Sign inDemoInstall

@architect/create

Package Overview
Dependencies
Maintainers
5
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.1 to 1.3.2-RC.0

13

changelog.md

@@ -5,2 +5,15 @@ # Architect Create changelog

## [1.3.2] 2020-12-02
### Added
- Add support for custom templates in paths outside the project directory (e.g. `~/tmpl/http.js`, `../../tmpl/http.js`)
### Fixed
- Fixed potential for empty files to be written to disk during initialization should a template not be found
---
## [1.3.1] 2020-11-30

@@ -7,0 +20,0 @@

5

package.json
{
"name": "@architect/create",
"version": "1.3.1",
"version": "1.3.2-RC.0",
"description": "Idempotently initialize Architect projects",

@@ -28,3 +28,4 @@ "main": "src/index.js",

"chalk": "~4.1.0",
"run-parallel": "~1.1.10"
"run-parallel": "~1.1.10",
"run-series": "~1.1.9"
},

@@ -31,0 +32,0 @@ "devDependencies": {

22

src/lambda/index.js
let { existsSync, mkdirSync } = require('fs')
let { join } = require('path')
let parallel = require('run-parallel')
let series = require('run-series')
let getExtension = require('./get-extension')

@@ -27,10 +27,4 @@ let writeArcConfig = require('./write-arc-config')

parallel({
config (callback) {
writeArcConfig({
configPath: join(src, `config.arc`),
runtime
}, callback)
},
code (callback) {
series([
function code (callback) {
let templates = prefs && prefs.create && prefs.create.templates

@@ -51,4 +45,10 @@ let template = templates && templates[type]

}
}
}, function done (err) {
},
function config (callback) {
writeArcConfig({
configPath: join(src, `config.arc`),
runtime
}, callback)
},
], function done (err) {
if (err) callback(err)

@@ -55,0 +55,0 @@ else callback(null, src)

let { existsSync, readFileSync, writeFile } = require('fs')
let { join, resolve } = require('path')
let { homedir } = require('os')
module.exports = function writeTemplate ({ handlerFile, template }, callback) {
if (!existsSync(template)) {
let path = template[0] === '~' ? join(homedir(), template.substr(1)) : resolve(template)
if (!existsSync(path)) {
throw Error(`Custom function template not found: ${template}`)
}
let body = readFileSync(template).toString()
let body = readFileSync(path).toString()
writeFile(handlerFile, body, callback)
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc