First, thank you for putting this plugin together, it will be very useful to our team! We are currently putting together a minimal "todo list" nx app with the serverless/sls plugin and have very few, if any, changes to the codebase after the setting up the default nx templates.
yarn create nx-workspace todo-list-app
? What to create in the new workspace react-express [a workspace with a full stack application (React + Express)]
? Application name todo-list-app
? Default stylesheet format CSS
yarn add -D @flowaccount/nx-serverless
nx generate @flowaccount/nx-serverless:application --name=sls-api --provider=aws --no-interactive
However, the build command is failing. To build:
Starting type checking service...
Using 2 workers with 2048MB memory limit
_______ __
| _ .-----.----.--.--.-----.----| .-----.-----.-----.
| |___| -__| _| | | -__| _| | -__|__ --|__ --|
|____ |_____|__| \___/|_____|__| |__|_____|_____|_____|
| | | The Serverless Application Framework
| | serverless.com, v1.65.0
-------'
Serverless {
providers: {},
version: '1.65.0',
yamlParser: YamlParser { serverless: [Circular] },
utils: Utils { serverless: [Circular] },
service: Service {
serverless: [Circular],
service: 'sls-api',
serviceObject: { name: 'sls-api' },
provider: {
stage: 'dev',
variableSyntax: '\\${([ ~:a-zA-Z0-9._@\'",\\-\\/\\(\\)*?]+?)}',
name: 'aws',
runtime: 'nodejs10.x'
},
custom: undefined,
plugins: [ 'serverless-offline' ],
pluginsData: {},
functions: { 'hello-world': [Object] },
resources: undefined,
package: {
individually: true,
path: undefined,
artifact: undefined,
exclude: undefined,
include: undefined,
excludeDevDependencies: false
},
serviceFilename: 'serverless.yml',
app: undefined,
tenant: undefined,
org: undefined,
layers: {},
outputs: undefined
},
variables: Variables {
serverless: [Circular],
service: Service {
serverless: [Circular],
service: 'sls-api',
serviceObject: [Object],
provider: [Object],
custom: undefined,
plugins: [Array],
pluginsData: {},
functions: [Object],
resources: undefined,
package: [Object],
serviceFilename: 'serverless.yml',
app: undefined,
tenant: undefined,
org: undefined,
layers: {},
outputs: undefined
},
tracker: PromiseTracker {
promiseList: [],
promiseMap: {},
startTime: 1583392410162,
reported: false
},
deep: [],
deepRefSyntax: /(\${)?deep:\d+(\.[^}]+)*()}?/,
overwriteSyntax: /\s*(?:,\s*)+/g,
fileRefSyntax: /^file\(([^?%*:|"<>]+?)\)/g,
slsRefSyntax: /^sls:/g,
envRefSyntax: /^env:/g,
optRefSyntax: /^opt:/g,
selfRefSyntax: /^self:/g,
stringRefSyntax: /(?:('|").*?\1)/g,
cfRefSyntax: /^(?:\${)?cf(\.[a-zA-Z0-9-]+)?:/g,
s3RefSyntax: /^(?:\${)?s3:(.+?)\/(.+)$/,
ssmRefSyntax: /^(?:\${)?ssm:([a-zA-Z0-9_.\-\/]+)[~]?(true|false|split)?/,
strToBoolRefSyntax: /^(?:\${)?strToBool\(([a-zA-Z0-9_.\-\/]+)\)/,
variableResolvers: [
[Object], [Object],
[Object], [Object],
[Object], [Object],
[Object], [Object],
[Object], [Object],
[Object]
]
},
pluginManager: PluginManager {
serverless: [Circular],
serverlessConfigFile: {
service: 'sls-api',
frameworkVersion: '>=1.1.0 <2.0.0',
plugins: [Array],
package: [Object],
provider: [Object],
functions: [Object]
},
cliOptions: {},
cliCommands: [ 'build', 'sls-api' ],
plugins: [],
commands: {},
aliases: {},
hooks: {},
deprecatedEvents: {}
},
cliInputArgv: [ 'build', 'sls-api' ],
config: Config {
serverless: [Circular],
serverlessPath: '/home/aidan/Development/contract-work-v2/brits/nrwl-nx-fullstack-aws-refarch/nrwl-fullstack-aws/node_modules/@flowaccount/nx-serverless/node_modules/serverless/lib',
config: 'apps/sls-api/serverless.yml',
servicePath: 'apps/sls-api'
},
classes: {
CLI: [Function: CLI],
YamlParser: [Function: YamlParser],
Utils: [Function: Utils],
Service: [Function: Service],
Variables: [Function: Variables],
Error: [Function: ServerlessError],
PluginManager: [Function: PluginManager]
},
serverlessDirPath: '/home/aidan/.serverless',
isStandaloneExecutable: false,
instanceId: '1583392410175',
cli: CLI {
serverless: [Circular],
inputArray: [ 'build', 'sls-api' ],
loadedPlugins: [],
loadedCommands: {}
},
processedInput: { commands: [ 'build', 'sls-api' ], options: {} }
}
Serverless: getting all functions
Serverless: getting all functions
Serverless: start compiling webpack
Starting type checking service...
Using 2 workers with 2048MB memory limit
10% building 0/0 modules 0 activeHash: 7d8923a6e6645c010676
Built at: 03/05/2020 2:13:32 AM
Entrypoint main = main.js main.js.map
chunk {main} main.js, main.js.map (main) 57 bytes [entry] [rendered]
$ nx build api
10% building 0/1 modules 1 active ...k-aws-refarch/nrwl-fullstack-aws/apps/sls-api/src/handler.tsStarting type checking service...
Using 2 workers with 2048MB memory limit
98% after emitting SizeLimitsPluginNo type errors found
Version: typescript 3.7.5
Time: 5865ms
Hash: 8b4284d681286107239b
Built at: 03/05/2020 2:13:36 AM
Entrypoint src/handler = src/handler.js
chunk {src/handler} src/handler.js (src/handler) 412 bytes [entry] [rendered]
[./apps/sls-api/src/handler.ts] 370 bytes {src/handler} [built]
factory:5811ms building:168ms = 5979ms
[tslib] external "tslib" 42 bytes {src/handler} [built]
[./apps/sls-api/src/handler.ts] 5979ms -> factory:1ms building:1ms = 5981ms
Starting type checking service...
Using 2 workers with 2048MB memory limit
Hash: 620d5e1c46307a6df8b9
Built at: 03/05/2020 2:13:50 AM
Entrypoint main [big] = runtime.js runtime.js.map vendor.js vendor.js.map main.js main.js.map
Entrypoint polyfills [big] = runtime.js runtime.js.map polyfills.js polyfills.js.map
Entrypoint styles = runtime.js runtime.js.map styles.js styles.js.map
chunk {main} main.js, main.js.map (main) 796 bytes ={runtime}= ={vendor}= [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 239 KiB ={runtime}= [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 0 bytes ={main}= ={polyfills}= ={styles}= ={vendor}= [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 7.75 KiB ={runtime}= [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 1.04 MiB ={main}= ={runtime}= [initial] [rendered] split chunk (cache group: vendor) (name: vendor)
Hash: 50a49816d67d4698582c
Built at: 03/05/2020 2:13:51 AM
Entrypoint main = main.js main.js.map
chunk {main} main.js, main.js.map (main) 423 bytes [entry] [rendered]