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.0-RC.2 to 1.3.0-RC.3

src/lambda/write-template.js

8

changelog.md

@@ -10,2 +10,10 @@ # Architect Create changelog

- Added support for custom file paths
- Added support for custom default templates, thanks @Ankcorn!
- Add per-pragma custom templates via the Arc preferences file, example:
```arc
# preferences.arc or prefs.arc
@create
templates
http path/to/template/file
```

@@ -12,0 +20,0 @@

2

package.json
{
"name": "@architect/create",
"version": "1.3.0-RC.2",
"version": "1.3.0-RC.3",
"description": "Idempotently initialize Architect projects",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -44,2 +44,3 @@ let { updater } = require('@architect/utils')

let { inv } = await inventory({ cwd: folder })
let prefs = inv._project.preferences
let { http, events, queues, scheduled, static, streams, ws } = inv

@@ -65,3 +66,3 @@

lambdae.forEach(type => {
binder[type] = fn => code.bind({}, { ...fn, type, runtime })
binder[type] = fn => code.bind({}, { ...fn, type, runtime, prefs })
})

@@ -68,0 +69,0 @@

@@ -6,2 +6,3 @@ let { existsSync, mkdirSync } = require('fs')

let writeArcConfig = require('./write-arc-config')
let writeTemplate = require('./write-template')
let writeCode = require('./write-code')

@@ -17,3 +18,3 @@

module.exports = function code (params, callback) {
let { arcStaticAssetProxy, src, type, runtime } = params
let { arcStaticAssetProxy, src, type, runtime, prefs } = params

@@ -36,7 +37,17 @@ // Immediate bail if source dir already exists

code (callback) {
writeCode({
type,
runtime,
handlerFile
}, callback)
let templates = prefs && prefs.create && prefs.create.templates
let template = templates && templates[type]
if (template) {
writeTemplate({
template,
handlerFile
}, callback)
}
else {
writeCode({
type,
runtime,
handlerFile
}, callback)
}
}

@@ -43,0 +54,0 @@ }, function done (err) {

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