5htp 0.0.6 → 0.0.7-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/package.json +3 -1
  2. package/skeleton/.github/workflows/ci.yml +93 -0
  3. package/skeleton/.github/workflows/ecs-task.json +77 -0
  4. package/skeleton/Dockerfile +20 -0
  5. package/skeleton/docker-compose.yml +45 -0
  6. package/skeleton/identity.yaml +17 -0
  7. package/skeleton/package-lock.json +6139 -0
  8. package/skeleton/package.json +30 -0
  9. package/skeleton/src/client/assets/identity/logo.svg +64 -0
  10. package/skeleton/src/client/assets/identity/logoAndText.svg +105 -0
  11. package/skeleton/src/client/assets/illustration/launch.jpg +0 -0
  12. package/skeleton/src/client/assets/logos/google-play-store.svg +1 -0
  13. package/skeleton/src/client/assets/logos/googleauth.svg +9 -0
  14. package/skeleton/src/client/assets/patterns/interlaced.png +0 -0
  15. package/skeleton/src/client/assets/theme.less +278 -0
  16. package/skeleton/src/client/components/LoginModal.tsx +45 -0
  17. package/skeleton/src/client/pages/app/_layout/index.less +20 -0
  18. package/skeleton/src/client/pages/app/_layout/index.tsx +33 -0
  19. package/skeleton/src/client/pages/app/index.tsx +57 -0
  20. package/skeleton/src/client/pages/landing/_layout/index.less +145 -0
  21. package/skeleton/src/client/pages/landing/_layout/index.tsx +63 -0
  22. package/skeleton/src/client/pages/landing/index.tsx +73 -0
  23. package/skeleton/src/client/pages/preload.json +3 -0
  24. package/skeleton/src/client/tsconfig.json +32 -0
  25. package/skeleton/src/common/tsconfig.json +10 -0
  26. package/skeleton/src/server/config.ts +125 -0
  27. package/skeleton/src/server/index.ts +23 -0
  28. package/skeleton/src/server/routes/general.ts +66 -0
  29. package/skeleton/src/server/services/auth/index.ts +88 -0
  30. package/skeleton/src/server/tsconfig.json +34 -0
  31. package/src/{utils → app}/config.ts +20 -2
  32. package/src/app/index.ts +63 -0
  33. package/src/commands/build.ts +6 -1
  34. package/src/commands/deploy/web.ts +3 -3
  35. package/src/commands/dev.ts +12 -7
  36. package/src/commands/init.ts +85 -0
  37. package/src/compiler/client/identite.ts +7 -5
  38. package/src/compiler/client/index.ts +20 -17
  39. package/src/compiler/common/babel/index.ts +209 -201
  40. package/src/compiler/common/babel/plugins/injection-dependances/index.ts +2 -2
  41. package/src/compiler/common/babel/plugins/pages.ts +4 -2
  42. package/src/compiler/common/files/autres.ts +3 -1
  43. package/src/compiler/common/files/images.ts +2 -1
  44. package/src/compiler/common/files/style.ts +6 -4
  45. package/src/compiler/common/index.ts +13 -7
  46. package/src/compiler/common/plugins/indexage/icones-svg/index.ts +45 -37
  47. package/src/compiler/common/plugins/indexage/injection-dependances/index.ts +1 -1
  48. package/src/compiler/index.ts +8 -3
  49. package/src/compiler/server/index.ts +19 -19
  50. package/src/index.ts +4 -18
  51. package/src/paths.ts +9 -32
  52. package/tsconfig.json +1 -2
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "5htp",
3
3
  "description": "5-HTP, scientifically called 5-Hydroxytryptophan, is the precursor of happiness neurotransmitter.",
4
- "version": "0.0.6",
4
+ "version": "0.0.7-1",
5
5
  "author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
6
6
  "repository": "git://github.com/gaetanlegac/5htp-cli.git",
7
7
  "license": "MIT",
@@ -64,10 +64,12 @@
64
64
  "mini-css-extract-plugin": "^2.2.2",
65
65
  "minimatch": "^3.0.4",
66
66
  "module-alias": "^2.2.2",
67
+ "node-cmd": "^5.0.0",
67
68
  "node-notifier": "^10.0.0",
68
69
  "null-loader": "^4.0.1",
69
70
  "prompts": "^2.4.2",
70
71
  "react-dev-utils": "^11.0.4",
72
+ "replace-once": "^1.0.0",
71
73
  "speed-measure-webpack-plugin": "^1.5.0",
72
74
  "terser-webpack-plugin": "^5.2.4",
73
75
  "ts-alias": "^0.0.4",
@@ -0,0 +1,93 @@
1
+ name: Node.js CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+
7
+ env:
8
+ AWS_REGION: eu-west-3
9
+ ECR_REPOSITORY: megacharger
10
+ ECS_SERVICE: megacharger
11
+ ECS_CLUSTER: main-cluster
12
+ ECS_TASK_DEFINITION: .github/workflows/ecs-task.json
13
+ CONTAINER_NAME: megacharger
14
+
15
+ jobs:
16
+ build:
17
+ name: Build
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ # git pull
21
+ - uses: actions/checkout@v3
22
+ # Use Node.JS
23
+ - name: Use Node.js
24
+ uses: actions/setup-node@v3
25
+ with:
26
+ node-version: '18.x'
27
+ # Install node deps
28
+ - run: npm ci
29
+ # Install 5htp CLI
30
+ - run: npm i --prefix=$HOME/.local -g 5htp;
31
+ # Buold app
32
+ - run: 5htp build
33
+
34
+ - uses: actions/upload-artifact@v2
35
+ with:
36
+ name: built-app
37
+ path: |
38
+ ./bin
39
+ ./public
40
+ ./package.json
41
+ ./package-lock.json
42
+ ./identity.yaml
43
+ ./Dockerfile
44
+ ./.github/workflows/ecs-task.json
45
+
46
+ deploy:
47
+ name: Deploy
48
+ runs-on: ubuntu-latest
49
+ environment: production
50
+ needs: build
51
+ steps:
52
+ - uses: actions/download-artifact@v2
53
+ with:
54
+ name: built-app
55
+
56
+ - name: Configure AWS credentials
57
+ uses: aws-actions/configure-aws-credentials@13d241b293754004c80624b5567555c4a39ffbe3
58
+ with:
59
+ aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
60
+ aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
61
+ aws-region: ${{ env.AWS_REGION }}
62
+
63
+ - run: ls -al
64
+
65
+ - name: Login to Amazon ECR
66
+ id: login-ecr
67
+ uses: aws-actions/amazon-ecr-login@aaf69d68aa3fb14c1d5a6be9ac61fe15b48453a2
68
+
69
+ - name: Build, tag, and push image to Amazon ECR
70
+ id: build-image
71
+ env:
72
+ ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
73
+ IMAGE_TAG: ${{ github.sha }}
74
+ run: |
75
+ docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
76
+ docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
77
+ echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
78
+
79
+ - name: Fill in the new image ID in the Amazon ECS task definition
80
+ id: task-def
81
+ uses: aws-actions/amazon-ecs-render-task-definition@97587c9d45a4930bf0e3da8dd2feb2a463cf4a3a
82
+ with:
83
+ task-definition: ${{ env.ECS_TASK_DEFINITION }}
84
+ container-name: ${{ env.CONTAINER_NAME }}
85
+ image: ${{ steps.build-image.outputs.image }}
86
+
87
+ - name: Deploy Amazon ECS task definition
88
+ uses: aws-actions/amazon-ecs-deploy-task-definition@v1
89
+ with:
90
+ task-definition: ${{ steps.task-def.outputs.task-definition }}
91
+ service: ${{ env.ECS_SERVICE }}
92
+ cluster: ${{ env.ECS_CLUSTER }}
93
+ wait-for-service-stability: true
@@ -0,0 +1,77 @@
1
+ {
2
+ "taskDefinitionArn": "arn:aws:ecs:eu-west-3:909466428160:task-definition/run-app:8",
3
+ "containerDefinitions": [
4
+ {
5
+ "name": "megacharger",
6
+ "image": "909466428160.dkr.ecr.eu-west-3.amazonaws.com/megacharger",
7
+ "cpu": 0,
8
+ "portMappings": [
9
+ {
10
+ "containerPort": 3010,
11
+ "hostPort": 3010,
12
+ "protocol": "tcp"
13
+ }
14
+ ],
15
+ "essential": true,
16
+ "environment": [],
17
+ "mountPoints": [],
18
+ "volumesFrom": [],
19
+ "logConfiguration": {
20
+ "logDriver": "awslogs",
21
+ "options": {
22
+ "awslogs-group": "/ecs/run-app",
23
+ "awslogs-region": "eu-west-3",
24
+ "awslogs-stream-prefix": "ecs"
25
+ }
26
+ }
27
+ }
28
+ ],
29
+ "family": "run-app",
30
+ "taskRoleArn": "arn:aws:iam::909466428160:role/ecsTaskExecutionRole",
31
+ "executionRoleArn": "arn:aws:iam::909466428160:role/ecsTaskExecutionRole",
32
+ "networkMode": "awsvpc",
33
+ "revision": 8,
34
+ "volumes": [],
35
+ "status": "ACTIVE",
36
+ "requiresAttributes": [
37
+ {
38
+ "name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
39
+ },
40
+ {
41
+ "name": "ecs.capability.execution-role-awslogs"
42
+ },
43
+ {
44
+ "name": "com.amazonaws.ecs.capability.ecr-auth"
45
+ },
46
+ {
47
+ "name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
48
+ },
49
+ {
50
+ "name": "com.amazonaws.ecs.capability.task-iam-role"
51
+ },
52
+ {
53
+ "name": "ecs.capability.execution-role-ecr-pull"
54
+ },
55
+ {
56
+ "name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
57
+ },
58
+ {
59
+ "name": "ecs.capability.task-eni"
60
+ }
61
+ ],
62
+ "placementConstraints": [],
63
+ "compatibilities": [
64
+ "EC2",
65
+ "FARGATE"
66
+ ],
67
+ "runtimePlatform": {
68
+ "operatingSystemFamily": "LINUX"
69
+ },
70
+ "requiresCompatibilities": [
71
+ "FARGATE"
72
+ ],
73
+ "cpu": "256",
74
+ "memory": "512",
75
+ "registeredAt": "2022-10-17T11:13:18.185000+02:00",
76
+ "registeredBy": "arn:aws:iam::909466428160:user/github-ci"
77
+ }
@@ -0,0 +1,20 @@
1
+ # NOTE: Executed locally, **AND** from the github repo
2
+ # Run after happy build
3
+
4
+ # Image config
5
+ FROM node:18-bullseye
6
+ WORKDIR /app
7
+
8
+ # Install deps
9
+ COPY package.json .
10
+ COPY package-lock.json .
11
+ RUN npm ci
12
+
13
+ # Config
14
+ COPY identity.yaml .
15
+ COPY ./public ./public
16
+ # Source files
17
+ COPY bin ./bin
18
+
19
+ # Run
20
+ CMD ["npm", "start"]
@@ -0,0 +1,45 @@
1
+ version: '3'
2
+ services:
3
+ megacharger:
4
+ # Launch
5
+ image: megacharger
6
+ container_name: megacharger
7
+ build:
8
+ context: .
9
+ dockerfile: Dockerfile
10
+ # Container config
11
+ ports:
12
+ - 3010:3010
13
+ expose:
14
+ - 3010
15
+ depends_on:
16
+ - mysqldb
17
+ networks:
18
+ - internalnet
19
+ tty: true
20
+
21
+ mysqldb:
22
+ # Launch
23
+ image: mysql:8.0
24
+ container_name: mysqlcontainer
25
+ command: --default-authentication-plugin=mysql_native_password
26
+ restart: unless-stopped
27
+ # Container config
28
+ ports:
29
+ - 3366:3306
30
+ expose:
31
+ - 3366
32
+ # Service config (TODO: move to env file)
33
+ environment:
34
+ MYSQL_DATABASE: megacharger
35
+ MYSQL_USER: gaetan
36
+ MYSQL_PASSWORD: "$$mdp=MySQL!159753"
37
+ MYSQL_ROOT_PASSWORD: "$$mdp=MySQL!159753"
38
+ SERVICE_TAGS: prod
39
+ SERVICE_NAME: mysqldb
40
+ networks:
41
+ - internalnet
42
+
43
+ networks:
44
+ internalnet:
45
+ driver: bridge
@@ -0,0 +1,17 @@
1
+ name: {{ PROJECT_NAME }}
2
+ description: "Coucou"
3
+
4
+ author:
5
+ name: Decentraliseur
6
+ url: megacharger.io
7
+ email: contact@gaetan-legac.fr
8
+
9
+ social:
10
+
11
+ language: en
12
+ maincolor: white
13
+
14
+ web:
15
+ title: "{{ PROJECT_NAME }}"
16
+ description: "{{ PROJECT_DESCRIPTION }}"
17
+ version: 0.0.1