This commit is contained in:
Yanis Rigaudeau 2022-09-22 18:00:56 +02:00
parent eafc0307aa
commit a4e57d369c
Signed by: yanis
GPG Key ID: 4DD2841DF1C94D83
19 changed files with 1493 additions and 1367 deletions

View File

@ -1,15 +1,19 @@
# EHE
## Installation des deps
```bash
python install.py
```
## Pour lancer le projet
Dans api
```bash
npm i
npm run dev
```
Dans www
```bash
npm i
npm run dev
```

2450
api/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,17 +1,18 @@
{
"name": "api",
"version": "1.0.0",
"description": "description de ouf",
"author": "Yanis Rigaudeau - Axel Barault",
"scripts": {
"build": "tsc",
"dev": "ts-node-dev ./src/index.ts",
"start": "npm run build && node ./dist/index.js"
},
"devDependencies": {
"@types/node": "^18.7.18",
"ts-node": "^10.9.1",
"ts-node-dev": "^2.0.0",
"typescript": "^4.0.0"
}
}
"name": "api",
"version": "1.0.0",
"description": "description de ouf",
"author": "Yanis Rigaudeau - Axel Barault",
"private": true,
"scripts": {
"build": "tsc",
"dev": "ts-node-dev ./src/index.ts",
"start": "npm run build && node ./dist/index.js"
},
"devDependencies": {
"@types/node": "^18.7.18",
"ts-node": "^10.9.1",
"ts-node-dev": "^2.0.0",
"typescript": "^4.0.0"
}
}

View File

@ -1 +1,8 @@
import { test } from '@core';
const b: test = {
a: 'ui'
}
console.log(b);
console.log("coucou toi");

View File

@ -1,16 +1,30 @@
{
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"target": "es6",
"moduleResolution": "node",
"sourceMap": true,
"outDir": "dist"
},
"lib": [
"es2015"
],
"exclude": [
"node_modules/*"
]
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"target": "es6",
"moduleResolution": "node",
"sourceMap": true,
"outDir": "dist",
"paths": {
"@core": [
"../core/src"
]
}
},
"lib": [
"es2015"
],
"include": [
"src/**/*"
],
"exclude": [
"node_modules/*",
"dist/*"
],
"references": [
{
"path": "../core"
}
]
}

1
core/README.md Normal file
View File

@ -0,0 +1 @@
# CORE

36
core/package-lock.json generated Normal file
View File

@ -0,0 +1,36 @@
{
"name": "core",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "core",
"version": "1.0.0",
"devDependencies": {
"typescript": "^4.8.3"
}
},
"node_modules/typescript": {
"version": "4.8.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.3.tgz",
"integrity": "sha512-goMHfm00nWPa8UvR/CPSvykqf6dVV8x/dp0c5mFTMTIu0u0FlGWRioyy7Nn0PGAdHxpJZnuO/ut+PpQ8UiHAig==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=4.2.0"
}
}
},
"dependencies": {
"typescript": {
"version": "4.8.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.3.tgz",
"integrity": "sha512-goMHfm00nWPa8UvR/CPSvykqf6dVV8x/dp0c5mFTMTIu0u0FlGWRioyy7Nn0PGAdHxpJZnuO/ut+PpQ8UiHAig==",
"dev": true
}
}
}

13
core/package.json Normal file
View File

@ -0,0 +1,13 @@
{
"name": "core",
"version": "1.0.0",
"description": "description de ouf",
"author": "Yanis Rigaudeau - Axel Barault",
"private": true,
"scripts": {
"build": "tsc"
},
"devDependencies": {
"typescript": "^4.8.3"
}
}

1
core/src/index.ts Normal file
View File

@ -0,0 +1 @@
export * from './test';

3
core/src/test.ts Normal file
View File

@ -0,0 +1,3 @@
export type test = {
a: string;
}

17
core/tsconfig.json Normal file
View File

@ -0,0 +1,17 @@
{
"compilerOptions": {
"declaration": true,
"declarationMap": true,
"composite": true,
"sourceMap": true,
"outDir": "dist"
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules/*",
"dist/*"
],
"references": []
}

8
install.py Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/python
import os
for dir in os.listdir('.'):
if os.path.isdir(dir) and not dir.startswith('.'):
os.chdir(dir)
os.system('npm i')
os.chdir('..')

4
www/package-lock.json generated
View File

@ -1,11 +1,11 @@
{
"name": "svelte-app",
"name": "www",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "svelte-app",
"name": "www",
"version": "1.0.0",
"dependencies": {
"sirv-cli": "^2.0.0"

View File

@ -1,63 +1,67 @@
html, body {
position: relative;
width: 100%;
height: 100%;
html,
body {
position: relative;
width: 100%;
height: 100%;
}
body {
color: #333;
margin: 0;
padding: 8px;
box-sizing: border-box;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
color: #333;
margin: 0;
padding: 8px;
box-sizing: border-box;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}
a {
color: rgb(0,100,200);
text-decoration: none;
color: rgb(0, 100, 200);
text-decoration: none;
}
a:hover {
text-decoration: underline;
text-decoration: underline;
}
a:visited {
color: rgb(0,80,160);
color: rgb(0, 80, 160);
}
label {
display: block;
display: block;
}
input, button, select, textarea {
font-family: inherit;
font-size: inherit;
-webkit-padding: 0.4em 0;
padding: 0.4em;
margin: 0 0 0.5em 0;
box-sizing: border-box;
border: 1px solid #ccc;
border-radius: 2px;
input,
button,
select,
textarea {
font-family: inherit;
font-size: inherit;
-webkit-padding: 0.4em 0;
padding: 0.4em;
margin: 0 0 0.5em 0;
box-sizing: border-box;
border: 1px solid #ccc;
border-radius: 2px;
}
input:disabled {
color: #ccc;
color: #ccc;
}
button {
color: #333;
background-color: #f4f4f4;
outline: none;
color: #333;
background-color: #f4f4f4;
outline: none;
}
button:disabled {
color: #999;
color: #999;
}
button:not(:disabled):active {
background-color: #ddd;
background-color: #ddd;
}
button:focus {
border-color: #666;
}
border-color: #666;
}

View File

@ -1,18 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width,initial-scale=1'>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width,initial-scale=1'>
<title>Svelte app</title>
<title>Svelte app</title>
<link rel='icon' type='image/png' href='/favicon.png'>
<link rel='stylesheet' href='/global.css'>
<link rel='stylesheet' href='/build/bundle.css'>
<link rel='icon' type='image/png' href='/favicon.png'>
<link rel='stylesheet' href='/global.css'>
<link rel='stylesheet' href='/build/bundle.css'>
<script defer src='/build/bundle.js'></script>
<script defer src='/build/bundle.js'></script>
</head>
<body>
</body>
</html>
</html>

View File

@ -10,74 +10,74 @@ import css from 'rollup-plugin-css-only';
const production = !process.env.ROLLUP_WATCH;
function serve() {
let server;
let server;
function toExit() {
if (server) server.kill(0);
}
function toExit() {
if (server) server.kill(0);
}
return {
writeBundle() {
if (server) return;
server = require('child_process').spawn('npm', ['run', 'start', '--', '--dev'], {
stdio: ['ignore', 'inherit', 'inherit'],
shell: true
});
return {
writeBundle() {
if (server) return;
server = require('child_process').spawn('npm', ['run', 'start', '--', '--dev'], {
stdio: ['ignore', 'inherit', 'inherit'],
shell: true
});
process.on('SIGTERM', toExit);
process.on('exit', toExit);
}
};
process.on('SIGTERM', toExit);
process.on('exit', toExit);
}
};
}
export default {
input: 'src/main.ts',
output: {
sourcemap: true,
format: 'iife',
name: 'app',
file: 'public/build/bundle.js'
},
plugins: [
svelte({
preprocess: sveltePreprocess({ sourceMap: !production }),
compilerOptions: {
// enable run-time checks when not in production
dev: !production
}
}),
// we'll extract any component CSS out into
// a separate file - better for performance
css({ output: 'bundle.css' }),
input: 'src/main.ts',
output: {
sourcemap: true,
format: 'iife',
name: 'app',
file: 'public/build/bundle.js'
},
plugins: [
svelte({
preprocess: sveltePreprocess({ sourceMap: !production }),
compilerOptions: {
// enable run-time checks when not in production
dev: !production
}
}),
// we'll extract any component CSS out into
// a separate file - better for performance
css({ output: 'bundle.css' }),
// If you have external dependencies installed from
// npm, you'll most likely need these plugins. In
// some cases you'll need additional configuration -
// consult the documentation for details:
// https://github.com/rollup/plugins/tree/master/packages/commonjs
resolve({
browser: true,
dedupe: ['svelte']
}),
commonjs(),
typescript({
sourceMap: !production,
inlineSources: !production
}),
// If you have external dependencies installed from
// npm, you'll most likely need these plugins. In
// some cases you'll need additional configuration -
// consult the documentation for details:
// https://github.com/rollup/plugins/tree/master/packages/commonjs
resolve({
browser: true,
dedupe: ['svelte']
}),
commonjs(),
typescript({
sourceMap: !production,
inlineSources: !production
}),
// In dev mode, call `npm run start` once
// the bundle has been generated
!production && serve(),
// In dev mode, call `npm run start` once
// the bundle has been generated
!production && serve(),
// Watch the `public` directory and refresh the
// browser on changes when not in production
!production && livereload('public'),
// Watch the `public` directory and refresh the
// browser on changes when not in production
!production && livereload('public'),
// If we're building for production (npm run build
// instead of npm run dev), minify
production && terser()
],
watch: {
clearScreen: false
}
// If we're building for production (npm run build
// instead of npm run dev), minify
production && terser()
],
watch: {
clearScreen: false
}
};

1
www/src/global.d.ts vendored
View File

@ -1 +0,0 @@
/// <reference types="svelte" />

View File

@ -1,10 +1,10 @@
import App from './App.svelte';
const app = new App({
target: document.body,
props: {
name: 'world'
}
target: document.body,
props: {
name: 'world'
}
});
export default app;

View File

@ -1,6 +1,22 @@
{
"extends": "@tsconfig/svelte/tsconfig.json",
"include": ["src/**/*"],
"exclude": ["node_modules/*", "__sapper__/*", "public/*"]
}
"compilerOptions": {
"paths": {
"@core": [
"../core/src"
]
}
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules/*",
"public/*"
],
"references": [
{
"path": "../core"
}
]
}