@candlerip/shared3 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/bash
2
+ set -e
3
+
4
+ if [[ $1 = 'deploy' ]]; then
5
+ cdk deploy --require-approval never
6
+
7
+ success=$?
8
+ if [ $success != 0 ]; then
9
+ exit $success
10
+ fi
11
+ if [ -f "./dist/post-deploy/index.js" ]; then
12
+ node ./dist/post-deploy/index.js
13
+ fi
14
+ if [ -f "./dist/bin/post-deploy/index.js" ]; then
15
+ node ./dist/bin/post-deploy/index.js
16
+ fi
17
+ fi
@@ -0,0 +1,2 @@
1
+ node_modules
2
+ .gitignore
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/bash
2
+
3
+ CURR_DIR=$(dirname $(realpath "$0"))
4
+
5
+ if [[ $1 = 'init' ]]; then
6
+ cp $CURR_DIR/.dockerignore.sample .dockerignore
7
+ fi
8
+
9
+ if [[ $1 = 'publish' ]]; then
10
+ docker build -t reveszimre/$2 .
11
+ docker push reveszimre/$2
12
+ fi
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env bash
2
+ set -e
3
+
4
+ if [[ $1 = 'deploy' ]]; then
5
+ EC2_IP=$(aws ec2 describe-instances \
6
+ --filters "Name=tag:Name,Values=backend" \
7
+ --query 'Reservations[*].Instances[*].[PublicIpAddress]' \
8
+ --output text)
9
+ ssh -o StrictHostKeyChecking=no ubuntu@$EC2_IP "npm run prod $2"
10
+ fi
@@ -0,0 +1,18 @@
1
+ import js from '@eslint/js';
2
+ import ts from 'typescript-eslint';
3
+
4
+ export default ts.config(
5
+ js.configs.recommended,
6
+ ...ts.configs.recommended,
7
+ {
8
+ files: ['**/*.ts'],
9
+ },
10
+ {
11
+ ignores: ['temp'],
12
+ },
13
+ {
14
+ rules: {
15
+ 'no-console': [2, { allow: ['error', 'info'] }],
16
+ },
17
+ },
18
+ );
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/bash
2
+ set -e
3
+
4
+ npx eslint .
@@ -0,0 +1,15 @@
1
+ assets
2
+ build
3
+ cdk.out
4
+ dist*
5
+ node_modules
6
+ temp
7
+ .dockerignore
8
+ .env*
9
+ .gitignore
10
+ .prettierignore
11
+ .ssl-private.key
12
+ client
13
+ eslint.config.js
14
+ prettier.config.js
15
+ tsconfig.json
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/bash
2
+ set -e
3
+
4
+ CURR_DIR=$(dirname $(realpath "$0"))
5
+
6
+ if [[ $1 = 'init' ]]; then
7
+ cp $CURR_DIR/.gitignore.sample .gitignore
8
+ git init
9
+ fi
10
+
11
+ if [[ $1 = 'push' ]]; then
12
+ git add .
13
+ git commit -m "$(node -p "require('./package.json').version")"
14
+ git push
15
+ fi
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/bash
2
+ set -e
3
+
4
+ if [[ $1 = 'patch-version' ]]; then
5
+ npm version patch --no-git-tag-version
6
+ fi
7
+
8
+ if [[ $1 = 'publish' ]]; then
9
+ cp ./package.json temp/dist
10
+ if [ -d ./_devops ]; then
11
+ cp -r ./_devops temp/dist
12
+ fi
13
+
14
+ npm publish ./temp/dist --access=public
15
+ fi
16
+
17
+ if [[ $1 = 'update-shared' ]]; then
18
+ npm i @candlerip/shared3@latest @candlerip/shared-aws3@latest @candlerip/shared-backend3@latest
19
+ fi
@@ -0,0 +1,7 @@
1
+ export default {
2
+ semi: true,
3
+ printWidth: 150,
4
+ singleQuote: true,
5
+ tabWidth: 2,
6
+ trailingComma: 'all',
7
+ };
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/bash
2
+ set -e
3
+
4
+ npx prettier . --write
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "declaration": true,
4
+ "esModuleInterop": true,
5
+ "module": "ES2022",
6
+ "moduleResolution": "node",
7
+ "skipLibCheck": true,
8
+ "strict": true,
9
+ "target": "ES2022"
10
+ },
11
+ "tsc-alias": {
12
+ "verbose": false,
13
+ "resolveFullPaths": true
14
+ }
15
+ }
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/bash
2
+ set -e
3
+
4
+ rm -rf temp/dist
5
+
6
+ if [[ $1 = 'compile' ]]; then
7
+ npx tsc
8
+ npx tsc-alias
9
+ fi
10
+
11
+ if [[ $1 = 'watch' ]]; then
12
+ npx tsc --watch
13
+ fi
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@candlerip/shared3",
3
+ "version": "0.0.2",
4
+ "type": "module",
5
+ "main": "index.js",
6
+ "bin": {
7
+ "crs-cdk": "./_devops/cdk/cdk.sh",
8
+ "crs-docker": "./_devops/docker/docker.sh",
9
+ "crs-ec2": "./_devops/ec2/ec2.sh",
10
+ "crs-eslint": "./_devops/eslint/eslint.sh",
11
+ "crs-git": "./_devops/git/git.sh",
12
+ "crs-npm": "./_devops/npm/npm.sh",
13
+ "crs-prettier": "./_devops/prettier/prettier.sh",
14
+ "crs-typescript": "./_devops/typescript/typescript.sh"
15
+ },
16
+ "scripts": {
17
+ "pub": "./devops/publish.sh",
18
+ "start": "./devops/start.sh"
19
+ },
20
+ "dependencies": {
21
+ "depcheck": "^1.4.7",
22
+ "eslint": "^8.57.0",
23
+ "globals": "^15.9.0",
24
+ "lodash": "^4.17.21",
25
+ "prettier": "^3.3.2",
26
+ "ts-prune": "^0.10.3",
27
+ "tsc-alias": "^1.8.10",
28
+ "typescript": "^5.5.2",
29
+ "typescript-eslint": "^7.13.1"
30
+ },
31
+ "devDependencies": {
32
+ "@types/lodash": "^4.17.6"
33
+ }
34
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './project/index.js';
package/src/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from './project/index.js';
@@ -0,0 +1 @@
1
+ export * from './stack/index.js';
@@ -0,0 +1 @@
1
+ export * from './stack/index.js';
@@ -0,0 +1 @@
1
+ export * from './stack-name/index.js';
@@ -0,0 +1 @@
1
+ export * from './stack-name/index.js';
@@ -0,0 +1 @@
1
+ export declare const STACK_NAMES: readonly ["app-config", "backend-init", "dictionary-service"];
@@ -0,0 +1 @@
1
+ export const STACK_NAMES = ['app-config', 'backend-init', 'dictionary-service'];
@@ -0,0 +1,2 @@
1
+ import { STACK_NAMES } from '../configs/index.js';
2
+ export type StackName = (typeof STACK_NAMES)[number];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './configs/index.js';
2
+ export * from './domains/index.js';
@@ -0,0 +1,2 @@
1
+ export * from './configs/index.js';
2
+ export * from './domains/index.js';