Skip to content

Commit

Permalink
Use prettier for formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
cyderize committed Jun 14, 2024
1 parent 9df6620 commit 6cafb85
Show file tree
Hide file tree
Showing 18 changed files with 169 additions and 136 deletions.
16 changes: 8 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: "weekly"
- package-ecosystem: "npm"
directory: "/"
interval: 'weekly'
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: "weekly"
interval: 'weekly'
groups:
production:
dependency-type: "production"
dependency-type: 'production'
development:
dependency-type: "development"
dependency-type: 'development'
22 changes: 12 additions & 10 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,26 @@ on:
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup NodeJS LTS
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Check formatting
run: npm run format:check
- name: Build application
run: npm run build
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: playground
path: dist/
Expand All @@ -41,11 +43,11 @@ jobs:
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: Setup NodeJS LTS
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
Expand All @@ -55,7 +57,7 @@ jobs:
env:
BASE_PATH: ${{ matrix.base_path }}
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: playground-${{ matrix.branch }}
path: dist/
Expand All @@ -65,17 +67,17 @@ jobs:
needs: [build-for-deployment]
steps:
- name: Fetch main build
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: playground-main
path: ${{ github.workspace }}/dist
- name: Fetch develop build
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: playground-develop
path: ${{ github.workspace }}/dist/develop
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup NodeJS LTS
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock.json
10 changes: 9 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
{
"tabWidth": 4,
"singleQuote": true
"singleQuote": true,
"overrides": [
{
"files": ["*.yml"],
"options": {
"tabWidth": 2
}
}
]
}
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
MiniZinc Playground
===================
# MiniZinc Playground

Write and run MiniZinc models entirely within your browser.

Expand Down
22 changes: 11 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="/minizinc-logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>MiniZinc Playground</title>
</head>
<body>
<main id="app"></main>
<script type="module" src="/src/main.js"></script>
</body>
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="/minizinc-logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>MiniZinc Playground</title>
</head>
<body>
<main id="app"></main>
<script type="module" src="/src/main.js"></script>
</body>
</html>
72 changes: 38 additions & 34 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,38 +1,42 @@
{
"compilerOptions": {
"moduleResolution": "Node",
"target": "ESNext",
"module": "ESNext",
"compilerOptions": {
"moduleResolution": "Node",
"target": "ESNext",
"module": "ESNext",
/**
* svelte-preprocess cannot figure out whether you have
* a value or a type, so tell TypeScript to enforce using
* `import type` instead of `import` for Types.
*/
"verbatimModuleSyntax": true,
"isolatedModules": true,
"resolveJsonModule": true,
/**
* To have warnings / errors of the Svelte compiler at the
* correct position, enable source maps by default.
*/
"sourceMap": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
/**
* Typecheck JS in `.svelte` and `.js` files by default.
* Disable this if you'd like to use dynamic types.
*/
"checkJs": true,
"paths": {
"https://cdn.jsdelivr.net/npm/minizinc/dist/minizinc.mjs": [
"node_modules/minizinc"
],
"https://cdn.jsdelivr.net/npm/minizinc@edge/dist/minizinc.mjs": [
"node_modules/minizinc"
]
}
},
/**
* svelte-preprocess cannot figure out whether you have
* a value or a type, so tell TypeScript to enforce using
* `import type` instead of `import` for Types.
* Use global.d.ts instead of compilerOptions.types
* to avoid limiting type declarations.
*/
"verbatimModuleSyntax": true,
"isolatedModules": true,
"resolveJsonModule": true,
/**
* To have warnings / errors of the Svelte compiler at the
* correct position, enable source maps by default.
*/
"sourceMap": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
/**
* Typecheck JS in `.svelte` and `.js` files by default.
* Disable this if you'd like to use dynamic types.
*/
"checkJs": true,
"paths": {
"https://cdn.jsdelivr.net/npm/minizinc/dist/minizinc.mjs": ["node_modules/minizinc"],
"https://cdn.jsdelivr.net/npm/minizinc@edge/dist/minizinc.mjs": ["node_modules/minizinc"]
}
},
/**
* Use global.d.ts instead of compilerOptions.types
* to avoid limiting type declarations.
*/
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
}
16 changes: 16 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 41 additions & 39 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,44 @@
{
"name": "minizinc-playground",
"private": true,
"version": "0.0.0",
"type": "module",
"exports": {
".": {
"require": "./dist/minizinc-playground.umd.cjs",
"default": "./dist/minizinc-playground.js"
"name": "minizinc-playground",
"private": true,
"version": "0.0.0",
"type": "module",
"exports": {
".": {
"require": "./dist/minizinc-playground.umd.cjs",
"default": "./dist/minizinc-playground.js"
},
"./style.css": "./dist/style.css"
},
"./style.css": "./dist/style.css"
},
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"devDependencies": {
"@lezer/generator": "^1.7.0",
"@sveltejs/vite-plugin-svelte": "^3.1.1",
"minizinc": "^4.3.4",
"sass": "^1.77.5",
"svelte": "^4.2.18",
"vite": "^5.3.0"
},
"dependencies": {
"@codemirror/lang-html": "^6.4.9",
"@codemirror/lang-json": "^6.0.1",
"@fortawesome/fontawesome-svg-core": "^6.5.2",
"@fortawesome/free-solid-svg-icons": "^6.5.2",
"@lezer/highlight": "^1.2.0",
"@lezer/lr": "^1.4.1",
"bulma": "^1.0.1",
"codemirror": "^6.0.1",
"file-saver": "^2.0.5",
"jszip": "^3.10.1",
"lodash": "^4.17.21",
"split.js": "^1.6.5",
"svelte-fa": "^4.0.2",
"thememirror": "^2.0.1"
}
"scripts": {
"format:check": "prettier -c .",
"format": "prettier -w .",
"build": "vite build",
"preview": "vite preview"
},
"devDependencies": {
"@lezer/generator": "^1.7.0",
"@sveltejs/vite-plugin-svelte": "^3.1.1",
"minizinc": "^4.3.4",
"prettier": "^3.3.2",
"sass": "^1.77.5",
"svelte": "^4.2.18",
"vite": "^5.3.0"
},
"dependencies": {
"@codemirror/lang-html": "^6.4.9",
"@codemirror/lang-json": "^6.0.1",
"@fortawesome/fontawesome-svg-core": "^6.5.2",
"@fortawesome/free-solid-svg-icons": "^6.5.2",
"@lezer/highlight": "^1.2.0",
"@lezer/lr": "^1.4.1",
"bulma": "^1.0.1",
"codemirror": "^6.0.1",
"file-saver": "^2.0.5",
"jszip": "^3.10.1",
"lodash": "^4.17.21",
"split.js": "^1.6.5",
"svelte-fa": "^4.0.2",
"thememirror": "^2.0.1"
}
}
3 changes: 2 additions & 1 deletion src/app.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
html, body {
html,
body {
margin: 0;
}
2 changes: 1 addition & 1 deletion src/bulma-loader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@

.mzn-playground-theme-dark-setup {
@include bulma.theme-dark-dark-theme;
}
}
30 changes: 15 additions & 15 deletions src/bulma.scss
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
@forward "node_modules/bulma/sass/utilities";
@forward 'node_modules/bulma/sass/utilities';
@forward 'node_modules/bulma/sass/themes/light' as theme-light-*;
@forward 'node_modules/bulma/sass/themes/dark' as theme-dark-*;
@forward 'node_modules/bulma/sass/themes/setup' as theme-setup-*;
@forward 'node_modules/bulma/sass/base';
@forward "node_modules/bulma/sass/elements/button";
@forward "node_modules/bulma/sass/elements/delete";
@forward "node_modules/bulma/sass/elements/icon";
@forward "node_modules/bulma/sass/elements/table";
@forward "node_modules/bulma/sass/form";
@forward "node_modules/bulma/sass/components/dropdown";
@forward "node_modules/bulma/sass/components/menu";
@forward "node_modules/bulma/sass/components/modal";
@forward "node_modules/bulma/sass/components/navbar";
@forward "node_modules/bulma/sass/components/panel";
@forward "node_modules/bulma/sass/components/tabs";
@forward "node_modules/bulma/sass/helpers/color";
@forward "node_modules/bulma/sass/helpers/typography";
@forward "node_modules/bulma/sass/helpers/visibility";
@forward 'node_modules/bulma/sass/elements/button';
@forward 'node_modules/bulma/sass/elements/delete';
@forward 'node_modules/bulma/sass/elements/icon';
@forward 'node_modules/bulma/sass/elements/table';
@forward 'node_modules/bulma/sass/form';
@forward 'node_modules/bulma/sass/components/dropdown';
@forward 'node_modules/bulma/sass/components/menu';
@forward 'node_modules/bulma/sass/components/modal';
@forward 'node_modules/bulma/sass/components/navbar';
@forward 'node_modules/bulma/sass/components/panel';
@forward 'node_modules/bulma/sass/components/tabs';
@forward 'node_modules/bulma/sass/helpers/color';
@forward 'node_modules/bulma/sass/helpers/typography';
@forward 'node_modules/bulma/sass/helpers/visibility';
Loading

0 comments on commit 6cafb85

Please sign in to comment.