Unverified Commit 7d123ac9 authored by Ivan Gabriele's avatar Ivan Gabriele Committed by GitHub
Browse files

refactor(app): rename contrib package to app (#903)

parent 79073f25
......@@ -13,10 +13,10 @@ API_SCHEME=http
# Web
DATA_FILLER_PATH=/admin/data-filler
WEB_DOMAIN=localhost
WEB_PORT=3100
WEB_PORT_PUBLIC=3100
WEB_SCHEME=http
APP_DOMAIN=localhost
APP_PORT=3100
APP_PORT_PUBLIC=3100
APP_SCHEME=http
# ------------------------------------------------
# Development & test variables
......
......@@ -7,7 +7,7 @@ cache:
directories:
- nodes_modules
- packages/api/nodes_modules
- packages/contrib/nodes_modules
- packages/app/nodes_modules
- packages/data-filler/nodes_modules
jobs:
......@@ -15,7 +15,7 @@ jobs:
- stage: Test
name: Unit Tests
install:
- cd packages/contrib
- cd packages/app
- yarn --frozen-lockfile
script:
- yarn test --coverage --silent
......
......@@ -11,7 +11,7 @@
"changeProcessCWD": true
},
{
"directory": "./packages/contrib",
"directory": "./packages/app",
"changeProcessCWD": true
},
{
......
......@@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2019-present DSI des Ministères Sociaux
Copyright 2019-present, Fabrique numérique des Ministères Sociaux.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......
......@@ -60,7 +60,7 @@ Le site devrait être accessible à l'adresse http://localhost:3100.
"changeProcessCWD": true
},
{
"directory": "./packages/contrib",
"directory": "./packages/app",
"changeProcessCWD": true
},
{
......
......@@ -56,11 +56,11 @@ services:
depends_on:
- postgrest
web:
app:
restart: always
build:
context: .
dockerfile: image.web.Dockerfile
dockerfile: image.app.Dockerfile
args:
API_DOMAIN: ${API_DOMAIN}
API_PORT_PUBLIC: ${API_PORT_PUBLIC}
......@@ -71,9 +71,9 @@ services:
NODE_ENV: ${NODE_ENV}
KINTO_BUCKET: ${KINTO_BUCKET}
KINTO_URI: http://kinto:8888
WEB_PORT: ${WEB_PORT}
APP_PORT: ${APP_PORT}
ports:
- ${WEB_PORT}:${WEB_PORT}
- ${APP_PORT}:${APP_PORT}
depends_on:
- api
- kinto
......
......@@ -4,9 +4,9 @@ const dotenv = require("dotenv");
const puppeteer = require("puppeteer");
dotenv.config({ path: `${__dirname}/../../../.env` });
const { CI, WEB_DOMAIN, WEB_PORT_PUBLIC, WEB_SCHEME } = process.env;
const { CI, APP_DOMAIN, APP_PORT_PUBLIC, APP_SCHEME } = process.env;
const WEB_URI = `${WEB_SCHEME}://${WEB_DOMAIN}:${WEB_PORT_PUBLIC}`;
const APP_URI = `${APP_SCHEME}://${APP_DOMAIN}:${APP_PORT_PUBLIC}`;
// Increase default cucumber timeout from 5s to 30s:
setDefaultTimeout(30000);
......@@ -55,7 +55,7 @@ class World {
}
async goToHome() {
await this.page.goto(WEB_URI);
await this.page.goto(APP_URI);
}
async login() {
......
# Web Container (including contrib & data-filler packages)
# Web Container (including app & data-filler packages)
FROM node:12.14.1-alpine
......@@ -11,7 +11,7 @@ ARG DB_URI
ARG NODE_ENV
ARG KINTO_BUCKET
ARG KINTO_URI
ARG WEB_PORT
ARG APP_PORT
ENV API_DOMAIN=$API_DOMAIN
ENV API_PORT_PUBLIC=$API_PORT_PUBLIC
......@@ -21,7 +21,7 @@ ENV DB_URI=$DB_URI
ENV NODE_ENV=$NODE_ENV
ENV KINTO_BUCKET=$KINTO_BUCKET
ENV KINTO_URI=$KINTO_URI
ENV WEB_PORT=$WEB_PORT
ENV APP_PORT=$APP_PORT
WORKDIR /app
......@@ -31,8 +31,8 @@ RUN yarn --pure-lockfile
# Otherwise, we have a fatal error:
# "Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory"
# https://stackoverflow.com/a/55547893/2736233
RUN node --max-old-space-size=2048 ./node_modules/.bin/next build ./packages/contrib
RUN node --max-old-space-size=2048 ./node_modules/.bin/next build ./packages/app
WORKDIR /app/packages/contrib
WORKDIR /app/packages/app
ENTRYPOINT ["yarn", "start"]
{
"name": "@socialgouv/cdtn-backoffice",
"name": "@socialgouv/code-du-travail-backoffice",
"description": "Applications d'administration des données du code du travail numérique.",
"version": "0.0.0",
"license": "Apache-2.0",
"description": "Applications d'administration des données du code du travail numérique.",
"private": true,
"scripts": {
"build": "lerna run --scope \"@socialgouv/cdtn-contrib\" build",
"build": "lerna run --scope \"@socialgouv/code-du-travail-backoffice__app\" build",
"db:backup": "node -r dotenv/config ./scripts/db/backup.js",
"db:init": "docker-compose exec -T db ./scripts/create_kinto_database.sh",
"db:migrate": "knex migrate:latest",
......@@ -16,11 +16,11 @@
"db:snapshot:restore": "node -r dotenv/config ./scripts/db/restore.js --dev",
"dev": "yarn dev:docker && yarn dev:packages",
"dev:docker": "docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d kinto postgrest",
"dev:packages": "lerna run --parallel --scope \"@socialgouv/cdtn-api\" --scope \"@socialgouv/cdtn-contrib\" dev",
"dev:packages": "lerna run --parallel --scope \"@socialgouv/code-du-travail-backoffice__api\" --scope \"@socialgouv/code-du-travail-backoffice__app\" dev",
"postinstall": "lerna link",
"setup": "yarn setup:env && node -r dotenv/config ./scripts/dev/setup.js",
"setup:env": "cpy --rename=\".env\" ./.env.example .",
"start": "lerna run --scope \"@socialgouv/cdtn-api\" --scope \"@socialgouv/cdtn-contrib\" start",
"start": "lerna run --scope \"@socialgouv/code-du-travail-backoffice__api\" --scope \"@socialgouv/code-du-travail-backoffice__app\" start",
"start:prod": "NODE_ENV=production ./scripts/prod/start.sh",
"test": "lerna run test",
"test:e2e": "cucumber-js",
......
......@@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2020-present DSI des Ministères Sociaux
Copyright 2019-present, Fabrique numérique des Ministères Sociaux.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......
# @socialgouv/code-du-travail-backoffice__api
{
"name": "@socialgouv/cdtn-api",
"name": "@socialgouv/code-du-travail-backoffice__api",
"description": "Proxify and log PostgREST-based API.",
"version": "0.0.0",
"license": "Apache-2.0",
"description": "Proxify and log PostgREST-based API.",
"main": "./src/index.js",
"private": true,
"scripts": {
"dev": "cross-env nodemon --exec \"node -r dotenv/config ./src dotenv_config_path=../../.env\"",
"start": "node ./src",
......
......@@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2019-present DSI des Ministères Sociaux
Copyright 2019-present, Fabrique numérique des Ministères Sociaux.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......
# @socialgouv/code-du-travail-backoffice__app
const withCss = require("@zeit/next-css");
const withTranspileModules = require("next-transpile-modules")(["@socialgouv/cdtn-data-filler"]);
const withTranspileModules = require("next-transpile-modules")([
"@socialgouv/code-du-travail-backoffice__data-filler"
]);
const {
API_DOMAIN,
......
{
"name": "@socialgouv/cdtn-contrib",
"name": "@socialgouv/code-du-travail-backoffice__app",
"description": "Application de contributions aux données du code du travail numérique.",
"version": "0.0.0",
"license": "Apache-2.0",
"description": "Application de contributions aux données du code du travail numérique.",
"private": true,
"scripts": {
"build": "rimraf ./.next && next build",
......
import getClient from "@socialgouv/cdtn-data-filler/src/kinto/client";
import KintoContext from "@socialgouv/cdtn-data-filler/src/kinto/KintoContext";
import getClient from "@socialgouv/code-du-travail-backoffice__data-filler/src/kinto/client";
import KintoContext from "@socialgouv/code-du-travail-backoffice__data-filler/src/kinto/KintoContext";
import withReduxSaga from "next-redux-saga";
import withRedux from "next-redux-wrapper";
import App from "next/app";
......
import DataFillerRecordPage from "@socialgouv/cdtn-data-filler/pages/bucket/[bucket]/collection/[collection]/record/[record]";
import DataFillerRecordPage from "@socialgouv/code-du-travail-backoffice__data-filler/pages/bucket/[bucket]/collection/[collection]/record/[record]";
import React from "react";
import DataFillerMain from "../../../../../../../../src/layouts/DataFillerMain";
......
import DataFillerIndexPage from "@socialgouv/cdtn-data-filler/pages";
import DataFillerIndexPage from "@socialgouv/code-du-travail-backoffice__data-filler/pages";
import React from "react";
import DataFillerMain from "../../../src/layouts/DataFillerMain";
......
import DataFillerSourcePage from "@socialgouv/cdtn-data-filler/pages/themes/[source]";
import DataFillerSourcePage from "@socialgouv/code-du-travail-backoffice__data-filler/pages/themes/[source]";
import React from "react";
import DataFillerMain from "../../../../src/layouts/DataFillerMain";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment