Improve configuration & README. Add license.

This commit is contained in:
Emmanuel 2022-08-09 11:15:42 +02:00
parent 031eaf8ea0
commit 2bde3313b8
10 changed files with 124 additions and 58 deletions

View file

@ -1,24 +1,24 @@
module.exports = { module.exports = {
root: true,
parser: "@typescript-eslint/parser",
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
],
plugins: ["svelte3", "@typescript-eslint"],
ignorePatterns: ["*.cjs"],
overrides: [{ files: ["*.svelte"], processor: "svelte3/svelte3" }],
settings: {
"svelte3/typescript": () => require("typescript"),
},
parserOptions: {
sourceType: "module",
ecmaVersion: 2020,
},
env: { env: {
browser: true, browser: true,
es2017: true, es2017: true,
node: true, node: true,
}, },
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
],
ignorePatterns: ["*.cjs"],
overrides: [{ files: ["*.svelte"], processor: "svelte3/svelte3" }],
plugins: ["svelte3", "@typescript-eslint"],
parser: "@typescript-eslint/parser",
parserOptions: {
sourceType: "module",
ecmaVersion: 2020,
},
root: true,
settings: {
"svelte3/typescript": () => require("typescript"),
},
} }

10
.gitignore vendored
View file

@ -1,8 +1,6 @@
.DS_Store .DS_Store
node_modules
/build
/.svelte-kit /.svelte-kit
/package /build
.env /node_modules
.env.* /*.env
!.env.example !/example.env

View file

@ -1,11 +1,11 @@
.DS_Store
node_modules
/build
/.svelte-kit /.svelte-kit
/build
/package /package
.DS_Store
.env .env
.env.* .env.*
!.env.example !.env.example
node_modules
# Ignore files for PNPM, NPM and YARN # Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml pnpm-lock.yaml

14
.vscode/extensions.json vendored Normal file
View file

@ -0,0 +1,14 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"bradlc.vscode-tailwindcss",
"EditorConfig.EditorConfig",
"esbenp.prettier-vscode",
"svelte.svelte-vscode"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
}

21
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,21 @@
{
"editor.formatOnSave": true,
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[svelte]": {
"editor.defaultFormatter": "svelte.svelte-vscode"
}
}

22
LICENSE.md Normal file
View file

@ -0,0 +1,22 @@
# Tricoteuses Legal Explorer
## _Web API & site to browse legal open data from French Direction de l'information légale et administrative (Dila)_
By: Emmanuel Raviart <mailto:emmanuel@raviart.com>
Copyright (C) 2022 Emmanuel Raviart
https://git.en-root.org/tricoteuses/tricoteuses-legal-explorer
> Tricoteuses Legal Explorer is free software; you can redistribute it and/or modify
> it under the terms of the GNU Affero General Public License as
> published by the Free Software Foundation, either version 3 of the
> License, or (at your option) any later version.
>
> Tricoteuses Legal Explorer is distributed in the hope that it will be useful,
> but WITHOUT ANY WARRANTY; without even the implied warranty of
> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> GNU Affero General Public License for more details.
>
> You should have received a copy of the GNU Affero General Public License
> along with this program. If not, see <http://www.gnu.org/licenses/>.

View file

@ -1,38 +1,40 @@
# create-svelte # Tricoteuses Legal Explorer
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte). ## _Web API & site to browse legal open data from French Direction de l'information légale et administrative (Dila)_
## Creating a project _Tricoteuses Legal Explorer_ is free and open source software.
If you're seeing this, you've probably already done this step. Congrats! - [software repository](https://git.en-root.org/tricoteuses/tricoteuses-legal-explorer)
- [GNU Affero General Public License version 3 or greater](https://git.en-root.org/tricoteuses/tricoteuses-legal-explorer/blob/master/LICENSE.md)
## Installation
### Install dependencies
```bash ```bash
# create a new project in the current directory npm install
npm create svelte@latest
# create a new project in my-app
npm create svelte@latest my-app
``` ```
## Developing ## Server Configuration
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: Create a `.env` file to set configuration variables (you can use `example.env` as a template). Then:
```bash
npm run configure
npm run package
```
## Server Launch
In development mode:
```bash ```bash
npm run dev npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
``` ```
## Building In production mode:
To create a production version of your app:
```bash ```bash
npm run build npm run build
npm run preview
``` ```
You can preview the production build with `npm run preview`.
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.

View file

@ -1,16 +1,24 @@
{ {
"name": "tricoteuses-legal", "name": "@tricoteuses/legal-explorer",
"description": "Web API & site to browse legal open data from French Direction de l'information légale et administrative (Dila)",
"license": "AGPL-3.0-or-later",
"repository": {
"type": "git",
"url": "https://git.en-root.org/tricoteuses/tricoteuses-legal-explorer.git"
},
"version": "0.0.1", "version": "0.0.1",
"author": "Emmanuel Raviart <emmanuel@raviart.com>",
"type": "module",
"scripts": { "scripts": {
"dev": "vite dev",
"build": "vite build", "build": "vite build",
"package": "svelte-kit package",
"preview": "vite preview",
"test": "playwright test",
"check": "svelte-check --tsconfig ./tsconfig.json", "check": "svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch", "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
"dev": "vite dev",
"format": "prettier --write --plugin-search-dir=. .",
"lint": "prettier --check --plugin-search-dir=. . && eslint .", "lint": "prettier --check --plugin-search-dir=. . && eslint .",
"format": "prettier --write --plugin-search-dir=. ." "package": "svelte-kit package",
"preview": "vite preview",
"test": "playwright test"
}, },
"devDependencies": { "devDependencies": {
"@playwright/test": "^1.22.2", "@playwright/test": "^1.22.2",
@ -35,6 +43,5 @@
"tailwindcss": "^3.1.5", "tailwindcss": "^3.1.5",
"@tailwindcss/typography": "^0.5.3", "@tailwindcss/typography": "^0.5.3",
"daisyui": "^2.18.1" "daisyui": "^2.18.1"
}, }
"type": "module"
} }

View file

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="fr">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" /> <link rel="icon" href="%sveltekit.assets%/favicon.png" />

View file

@ -1,4 +1,4 @@
import adapter from "@sveltejs/adapter-auto" import adapter from "@sveltejs/adapter-node"
import preprocess from "svelte-preprocess" import preprocess from "svelte-preprocess"
/** @type {import('@sveltejs/kit').Config} */ /** @type {import('@sveltejs/kit').Config} */
@ -12,7 +12,9 @@ const config = {
], ],
kit: { kit: {
adapter: adapter(), adapter: adapter({
precompress: true,
}),
}, },
} }