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 # EHE
## Installation des deps
```bash
python install.py
```
## Pour lancer le projet ## Pour lancer le projet
Dans api Dans api
```bash ```bash
npm i
npm run dev npm run dev
``` ```
Dans www Dans www
```bash ```bash
npm i
npm run dev 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", "name": "api",
"version": "1.0.0", "version": "1.0.0",
"description": "description de ouf", "description": "description de ouf",
"author": "Yanis Rigaudeau - Axel Barault", "author": "Yanis Rigaudeau - Axel Barault",
"scripts": { "private": true,
"build": "tsc", "scripts": {
"dev": "ts-node-dev ./src/index.ts", "build": "tsc",
"start": "npm run build && node ./dist/index.js" "dev": "ts-node-dev ./src/index.ts",
}, "start": "npm run build && node ./dist/index.js"
"devDependencies": { },
"@types/node": "^18.7.18", "devDependencies": {
"ts-node": "^10.9.1", "@types/node": "^18.7.18",
"ts-node-dev": "^2.0.0", "ts-node": "^10.9.1",
"typescript": "^4.0.0" "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"); console.log("coucou toi");

View File

@ -1,16 +1,30 @@
{ {
"compilerOptions": { "compilerOptions": {
"module": "commonjs", "module": "commonjs",
"esModuleInterop": true, "esModuleInterop": true,
"target": "es6", "target": "es6",
"moduleResolution": "node", "moduleResolution": "node",
"sourceMap": true, "sourceMap": true,
"outDir": "dist" "outDir": "dist",
}, "paths": {
"lib": [ "@core": [
"es2015" "../core/src"
], ]
"exclude": [ }
"node_modules/*" },
] "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", "version": "1.0.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "svelte-app", "name": "www",
"version": "1.0.0", "version": "1.0.0",
"dependencies": { "dependencies": {
"sirv-cli": "^2.0.0" "sirv-cli": "^2.0.0"

View File

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

View File

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

View File

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

View File

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