Skip to content

Commit

Permalink
feat: remove sub-project drama-queen (#274)
Browse files Browse the repository at this point in the history
* feat: move drama-queen content to root

* fix: update config & package after removing drama-queen folder

* ci: fix ci after removing drama-queen folder

* ci: fix build in CI
  • Loading branch information
QRuhier authored Dec 12, 2024
1 parent d770143 commit 0fd1117
Show file tree
Hide file tree
Showing 157 changed files with 163 additions and 3,357 deletions.
File renamed without changes.
5 changes: 0 additions & 5 deletions .env.drama.sample

This file was deleted.

77 changes: 36 additions & 41 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,62 +1,49 @@
name: Main CI
on:
push:
branches: ["main", "2.*"]
branches: ['main', '2.*']
pull_request:

jobs:
build:
name: Build
runs-on: ubuntu-latest
if: github.event.head_commit.author.name != 'github-actions[bot]'
environment: demo
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: yarn
- run: npx lerna run format
- run: npx lerna run lint
- run: yarn format
- run: yarn lint
- run: yarn build
- uses: actions/upload-artifact@v4
with:
name: drama
path: drama-queen/dist
name: dist
path: dist

check_if_version_upgraded:
needs: build
name: Check if version upgrade
runs-on: ubuntu-latest
if: |
github.event_name == 'push' ||
github.event.pull_request.head.repo.owner.login == github.event.pull_request.base.repo.owner.login
needs: build
outputs:
is_upgraded_version: ${{ steps.check.outputs.changed }}
version: ${{ steps.check.outputs.version }}
type: ${{ steps.check.outputs.type }}
is_drama_upgraded_version: ${{ steps.check-drama.outputs.changed }}
drama_version: ${{ steps.check-drama.outputs.version }}
drama_type: ${{ steps.check-drama.outputs.type }}

from_version: ${{ steps.check.outputs.from_version }}
to_version: ${{ steps.check.outputs.to_version }}
is_upgraded_version: ${{ steps.check.outputs.is_upgraded_version }}
is_release_beta: ${{ steps.check.outputs.is_pre_release }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4

- name: Check if container version has been updated
- uses: garronej/[email protected]
id: check
uses: EndBug/version-check@v2

- name: Check if drama queen version has been updated
id: check-drama
uses: EndBug/version-check@v2
with:
file-name: drama-queen/package.json
action_name: is_package_json_version_upgraded
branch: ${{ github.head_ref || github.ref }}

docker_drama:
docker:
needs: check_if_version_upgraded
if: |
(needs.check_if_version_upgraded.outputs.is_drama_upgraded_version == 'true')
needs.check_if_version_upgraded.outputs.is_upgraded_version == 'true'
&& (
github.event_name == 'push' ||
needs.check_if_version_upgraded.outputs.drama_type == 'prerelease'
needs.check_if_version_upgraded.outputs.is_release_beta == 'true'
)
runs-on: ubuntu-latest
steps:
Expand All @@ -67,18 +54,26 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Computing Docker image tags
id: step1
env:
IS_UPGRADED_VERSION: ${{ needs.check_if_version_upgraded.outputs.is_upgraded_version }}
TO_VERSION: ${{ needs.check_if_version_upgraded.outputs.to_version }}
run: |
OUT=$GITHUB_REPOSITORY:$TO_VERSION,$GITHUB_REPOSITORY:latest
OUT=$(echo "$OUT" | awk '{print tolower($0)}')
echo "docker_tags=$OUT" >> "$GITHUB_OUTPUT"
- uses: actions/download-artifact@v4
with:
name: drama
path: drama-queen/dist
name: dist
path: dist
- uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
context: drama-queen
push: true
tags: |
inseefr/drama-queen:latest,
inseefr/drama-queen:${{ needs.check_if_version_upgraded.outputs.drama_version }}
platforms: linux/amd64,linux/arm64
context: .
tags: ${{ steps.step1.outputs.docker_tags }}
file: Dockerfile

release:
runs-on: ubuntu-latest
Expand All @@ -87,19 +82,19 @@ jobs:
needs.check_if_version_upgraded.outputs.is_upgraded_version == 'true' &&
(
github.event_name == 'push' ||
needs.check_if_version_upgraded.outputs.type == 'prerelease'
needs.check_if_version_upgraded.outputs.is_release_beta == 'true'
)
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- uses: softprops/action-gh-release@v2
with:
name: Release v${{ needs.check_if_version_upgraded.outputs.version }}
tag_name: v${{ needs.check_if_version_upgraded.outputs.version }}
name: Release v${{ needs.check_if_version_upgraded.outputs.to_version }}
tag_name: v${{ needs.check_if_version_upgraded.outputs.to_version }}
target_commitish: ${{ github.head_ref || github.ref }}
generate_release_notes: true
draft: false
prerelease: ${{ needs.check_if_version_upgraded.outputs.type == 'prerelease' }}
prerelease: ${{ needs.check_if_version_upgraded.outputs.is_release_beta == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/sonar.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Sonar analysis
on:
push:
branches: ["main", "2.*"]
branches: ['main', '2.*']
pull_request:
types: [opened, synchronize, reopened]

Expand All @@ -19,7 +19,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: coverage
path: drama-queen/coverage
path: coverage

sonarcloud:
name: SonarCloud
Expand All @@ -33,7 +33,7 @@ jobs:
uses: actions/download-artifact@v4
with:
name: coverage
path: drama-queen/coverage
path: coverage
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,3 @@ dist-ssr
*.njsproj
*.sln
*.sw?
drama-queen/.env
queen
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ Web application for the management of questionnaires powered by Lunatic (https:/
## Getting Started

```
cp .env.drama.sample ./drama-queen/.env
cp .env.queen.sample ./queen/.env.local
npx lerna bootstrap
yarn dev:drama-queen
yarn dev:queen
yarn
yarn dev
yarn build
```
File renamed without changes.
68 changes: 0 additions & 68 deletions drama-queen/package.json

This file was deleted.

File renamed without changes.
File renamed without changes.
5 changes: 0 additions & 5 deletions lerna.json

This file was deleted.

File renamed without changes.
31 changes: 0 additions & 31 deletions nx.json

This file was deleted.

71 changes: 60 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,71 @@
{
"name": "drama-queen-container",
"name": "drama-queen",
"private": true,
"version": "2.3.1",
"workspaces": [
"drama-queen"
],
"type": "module",
"scripts": {
"test": "lerna run test",
"test:coverage": "lerna run test:coverage",
"build": "lerna run build",
"build:drama-queen": "lerna run build --scope 'drama-queen'",
"serve:drama-queen": "lerna run serve --scope 'drama-queen'",
"dev:drama-queen": "lerna run dev --scope 'drama-queen'",
"dev": "vite --port 5001 --strictPort",
"test": "vitest",
"test:coverage": "vitest --coverage",
"build": "tsc && vite build",
"postbuild": "node build/remote-env.cjs remoteEntry.js",
"preview": "vite preview --port 5001 --strictPort",
"_format": "prettier 'src/**/*.{ts,tsx,js,jsx,json,md}'",
"format": "npm run _format -- --write",
"lint": "eslint src/",
"format:check": "npm run _format -- --list-different",
"stop": "kill-port --port 5000,5001,5002"
},
"dependencies": {
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.0",
"@inseefr/lunatic": "^3.4.8",
"@mui/icons-material": "^5.15.14",
"@mui/material": "^5.15.14",
"@types/memoizee": "^0.4.11",
"axios": "^1.7.7",
"dexie": "^3.2.7",
"dexie-react-hooks": "^1.1.7",
"evt": "^2.5.7",
"i18nifty": "^3.2.1",
"jwt-decode": "^4.0.0",
"oidc-spa": "^5.4.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.51.1",
"react-hot-keys": "^2.7.3",
"react-router-dom": "^6.26.2",
"redux-clean-architecture": "^4.3.2",
"tsafe": "^1.6.6",
"tss-react": "^4.9.13",
"zod": "^3.22.4"
},
"devDependencies": {
"@originjs/vite-plugin-federation": "^1.2.3",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^16.0.1",
"@eslint/js": "^9.13.0",
"@types/node": "^20.16.10",
"@types/react": "^18.3.10",
"@types/react-dom": "^18.2.22",
"@vitejs/plugin-react": "^4.3.2",
"@vitest/coverage-v8": "^2.1.3",
"jsdom": "^25.0.1",
"eslint": "^9.13.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.37.2",
"globals": "^15.11.0",
"kill-port": "^2.0.1",
"lerna": "^7.1.1"
"prettier": "^3.2.5",
"ts-node": "^10.9.2",
"typescript": "^5.6.2",
"typescript-eslint": "^8.11.0",
"vite": "^5.4.8",
"vite-envs": "^4.4.5",
"vite-plugin-pwa": "^0.19.8",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^2.1.3"
}
}
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 0fd1117

Please sign in to comment.