-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add javascript for init-templates/app #2525
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
*.js | ||
*.js.map | ||
*.d.ts | ||
!lib/init-templates/app/javascript/**/* | ||
node_modules | ||
dist | ||
|
||
|
4 changes: 4 additions & 0 deletions
4
packages/aws-cdk/lib/init-templates/app/javascript/.template.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
|
||
# CDK asset staging directory | ||
.cdk.staging |
2 changes: 2 additions & 0 deletions
2
packages/aws-cdk/lib/init-templates/app/javascript/.template.npmignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# CDK asset staging directory | ||
.cdk.staging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Useful commands | ||
|
||
* `npm run test` check javascript error | ||
* `npm run test:watch` watch for changes and check javascript error | ||
* `cdk deploy` deploy this stack to your default AWS account/region | ||
* `cdk diff` compare deployed stack with current state | ||
* `cdk synth` emits the synthesized CloudFormation template |
9 changes: 9 additions & 0 deletions
9
packages/aws-cdk/lib/init-templates/app/javascript/bin/%name%.template.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env node | ||
|
||
// @ts-ignore: Cannot find declaration file | ||
require('source-map-support/register'); | ||
const cdk = require('@aws-cdk/cdk'); | ||
const { %name.PascalCased%Stack } = require('../lib/%name%-stack'); | ||
|
||
const app = new cdk.App(); | ||
new %name.PascalCased%Stack(app, '%name.PascalCased%Stack'); |
3 changes: 3 additions & 0 deletions
3
packages/aws-cdk/lib/init-templates/app/javascript/cdk.template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"app": "node bin/%name%.js" | ||
} |
17 changes: 17 additions & 0 deletions
17
packages/aws-cdk/lib/init-templates/app/javascript/lib/%name%-stack.template.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const cdk = require('@aws-cdk/cdk'); | ||
|
||
class %name.PascalCased%Stack extends cdk.Stack { | ||
/** | ||
* | ||
* @param {cdk.Construct} scope | ||
* @param {string} id | ||
* @param {cdk.StackProps=} props | ||
*/ | ||
constructor(scope, id, props) { | ||
super(scope, id, props); | ||
|
||
// The code that defines your stack goes here | ||
} | ||
} | ||
|
||
module.exports = { %name.PascalCased%Stack } |
21 changes: 21 additions & 0 deletions
21
packages/aws-cdk/lib/init-templates/app/javascript/package.template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "%name%", | ||
"version": "0.1.0", | ||
"bin": { | ||
"%name%": "bin/%name%.js" | ||
}, | ||
"scripts": { | ||
"test": "tsc", | ||
"test:watch": "tsc -w", | ||
"cdk": "cdk" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "8.10.45", | ||
"typescript": "^3.3.3333", | ||
"aws-cdk": "^%cdk-version%" | ||
}, | ||
"dependencies": { | ||
"@aws-cdk/cdk": "^%cdk-version%", | ||
"source-map-support": "^0.5.9" | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
packages/aws-cdk/lib/init-templates/app/javascript/tsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES2018", | ||
"module": "commonjs", | ||
"lib": [ | ||
"es2016", | ||
"es2017.object", | ||
"es2017.string" | ||
], | ||
"declaration": true, | ||
"strict": true, | ||
"noImplicitAny": true, | ||
"strictNullChecks": true, | ||
"noImplicitThis": true, | ||
"alwaysStrict": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noImplicitReturns": true, | ||
"noFallthroughCasesInSwitch": false, | ||
"inlineSourceMap": true, | ||
"inlineSources": true, | ||
"experimentalDecorators": true, | ||
"strictPropertyInitialization": false, | ||
"allowJs": true, | ||
"checkJs": true, | ||
"noEmit": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No
build
step required,tsc
is only for test.