├── .eslintignore ├── devcontainer.json ├── .vscode └── settings.json ├── prettier.config.js ├── .github ├── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── main.yml ├── src ├── template.ts └── main.ts ├── .eslintrc.js ├── tsconfig.json ├── LICENSE ├── package.json ├── .gitignore └── README.md /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "serverless-dart", 3 | "image": "mcr.microsoft.com/vscode/devcontainers/javascript-node:latest", 4 | "extensions": [] 5 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.codeActionsOnSave": { 3 | "source.fixAll": true 4 | }, 5 | "search.exclude": { 6 | "**/node_modules": true, 7 | "**/bower_components": true, 8 | "dist/**/*": true 9 | } 10 | } -------------------------------------------------------------------------------- /prettier.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | printWidth: 80, 3 | tabWidth: 2, 4 | useTabs: false, 5 | singleQuote: true, 6 | semi: false, 7 | trailingComma: 'none', 8 | bracketSpacing: true, 9 | arrowParens: 'avoid', 10 | parser: 'typescript' 11 | } 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 💡 3 | about: Suggest a new idea for serverless-rust 4 | --- 5 | 6 | 7 | 8 | ## 💡 Feature description 9 | 10 | 11 | #### 💻 Basic example 12 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 4 | 5 | ## What did you implement: 6 | 7 | 10 | 11 | Closes: #xxx 12 | 13 | #### How did you verify your change: 14 | 15 | #### What (if anything) would need to be called out in the CHANGELOG for the next release: -------------------------------------------------------------------------------- /src/template.ts: -------------------------------------------------------------------------------- 1 | function template(strings: any, ...keys: any) { 2 | return function (...values: any) { 3 | const dict = values[values.length - 1] || {} 4 | const result = [strings[0]] 5 | keys.forEach(function (key: any, i: number) { 6 | const value = Number.isInteger(key) ? values[key] : dict[key] 7 | result.push(value, strings[i + 1]) 8 | }) 9 | return result.join('') 10 | } 11 | } 12 | 13 | export const buildSteps = template`cd $(mktemp -d); cp -Rp /app/* .; /usr/lib/dart/bin/pub get; /usr/lib/dart/bin/dart compile exe ${'libPath'}/${'script'}.dart -o bootstrap; mv bootstrap /target/${'script'};` 14 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 🐛 3 | about: Did something not work as expected? 4 | --- 5 | 6 | 7 | 8 | ## 🐛 Bug description 9 | Describe your issue in detail. 10 | 11 | #### 🤔 Expected Behavior 12 | 13 | 14 | #### 👟 Steps to reproduce 15 | 16 | 17 | #### 🌍 Your environment 18 | 19 | 20 | serverless version: 21 | 22 | rust-plugin version: 23 | 24 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | parser: '@typescript-eslint/parser', 3 | extends: [ 4 | 'plugin:@typescript-eslint/recommended', 5 | 'prettier/@typescript-eslint', 6 | 'plugin:prettier/recommended' 7 | ], 8 | settings: { 9 | react: { 10 | version: 'detect' // Tells eslint-plugin-react to automatically detect the version of React to use 11 | } 12 | }, 13 | globals: { 14 | Atomics: 'readonly', 15 | SharedArrayBuffer: 'readonly' 16 | }, 17 | parserOptions: { 18 | ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features 19 | sourceType: 'module', // Allows for the use of imports 20 | ecmaFeatures: { 21 | jsx: true // Allows for the parsing of JSX 22 | } 23 | }, 24 | rules: {} 25 | } 26 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Main 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | tags: 8 | - 'v**' 9 | pull_request: 10 | branches: 11 | - main 12 | jobs: 13 | test: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Checkout 17 | uses: actions/checkout@v2 18 | - name: Install 19 | run: npm ci 20 | - name: Lint 21 | run: npm run lint 22 | publish: 23 | needs: [test] 24 | runs-on: ubuntu-latest 25 | steps: 26 | - name: Checkout 27 | uses: actions/checkout@v2 28 | - name: Install 29 | run: npm ci 30 | - name: Build 31 | run: npm run build 32 | - name: Publish 33 | if: startsWith(github.ref, 'refs/tags/') 34 | run: | 35 | npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN 36 | npm publish 37 | env: 38 | CI: true 39 | NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} 40 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ 4 | "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ 5 | "outDir": "./lib", /* Redirect output structure to the directory. */ 6 | "rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 7 | "strict": true, /* Enable all strict type-checking options. */ 8 | "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ 9 | "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 10 | }, 11 | "exclude": [ 12 | "node_modules", 13 | "**/*.test.ts" 14 | ] 15 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Sebastian Doell 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "serverless-dart", 3 | "version": "0.0.2-beta.9", 4 | "description": "Serverless framework plugin for Dart applications", 5 | "main": "lib/main.js", 6 | "scripts": { 7 | "build": "tsc", 8 | "lint": "npx eslint --fix", 9 | "watch": "tsc -w" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "git+https://github.com/katallaxie/serverless-dart.git" 14 | }, 15 | "keywords": [ 16 | "dart", 17 | "aws", 18 | "serverless", 19 | "lambda" 20 | ], 21 | "author": { 22 | "email": "sebastian@katallaxie.me", 23 | "name": "Sebastian Doell" 24 | }, 25 | "license": "MIT", 26 | "bugs": { 27 | "url": "https://github.com/katallaxie/serverless-dart/issues" 28 | }, 29 | "homepage": "https://github.com/katallaxie/serverless-dart#readme", 30 | "dependencies": { 31 | "fs-copy-file-sync": "^1.1.1", 32 | "fs-extra": "^9.1.0", 33 | "serverless": "^2.25.1", 34 | "yazl": "^2.5.1" 35 | }, 36 | "devDependencies": { 37 | "@types/jest": "^26.0.20", 38 | "@types/node": "^14.14.28", 39 | "@types/serverless": "^1.78.20", 40 | "@types/yazl": "^2.4.2", 41 | "@typescript-eslint/eslint-plugin": "^4.15.1", 42 | "@typescript-eslint/parser": "^4.15.1", 43 | "eslint": "^7.20.0", 44 | "eslint-config-prettier": "^7.2.0", 45 | "eslint-plugin-github": "^4.1.1", 46 | "eslint-plugin-jest": "^24.1.5", 47 | "eslint-plugin-prettier": "^3.3.1", 48 | "jest": "^26.6.3", 49 | "jest-circus": "^26.6.3", 50 | "prettier": "^2.2.1", 51 | "ts-jest": "^26.5.1", 52 | "typescript": "^4.1.5" 53 | }, 54 | "files": [ 55 | "lib/main.js", 56 | "lib/template.js", 57 | "package.json", 58 | "README.md" 59 | ] 60 | } 61 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Dependency directory 2 | node_modules 3 | 4 | # Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore 5 | # Logs 6 | logs 7 | *.log 8 | npm-debug.log* 9 | yarn-debug.log* 10 | yarn-error.log* 11 | lerna-debug.log* 12 | 13 | # Diagnostic reports (https://nodejs.org/api/report.html) 14 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 15 | 16 | # Runtime data 17 | pids 18 | *.pid 19 | *.seed 20 | *.pid.lock 21 | 22 | # Directory for instrumented libs generated by jscoverage/JSCover 23 | lib-cov 24 | 25 | # Coverage directory used by tools like istanbul 26 | coverage 27 | *.lcov 28 | 29 | # nyc test coverage 30 | .nyc_output 31 | 32 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 33 | .grunt 34 | 35 | # Bower dependency directory (https://bower.io/) 36 | bower_components 37 | 38 | # node-waf configuration 39 | .lock-wscript 40 | 41 | # Compiled binary addons (https://nodejs.org/api/addons.html) 42 | build/Release 43 | 44 | # Dependency directories 45 | jspm_packages/ 46 | 47 | # TypeScript v1 declaration files 48 | typings/ 49 | 50 | # TypeScript cache 51 | *.tsbuildinfo 52 | 53 | # Optional npm cache directory 54 | .npm 55 | 56 | # Optional eslint cache 57 | .eslintcache 58 | 59 | # Optional REPL history 60 | .node_repl_history 61 | 62 | # Output of 'npm pack' 63 | *.tgz 64 | 65 | # Yarn Integrity file 66 | .yarn-integrity 67 | 68 | # dotenv environment variables file 69 | .env 70 | .env.test 71 | 72 | # parcel-bundler cache (https://parceljs.org/) 73 | .cache 74 | 75 | # next.js build output 76 | .next 77 | 78 | # nuxt.js build output 79 | .nuxt 80 | 81 | # vuepress build output 82 | .vuepress/dist 83 | 84 | # Serverless directories 85 | .serverless/ 86 | 87 | # FuseBox cache 88 | .fusebox/ 89 | 90 | # DynamoDB Local files 91 | .dynamodb/ 92 | 93 | # OS metadata 94 | .DS_Store 95 | Thumbs.db 96 | 97 | # Ignore built ts files 98 | __tests__/runner/* 99 | lib/**/* 100 | 101 | # Intellij IDEA metadata 102 | .idea/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
10 | A ⚡ Serverless framework ⚡ plugin for Dart applications 11 |
12 | 13 | 21 | 22 |