mirror of
https://github.com/ivuorinen/sysvinit-service-generator.git
synced 2026-01-26 03:24:03 +00:00
chore(deps): update eslint, config and packages
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
/* eslint-env node */
|
||||
module.exports = {
|
||||
root: true,
|
||||
extends: [
|
||||
'plugin:vue/vue3-essential',
|
||||
'eslint:recommended',
|
||||
'@vue/eslint-config-typescript',
|
||||
'@vue/eslint-config-prettier/skip-formatting'
|
||||
],
|
||||
parserOptions: {
|
||||
ecmaVersion: 'latest'
|
||||
}
|
||||
}
|
||||
26
eslint.config.mjs
Normal file
26
eslint.config.mjs
Normal file
@@ -0,0 +1,26 @@
|
||||
import pluginVue from 'eslint-plugin-vue'
|
||||
import vueTsEslintConfig from '@vue/eslint-config-typescript'
|
||||
import { includeIgnoreFile } from '@eslint/compat'
|
||||
import path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
const __dirname = path.dirname(__filename)
|
||||
const gitignorePath = path.resolve(__dirname, '.gitignore')
|
||||
|
||||
export default [
|
||||
includeIgnoreFile(gitignorePath),
|
||||
{
|
||||
// your overrides
|
||||
},
|
||||
...pluginVue.configs['flat/essential'],
|
||||
...vueTsEslintConfig({
|
||||
extends: ['recommended']
|
||||
}),
|
||||
{
|
||||
languageOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'script'
|
||||
}
|
||||
}
|
||||
]
|
||||
1365
package-lock.json
generated
1365
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
15
package.json
15
package.json
@@ -9,24 +9,27 @@
|
||||
"preview": "vite preview",
|
||||
"build-only": "vite build",
|
||||
"type-check": "vue-tsc --build --force",
|
||||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
||||
"lint": "eslint . --fix",
|
||||
"format": "prettier --write src/ index.html .github/ .vscode/"
|
||||
},
|
||||
"dependencies": {
|
||||
"vue": "^3.4.21"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/compat": "^1.2.0",
|
||||
"@eslint/eslintrc": "^3.1.0",
|
||||
"@eslint/js": "^9.12.0",
|
||||
"@tsconfig/node22": "^22",
|
||||
"@types/node": "^22",
|
||||
"@vitejs/plugin-vue": "^5.0.4",
|
||||
"@vue/eslint-config-prettier": "^10.0.0",
|
||||
"@vue/eslint-config-typescript": "^13.0.0",
|
||||
"@vue/eslint-config-prettier": "^10",
|
||||
"@vue/eslint-config-typescript": "^14",
|
||||
"@vue/tsconfig": "^0.5.1",
|
||||
"eslint": "^8.49.0",
|
||||
"eslint-plugin-vue": "^9.17.0",
|
||||
"eslint": "^9",
|
||||
"eslint-plugin-vue": "^9.28.0",
|
||||
"npm-run-all2": "^6.1.2",
|
||||
"prettier": "^3.0.3",
|
||||
"typescript": "~5.6.0",
|
||||
"typescript": "~5.5.0",
|
||||
"vite": "^5.1.6",
|
||||
"vite-plugin-vue-devtools": "^7.0.18",
|
||||
"vue-tsc": "^2.0.6"
|
||||
|
||||
22
src/App.vue
22
src/App.vue
@@ -1,18 +1,18 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue'
|
||||
|
||||
let service = defineModel('service', { default: 'my-service' })
|
||||
let description = defineModel('description', { default: 'This command does something' })
|
||||
let username = defineModel('username', { default: 'root' })
|
||||
let command = defineModel('command', { default: '/usr/local/bin/command' })
|
||||
let servicePath = ref('/etc/init.d/' + service.value)
|
||||
let logRotatePath = ref('/etc/logrotate.d/' + service.value)
|
||||
const service = defineModel('service', { default: 'my-service' })
|
||||
const description = defineModel('description', { default: 'This command does something' })
|
||||
const username = defineModel('username', { default: 'root' })
|
||||
const command = defineModel('command', { default: '/usr/local/bin/command' })
|
||||
const servicePath = ref('/etc/init.d/' + service.value)
|
||||
const logRotatePath = ref('/etc/logrotate.d/' + service.value)
|
||||
|
||||
let shellCommands = ref(
|
||||
const shellCommands = ref(
|
||||
`sudo chmod +x ${servicePath.value} && sudo update-rc.d ${service.value} defaults`
|
||||
)
|
||||
|
||||
let serviceTemplateString = `#!/usr/bin/env sh
|
||||
const serviceTemplateString = `#!/usr/bin/env sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: <NAME>
|
||||
# Required-Start: $local_fs $network $named $time $syslog
|
||||
@@ -112,7 +112,7 @@ case "$1" in
|
||||
esac
|
||||
`
|
||||
|
||||
let logRotateString = `/var/log/<NAME>.log {
|
||||
const logRotateString = `/var/log/<NAME>.log {
|
||||
rotate 4
|
||||
weekly
|
||||
missingok
|
||||
@@ -121,13 +121,13 @@ let logRotateString = `/var/log/<NAME>.log {
|
||||
delaycompress
|
||||
}`
|
||||
|
||||
let serviceTemplate = serviceTemplateString
|
||||
const serviceTemplate = serviceTemplateString
|
||||
.replace(/<NAME>/g, service.value)
|
||||
.replace(/<DESCRIPTION>/g, description.value)
|
||||
.replace(/<USERNAME>/g, username.value)
|
||||
.replace(/<COMMAND>/g, command.value)
|
||||
|
||||
let logRotate = logRotateString.replace(/<NAME>/g, service.value)
|
||||
const logRotate = logRotateString.replace(/<NAME>/g, service.value)
|
||||
|
||||
watch(
|
||||
[service, description, username, command],
|
||||
|
||||
Reference in New Issue
Block a user