mirror of
https://github.com/ivuorinen/sysvinit-service-generator.git
synced 2026-01-26 03:24:03 +00:00
chore(deps): update node to 22, npm packages
This commit is contained in:
@@ -3,7 +3,7 @@ require('@rushstack/eslint-patch/modern-module-resolution')
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
root: true,
|
root: true,
|
||||||
'extends': [
|
extends: [
|
||||||
'plugin:vue/vue3-essential',
|
'plugin:vue/vue3-essential',
|
||||||
'eslint:recommended',
|
'eslint:recommended',
|
||||||
'@vue/eslint-config-typescript',
|
'@vue/eslint-config-typescript',
|
||||||
|
|||||||
2
.github/workflows/build-and-deploy.yml
vendored
2
.github/workflows/build-and-deploy.yml
vendored
@@ -30,7 +30,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [20.x]
|
node-version: [22.x]
|
||||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
2
.github/workflows/pr-build.yml
vendored
2
.github/workflows/pr-build.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [20.x]
|
node-version: [22.x]
|
||||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
11
index.html
11
index.html
@@ -1,6 +1,7 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
|
||||||
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<link rel="icon" href="favicon.ico">
|
<link rel="icon" href="favicon.ico">
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
|
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
|
||||||
@@ -9,9 +10,11 @@
|
|||||||
<link rel="manifest" href="site.webmanifest">
|
<link rel="manifest" href="site.webmanifest">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>sysvinit service generator</title>
|
<title>sysvinit service generator</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
|
||||||
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
<script type="module" src="/src/main.ts"></script>
|
<script type="module" src="/src/main.ts"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
885
package-lock.json
generated
885
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
22
src/App.vue
22
src/App.vue
@@ -5,10 +5,12 @@ let service = defineModel('service', { default: 'my-service' })
|
|||||||
let description = defineModel('description', { default: 'This command does something' })
|
let description = defineModel('description', { default: 'This command does something' })
|
||||||
let username = defineModel('username', { default: 'root' })
|
let username = defineModel('username', { default: 'root' })
|
||||||
let command = defineModel('command', { default: '/usr/local/bin/command' })
|
let command = defineModel('command', { default: '/usr/local/bin/command' })
|
||||||
let servicePath = ref('/etc/init.d/' + service.value )
|
let servicePath = ref('/etc/init.d/' + service.value)
|
||||||
let logRotatePath = ref('/etc/logrotate.d/' + service.value)
|
let logRotatePath = ref('/etc/logrotate.d/' + service.value)
|
||||||
|
|
||||||
let shellCommands = ref(`sudo chmod +x ${servicePath.value} && sudo update-rc.d ${service.value} defaults`)
|
let shellCommands = ref(
|
||||||
|
`sudo chmod +x ${servicePath.value} && sudo update-rc.d ${service.value} defaults`
|
||||||
|
)
|
||||||
|
|
||||||
let serviceTemplateString = `#!/usr/bin/env sh
|
let serviceTemplateString = `#!/usr/bin/env sh
|
||||||
### BEGIN INIT INFO
|
### BEGIN INIT INFO
|
||||||
@@ -127,7 +129,9 @@ let serviceTemplate = serviceTemplateString
|
|||||||
|
|
||||||
let logRotate = logRotateString.replace(/<NAME>/g, service.value)
|
let logRotate = logRotateString.replace(/<NAME>/g, service.value)
|
||||||
|
|
||||||
watch([service, description, username, command], ([newService, newDescription, newUsername, newCommand]) => {
|
watch(
|
||||||
|
[service, description, username, command],
|
||||||
|
([newService, newDescription, newUsername, newCommand]) => {
|
||||||
serviceTemplate = serviceTemplateString
|
serviceTemplate = serviceTemplateString
|
||||||
.replace(/<NAME>/g, newService)
|
.replace(/<NAME>/g, newService)
|
||||||
.replace(/<DESCRIPTION>/g, newDescription)
|
.replace(/<DESCRIPTION>/g, newDescription)
|
||||||
@@ -137,8 +141,8 @@ watch([service, description, username, command], ([newService, newDescription, n
|
|||||||
logRotate = logRotateString.replace(/<NAME>/g, newService)
|
logRotate = logRotateString.replace(/<NAME>/g, newService)
|
||||||
logRotatePath.value = '/etc/logrotate.d/' + newService
|
logRotatePath.value = '/etc/logrotate.d/' + newService
|
||||||
shellCommands.value = `sudo chmod +x ${servicePath.value} && sudo update-rc.d ${newService} defaults`
|
shellCommands.value = `sudo chmod +x ${servicePath.value} && sudo update-rc.d ${newService} defaults`
|
||||||
})
|
}
|
||||||
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -168,11 +172,15 @@ watch([service, description, username, command], ([newService, newDescription, n
|
|||||||
|
|
||||||
<main>
|
<main>
|
||||||
<h3>Generated service script:</h3>
|
<h3>Generated service script:</h3>
|
||||||
<div>Path: <code>{{ servicePath }}</code></div>
|
<div>
|
||||||
|
Path: <code>{{ servicePath }}</code>
|
||||||
|
</div>
|
||||||
<textarea style="height: 400px" v-text="serviceTemplate"></textarea>
|
<textarea style="height: 400px" v-text="serviceTemplate"></textarea>
|
||||||
<details>
|
<details>
|
||||||
<summary>Logrotate</summary>
|
<summary>Logrotate</summary>
|
||||||
<div>Path: <code>{{ logRotatePath }}</code></div>
|
<div>
|
||||||
|
Path: <code>{{ logRotatePath }}</code>
|
||||||
|
</div>
|
||||||
<textarea class="just-right noresize" v-text="logRotate"></textarea>
|
<textarea class="just-right noresize" v-text="logRotate"></textarea>
|
||||||
</details>
|
</details>
|
||||||
<details>
|
<details>
|
||||||
|
|||||||
@@ -60,10 +60,12 @@ body {
|
|||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
color: var(--color-text);
|
color: var(--color-text);
|
||||||
background: var(--color-background);
|
background: var(--color-background);
|
||||||
transition: color 0.5s,
|
transition:
|
||||||
|
color 0.5s,
|
||||||
background-color 0.5s;
|
background-color 0.5s;
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
font-family: Inter,
|
font-family:
|
||||||
|
Inter,
|
||||||
-apple-system,
|
-apple-system,
|
||||||
BlinkMacSystemFont,
|
BlinkMacSystemFont,
|
||||||
'Segoe UI',
|
'Segoe UI',
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ h3 {
|
|||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@media (hover: hover) {
|
@media (hover: hover) {
|
||||||
a:hover {
|
a:hover {
|
||||||
background-color: hsla(160, 100%, 37%, 0.2);
|
background-color: hsla(160, 100%, 37%, 0.2);
|
||||||
|
|||||||
@@ -1,14 +1,21 @@
|
|||||||
{
|
{
|
||||||
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
||||||
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
|
"include": [
|
||||||
"exclude": ["src/**/__tests__/*"],
|
"env.d.ts",
|
||||||
|
"src/**/*",
|
||||||
|
"src/**/*.vue"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"src/**/__tests__/*"
|
||||||
|
],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
||||||
|
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["./src/*"]
|
"@/*": [
|
||||||
|
"./src/*"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,9 +11,10 @@
|
|||||||
"composite": true,
|
"composite": true,
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
||||||
|
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"moduleResolution": "Bundler",
|
"moduleResolution": "Bundler",
|
||||||
"types": ["node"]
|
"types": [
|
||||||
|
"node"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user