Skip to content

Commit

Permalink
feat: add Rust function template (#3463)
Browse files Browse the repository at this point in the history
* feat: add Rust function template

* refactor: rename Rust template directory

* refactor: use correct directory name

* chore: amend comment

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
eduardoboucas and kodiakhq[bot] authored Oct 11, 2021
1 parent 76a9aa6 commit adae111
Show file tree
Hide file tree
Showing 6 changed files with 765 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/commands/functions/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ const { readRepoURL, validateRepoURL } = require('../../utils/read-repo-url')
const templatesDir = path.resolve(__dirname, '../../functions-templates')

const showGoTemplates = process.env.NETLIFY_EXPERIMENTAL_BUILD_GO_SOURCE === 'true'
const showRustTemplates = process.env.NETLIFY_EXPERIMENTAL_BUILD_RUST_SOURCE === 'true'

// Ensure that there's a sub-directory in `src/functions-templates` named after
// each `value` property in this list, and that it matches the extension of the
// files used by that language.
// each `value` property in this list.
const languages = [
{ name: 'JavaScript', value: 'javascript' },
{ name: 'TypeScript', value: 'typescript' },
showGoTemplates && { name: 'Go', value: 'go' },
showRustTemplates && { name: 'Rust', value: 'rust' },
]

/**
Expand Down
1 change: 1 addition & 0 deletions src/functions-templates/rust/hello-world/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
name: 'hello-world',
priority: 1,
description: 'Basic function that shows how to create a handler and return a response',
}
Loading

1 comment on commit adae111

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

Package size: 352 MB

Please sign in to comment.