Skip to content

Commit 74f059b

Browse files
authored
shell improve (#9)
* minor changes on npm script * add DEVGUIDE * changes on quick install * docs improve * shell improve * add .gitkeep
1 parent b66d5a9 commit 74f059b

File tree

12 files changed

+54
-80
lines changed

12 files changed

+54
-80
lines changed

.npmignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
**/node_modules
2+
**/.aws-sam
3+
**/.cache
4+
**/coverage
5+
package-lock.json
6+
.DS_Store

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*.yaml
22
*.yml
33
*.json
4-
*.md
4+
*.md
5+
jest.config.ts

DEVGUIDE.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ install `awscliv2`, `aws-sam-cli`, `nodejs 18` (and `make` only for macOS and Li
55
To build and deploy your application for the first time, run the following commands in your shell using `makefile` (only for macOS and Linux):
66

77
```bash
8-
make i
8+
make install
99
make build
1010
make deploy
11+
12+
# to delete the deployment
13+
make destroy
1114
```
1215

1316
The second command will build the source of your application. The 3rd command will package and deploy your application to AWS, with a series of prompts:

Makefile

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
.PHONY: build build_cloudformation build_typescript clean clean_cache clean_dist clean_modules clean_tmp deploy deployci deploy_cloudformation destroy destroy_cloudformation lint lintfix
22

3-
#### input params
3+
#### input params for aws cloud
4+
#### Please change the value as required like region, stack & profile
5+
46
debug = debug
57
maintenance = false
68
region = eu-central-1
7-
stack = typescript-aws-lambda-serverless-restapi-kit # decide a stack-name for the app
9+
stack = typescript-lambda-backend-app # decide a <stack-name> for the app
810
stage = v1
9-
substage = sazal # x/developer-name
11+
substage = sazal # add x/<DeveloperName>
1012
tests = unit
1113
####
1214

1315
#### cloud params
14-
profile = sazal-dev
16+
profile = sazal-dev # add the name of aws cli configured profile
1517
stackname = ${stack}
1618
####
1719

1820

21+
1922
#### info
2023
help:
2124
@echo ""
@@ -40,10 +43,12 @@ help:
4043
@echo "- lint: lints service."
4144
@echo "- lintfix: lint fix service."
4245
@echo ""
46+
@echo "- test: for testing all the features by jest."
47+
@echo ""
4348
####
4449

4550
#### validate
46-
i:
51+
install:
4752
@npm i
4853

4954
#### validate
@@ -65,7 +70,7 @@ build_typescript:
6570

6671

6772
#### clean
68-
clean: clean_cache clean_dist clean_modules clean_tmp
73+
clean: clean_cache clean_dist clean_modules clean_coverage clean_tmp
6974

7075
clean_cache:
7176
@rm -rf .cache
@@ -76,6 +81,9 @@ clean_dist:
7681
clean_modules:
7782
# @rm -rf node_modules
7883

84+
clean_coverage:
85+
@rm -rf coverage
86+
7987
clean_tmp:
8088
@rm -rf .tmp
8189
####
@@ -122,3 +130,9 @@ lint:
122130
lintfix:
123131
@npx --no-install prettier --write '{src,__tests__}/**/*.{js,ts}'
124132
####
133+
134+
#### Test
135+
test:
136+
@npm run test
137+
138+
####

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,22 @@ install `awscliv2`, `aws-sam-cli`, `nodejs 18` (and `make` only for macOS and Li
5151
To build and deploy your application for the first time, run the following commands in your shell using `makefile` (only for macOS and Linux):
5252

5353
```bash
54-
make i
54+
make install
5555
make build
56+
```
57+
58+
Before deployment, open the `Makefile` and add your AWS-configured profile name at the `profile` variable.
59+
60+
Wait, you may try this command on your terminal to check what is the name of your aws-configured profile:
61+
62+
```bash
63+
aws configure list-profiles
64+
```
65+
66+
#### Let's make it live:
67+
68+
```bash
5669
make deploy
57-
make destroy
5870
```
5971

6072
The 2nd command will build the source of your application. The 3rd command will package and deploy your application to AWS, with a series of prompts:

__tests__/unit/handlers/.gitkeep

Whitespace-only changes.

__tests__/unit/handlers/test-handler.test.ts

Lines changed: 0 additions & 64 deletions
This file was deleted.

bin/install.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,13 @@ async function main() {
5353

5454
fs.unlinkSync(path.join(projectPath, 'bin', 'install.js'));
5555
fs.rmSync(path.join(projectPath, 'bin'), { recursive: true });
56+
fs.unlinkSync(path.join(projectPath, 'events', 'sample-event.json'));
57+
fs.unlinkSync(path.join(projectPath, '.npmignore'));
5658

5759
// end notes
5860
console.log('\n');
5961
console.log('Installation is now complete!');
60-
console.log('This is ready to use.');
62+
console.log("You're ready to go...");
6163
console.log('\n');
6264
console.log('We suggest that you start by typing:');
6365
console.log(` cd ${projectName}`);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ts-lambda-kit",
3-
"version": "1.0.3-beta",
3+
"version": "1.0.4-beta",
44
"description": "aws lambda kit for making backend with NodeJS v18, TypeScript & SAM CLI",
55
"keywords": [
66
"ts-lambda-kit",

0 commit comments

Comments
 (0)