chore: adjust prettier config, .gitignore and use taplo to format toml files (#1728)

* chore: adjust prettier config, .gitignore and use taplo to format toml files

This brings the plugins-workspace repository to the same code style of the main tauri repo

* format toml

* ignore examples gen dir

* add .vscode/extensions.json

* remove packageManager field

* fmt

* fix audit

* taplo ignore permissions autogenerated files

* remove create dummy dist

* fix prettier workflow

* install fmt in prettier workflow

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
This commit is contained in:
Amr Bashir
2024-09-04 14:54:23 +03:00
committed by GitHub
parent 72c2ce82c1
commit cf4d7d4e6c
227 changed files with 2534 additions and 2505 deletions
+2 -4
View File
@@ -1,4 +1,2 @@
/node_modules/
/.vscode/
.DS_Store
.cargo
/dist/*
!/dist/.gitkeep
View File
+2 -2
View File
@@ -3,5 +3,5 @@
// SPDX-License-Identifier: MIT
window.__TAURI_ISOLATION_HOOK__ = (payload) => {
return payload;
};
return payload
}
+4 -6
View File
@@ -1,14 +1,14 @@
{
"compilerOptions": {
"moduleResolution": "node",
"target": "esnext",
"module": "esnext",
"moduleResolution": "bundler",
"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.
*/
"importsNotUsedAsValues": "error",
"verbatimModuleSyntax": true,
"isolatedModules": true,
"resolveJsonModule": true,
/**
@@ -18,8 +18,6 @@
"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.
+1 -1
View File
@@ -33,7 +33,7 @@
"@sveltejs/vite-plugin-svelte": "^3.0.1",
"@tauri-apps/cli": "2.0.0-rc.10",
"@unocss/extractor-svelte": "^0.62.0",
"svelte": "^4.2.8",
"svelte": "^4.2.19",
"unocss": "^0.62.0",
"vite": "^5.0.13"
}
+2 -2
View File
@@ -64,7 +64,7 @@ targets:
base:
ENABLE_BITCODE: false
ARCHS: [arm64, arm64-sim]
VALID_ARCHS: arm64 arm64-sim
VALID_ARCHS: arm64 arm64-sim
LIBRARY_SEARCH_PATHS[arch=x86_64]: $(inherited) $(PROJECT_DIR)/Externals/x86_64/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)
LIBRARY_SEARCH_PATHS[arch=arm64]: $(inherited) $(PROJECT_DIR)/Externals/arm64/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)
LIBRARY_SEARCH_PATHS[arch=arm64-sim]: $(inherited) $(PROJECT_DIR)/Externals/arm64-sim/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)
@@ -89,4 +89,4 @@ targets:
outputFiles:
- $(SRCROOT)/Externals/x86_64/${CONFIGURATION}/libapp.a
- $(SRCROOT)/Externals/arm64/${CONFIGURATION}/libapp.a
- $(SRCROOT)/Externals/arm64-sim/${CONFIGURATION}/libapp.a
- $(SRCROOT)/Externals/arm64-sim/${CONFIGURATION}/libapp.a
+1 -1
View File
@@ -5,7 +5,7 @@
* {
box-sizing: border-box;
font-family: "Rubik", sans-serif;
font-family: 'Rubik', sans-serif;
}
::-webkit-scrollbar {
+7 -7
View File
@@ -4,12 +4,12 @@
export function arrayBufferToBase64(buffer, callback) {
const blob = new Blob([buffer], {
type: "application/octet-binary",
});
const reader = new FileReader();
type: 'application/octet-binary'
})
const reader = new FileReader()
reader.onload = function (evt) {
const dataurl = evt.target.result;
callback(dataurl.substr(dataurl.indexOf(",") + 1));
};
reader.readAsDataURL(blob);
const dataurl = evt.target.result
callback(dataurl.substr(dataurl.indexOf(',') + 1))
}
reader.readAsDataURL(blob)
}
+6 -6
View File
@@ -2,12 +2,12 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
import "uno.css";
import "./app.css";
import App from "./App.svelte";
import 'uno.css'
import './app.css'
import App from './App.svelte'
const app = new App({
target: document.querySelector("#app"),
});
target: document.querySelector('#app')
})
export default app;
export default app
+45 -45
View File
@@ -2,43 +2,43 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
import { defineConfig, presetIcons, presetUno, presetWebFonts } from "unocss";
import extractorSvelte from "@unocss/extractor-svelte";
import { defineConfig, presetIcons, presetUno, presetWebFonts } from 'unocss'
import extractorSvelte from '@unocss/extractor-svelte'
export default defineConfig({
theme: {
colors: {
primary: "#FFFFFF",
primaryLighter: "#e9ecef",
darkPrimary: "#1B1B1D",
darkPrimaryLighter: "#242526",
primaryText: "#1C1E21",
darkPrimaryText: "#E3E3E3",
secondaryText: "#858A91",
darkSecondaryText: "#C2C5CA",
accent: "#3578E5",
accentDark: "#306cce",
accentDarker: "#2d66c3",
accentDarkest: "#2554a0",
accentLight: "#538ce9",
accentLighter: "#72a1ed",
accentLightest: "#9abcf2",
accentText: "#FFFFFF",
darkAccent: "#67d6ed",
darkAccentDark: "#49cee9",
darkAccentDarker: "#39cae8",
darkAccentDarkest: "#19b5d5",
darkAccentLight: "#85def1",
darkAccentLighter: "#95e2f2",
darkAccentLightest: "#c2eff8",
darkAccentText: "#1C1E21",
code: "#d6d8da",
codeDark: "#282a2e",
hoverOverlay: "rgba(0,0,0,.05)",
hoverOverlayDarker: "rgba(0,0,0,.1)",
darkHoverOverlay: "hsla(0,0%,100%,.05)",
darkHoverOverlayDarker: "hsla(0,0%,100%,.1)",
},
primary: '#FFFFFF',
primaryLighter: '#e9ecef',
darkPrimary: '#1B1B1D',
darkPrimaryLighter: '#242526',
primaryText: '#1C1E21',
darkPrimaryText: '#E3E3E3',
secondaryText: '#858A91',
darkSecondaryText: '#C2C5CA',
accent: '#3578E5',
accentDark: '#306cce',
accentDarker: '#2d66c3',
accentDarkest: '#2554a0',
accentLight: '#538ce9',
accentLighter: '#72a1ed',
accentLightest: '#9abcf2',
accentText: '#FFFFFF',
darkAccent: '#67d6ed',
darkAccentDark: '#49cee9',
darkAccentDarker: '#39cae8',
darkAccentDarkest: '#19b5d5',
darkAccentLight: '#85def1',
darkAccentLighter: '#95e2f2',
darkAccentLightest: '#c2eff8',
darkAccentText: '#1C1E21',
code: '#d6d8da',
codeDark: '#282a2e',
hoverOverlay: 'rgba(0,0,0,.05)',
hoverOverlayDarker: 'rgba(0,0,0,.1)',
darkHoverOverlay: 'hsla(0,0%,100%,.05)',
darkHoverOverlayDarker: 'hsla(0,0%,100%,.1)'
}
},
preflights: [
{
@@ -54,7 +54,7 @@ export default defineConfig({
code {
font-size: ${theme.fontSize.xs[0]};
font-family: ${theme.fontFamily.mono};
border-radius: ${theme.borderRadius["DEFAULT"]};
border-radius: ${theme.borderRadius['DEFAULT']};
background-color: ${theme.colors.code};
}
@@ -66,8 +66,8 @@ export default defineConfig({
.dark code {
background-color: ${theme.colors.codeDark};
}
`,
},
`
}
],
shortcuts: {
btn: `select-none outline-none shadow-md p-2 rd-1 text-primaryText border-none font-400 dark:font-600
@@ -81,20 +81,20 @@ export default defineConfig({
note: `decoration-none flex-inline items-center relative p-2 rd-1
border-l-4 border-accent dark:border-darkAccent
bg-accent/10 dark:bg-darkAccent/10`,
"note-red":
"note bg-red-700/10 dark:bg-red-700/10 after:bg-red-700 dark:after:bg-red-700",
'note-red':
'note bg-red-700/10 dark:bg-red-700/10 after:bg-red-700 dark:after:bg-red-700',
input:
"h-10 flex items-center outline-none border-none p-2 rd-1 shadow-md bg-primaryLighter dark:bg-darkPrimaryLighter text-primaryText dark:text-darkPrimaryText",
'h-10 flex items-center outline-none border-none p-2 rd-1 shadow-md bg-primaryLighter dark:bg-darkPrimaryLighter text-primaryText dark:text-darkPrimaryText'
},
presets: [
presetUno(),
presetIcons(),
presetWebFonts({
fonts: {
sans: "Rubik",
mono: ["Fira Code", "Fira Mono:400,700"],
},
}),
sans: 'Rubik',
mono: ['Fira Code', 'Fira Mono:400,700']
}
})
],
extractors: [extractorSvelte],
});
extractors: [extractorSvelte]
})
+15 -15
View File
@@ -2,12 +2,12 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
import { defineConfig } from "vite";
import Unocss from "unocss/vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import process from "process";
import { defineConfig } from 'vite'
import Unocss from 'unocss/vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'
import process from 'process'
const host = process.env.TAURI_DEV_HOST;
const host = process.env.TAURI_DEV_HOST
// https://vitejs.dev/config/
export default defineConfig(async () => {
@@ -18,9 +18,9 @@ export default defineConfig(async () => {
output: {
entryFileNames: `assets/[name].js`,
chunkFileNames: `assets/[name].js`,
assetFileNames: `assets/[name].[ext]`,
},
},
assetFileNames: `assets/[name].[ext]`
}
}
},
server: {
host: host || false,
@@ -28,14 +28,14 @@ export default defineConfig(async () => {
strictPort: true,
hmr: host
? {
protocol: "ws",
protocol: 'ws',
host,
port: 5183,
port: 5183
}
: undefined,
fs: {
allow: [".", "../../tooling/api/dist"],
},
},
};
});
allow: ['.', '../../tooling/api/dist']
}
}
}
})