chore(deps): update node to 22, npm packages

This commit is contained in:
2024-08-20 02:34:37 +03:00
parent 2b8a6692b8
commit ada9fc0f59
13 changed files with 585 additions and 618 deletions

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use asdf

View File

@@ -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',

View File

@@ -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:

View File

@@ -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:

1
.nvmrc Normal file
View File

@@ -0,0 +1 @@
22.6.0

View File

@@ -5,4 +5,4 @@
"singleQuote": true, "singleQuote": true,
"printWidth": 100, "printWidth": 100,
"trailingComma": "none" "trailingComma": "none"
} }

View File

@@ -1,17 +1,20 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<meta charset="UTF-8"> <head>
<link rel="icon" href="favicon.ico"> <meta charset="UTF-8">
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png"> <link rel="icon" href="favicon.ico">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png"> <link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png"> <link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="manifest" href="site.webmanifest"> <link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="manifest" href="site.webmanifest">
<title>sysvinit service generator</title> <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head> <title>sysvinit service generator</title>
<body> </head>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script> <body>
</body> <div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html> </html>

885
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -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,18 +129,20 @@ 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(
serviceTemplate = serviceTemplateString [service, description, username, command],
.replace(/<NAME>/g, newService) ([newService, newDescription, newUsername, newCommand]) => {
.replace(/<DESCRIPTION>/g, newDescription) serviceTemplate = serviceTemplateString
.replace(/<USERNAME>/g, newUsername) .replace(/<NAME>/g, newService)
.replace(/<COMMAND>/g, newCommand) .replace(/<DESCRIPTION>/g, newDescription)
servicePath.value = '/etc/init.d/' + newService .replace(/<USERNAME>/g, newUsername)
logRotate = logRotateString.replace(/<NAME>/g, newService) .replace(/<COMMAND>/g, newCommand)
logRotatePath.value = '/etc/logrotate.d/' + newService servicePath.value = '/etc/init.d/' + newService
shellCommands.value = `sudo chmod +x ${servicePath.value} && sudo update-rc.d ${newService} defaults` logRotate = logRotateString.replace(/<NAME>/g, newService)
}) logRotatePath.value = '/etc/logrotate.d/' + newService
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>

View File

@@ -1,69 +1,71 @@
/* color palette from <https://github.com/vuejs/theme> */ /* color palette from <https://github.com/vuejs/theme> */
:root { :root {
--vt-c-white: #ffffff; --vt-c-white: #ffffff;
--vt-c-white-soft: #f8f8f8; --vt-c-white-soft: #f8f8f8;
--vt-c-white-mute: #f2f2f2; --vt-c-white-mute: #f2f2f2;
--vt-c-black: #181818; --vt-c-black: #181818;
--vt-c-black-soft: #222222; --vt-c-black-soft: #222222;
--vt-c-black-mute: #282828; --vt-c-black-mute: #282828;
--vt-c-indigo: #2c3e50; --vt-c-indigo: #2c3e50;
--vt-c-divider-light-1: rgba(60, 60, 60, 0.29); --vt-c-divider-light-1: rgba(60, 60, 60, 0.29);
--vt-c-divider-light-2: rgba(60, 60, 60, 0.12); --vt-c-divider-light-2: rgba(60, 60, 60, 0.12);
--vt-c-divider-dark-1: rgba(84, 84, 84, 0.65); --vt-c-divider-dark-1: rgba(84, 84, 84, 0.65);
--vt-c-divider-dark-2: rgba(84, 84, 84, 0.48); --vt-c-divider-dark-2: rgba(84, 84, 84, 0.48);
--vt-c-text-light-1: var(--vt-c-indigo); --vt-c-text-light-1: var(--vt-c-indigo);
--vt-c-text-light-2: rgba(60, 60, 60, 0.66); --vt-c-text-light-2: rgba(60, 60, 60, 0.66);
--vt-c-text-dark-1: var(--vt-c-white); --vt-c-text-dark-1: var(--vt-c-white);
--vt-c-text-dark-2: rgba(235, 235, 235, 0.64); --vt-c-text-dark-2: rgba(235, 235, 235, 0.64);
/* semantic color variables for this project */ /* semantic color variables for this project */
--color-background: var(--vt-c-white); --color-background: var(--vt-c-white);
--color-background-soft: var(--vt-c-white-soft); --color-background-soft: var(--vt-c-white-soft);
--color-background-mute: var(--vt-c-white-mute); --color-background-mute: var(--vt-c-white-mute);
--color-border: var(--vt-c-divider-light-2); --color-border: var(--vt-c-divider-light-2);
--color-border-hover: var(--vt-c-divider-light-1); --color-border-hover: var(--vt-c-divider-light-1);
--color-heading: var(--vt-c-text-light-1); --color-heading: var(--vt-c-text-light-1);
--color-text: var(--vt-c-text-light-1); --color-text: var(--vt-c-text-light-1);
--section-gap: 160px; --section-gap: 160px;
} }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
:root { :root {
--color-background: var(--vt-c-black); --color-background: var(--vt-c-black);
--color-background-soft: var(--vt-c-black-soft); --color-background-soft: var(--vt-c-black-soft);
--color-background-mute: var(--vt-c-black-mute); --color-background-mute: var(--vt-c-black-mute);
--color-border: var(--vt-c-divider-dark-2); --color-border: var(--vt-c-divider-dark-2);
--color-border-hover: var(--vt-c-divider-dark-1); --color-border-hover: var(--vt-c-divider-dark-1);
--color-heading: var(--vt-c-text-dark-1); --color-heading: var(--vt-c-text-dark-1);
--color-text: var(--vt-c-text-dark-2); --color-text: var(--vt-c-text-dark-2);
} }
} }
*, *,
*::before, *::before,
*::after { *::after {
box-sizing: border-box; box-sizing: border-box;
margin: 0; margin: 0;
font-weight: normal; font-weight: normal;
} }
body { 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',
@@ -75,8 +77,8 @@ body {
'Droid Sans', 'Droid Sans',
'Helvetica Neue', 'Helvetica Neue',
sans-serif; sans-serif;
font-size: 15px; font-size: 15px;
text-rendering: optimizeLegibility; text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }

View File

@@ -1,102 +1,101 @@
@import './base.css'; @import './base.css';
#app { #app {
max-width: 1280px; max-width: 1280px;
margin: 0 auto; margin: 0 auto;
padding: 2rem; padding: 2rem;
font-weight: normal; font-weight: normal;
} }
a, a,
.green { .green {
text-decoration: none; text-decoration: none;
color: hsla(160, 100%, 37%, 1); color: hsla(160, 100%, 37%, 1);
transition: 0.4s; transition: 0.4s;
padding: 3px; padding: 3px;
} }
header { header {
line-height: 1.2; line-height: 1.2;
} }
label { label {
display: block; display: block;
margin-bottom: 1rem; margin-bottom: 1rem;
input { input {
display: block; display: block;
margin-top: 1rem; margin-top: 1rem;
padding: 0.4rem; padding: 0.4rem;
font-size: 1rem; font-size: 1rem;
border: 1px solid var(--color-border); border: 1px solid var(--color-border);
border-radius: 4px; border-radius: 4px;
} }
} }
h1 { h1 {
font-weight: 500; font-weight: 500;
font-size: 2.6rem; font-size: 2.6rem;
margin-bottom: 2rem; margin-bottom: 2rem;
} }
h3 { 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);
} }
} }
@media (min-width: 1024px) { @media (min-width: 1024px) {
body { body {
display: flex; display: flex;
place-items: center; place-items: center;
} }
#app { #app {
display: grid; display: grid;
grid-template-columns: 1fr 2fr; grid-template-columns: 1fr 2fr;
padding: 0 2rem; padding: 0 2rem;
} }
footer { footer {
border-top: 1px solid var(--color-border); border-top: 1px solid var(--color-border);
padding-top: 1rem; padding-top: 1rem;
grid-column: 1 / -1; grid-column: 1 / -1;
} }
} }
textarea { textarea {
width: 100%; width: 100%;
min-width: 100%; min-width: 100%;
max-width: fit-content; max-width: fit-content;
padding: 1rem; padding: 1rem;
margin: 1rem 0; margin: 1rem 0;
border: 1px solid hsla(160, 100%, 37%, 1); border: 1px solid hsla(160, 100%, 37%, 1);
border-radius: 5px; border-radius: 5px;
background: #222222; background: #222222;
color: #f8f8f8; color: #f8f8f8;
font-family: monospace; font-family: monospace;
&.just-right { &.just-right {
height: fit-content; height: fit-content;
min-height: fit-content; min-height: fit-content;
max-height: fit-content; max-height: fit-content;
} }
&.noresize { &.noresize {
resize: none; resize: none;
} }
} }
summary { summary {
cursor: pointer; cursor: pointer;
} }
footer { footer {
margin-top: 2rem; margin-top: 2rem;
text-align: center; text-align: center;
} }

View File

@@ -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/*"
]
} }
} }
} }

View File

@@ -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"
]
} }
} }