mirror of
https://github.com/ivuorinen/sysvinit-service-generator.git
synced 2026-03-02 16:58:14 +00:00
Compare commits
51 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cb183a2cb9 | |||
| 2a2ccc9b61 | |||
| 7fd63ed4fe | |||
|
|
f1c3dbbca0 | ||
|
|
7a10ea3543 | ||
|
|
81a9571bfe | ||
|
|
0c35627ec6 | ||
| cf305598c3 | |||
|
|
950423f5d1 | ||
|
|
f640be60e1 | ||
|
|
d9c1fd4e46 | ||
|
|
1c8ec0288c | ||
|
|
48620265c6 | ||
|
|
f485178588 | ||
|
|
ab934c71a1 | ||
|
|
c073121516 | ||
|
|
f992676949 | ||
| c5d13597b5 | |||
|
|
8a19f6abc0 | ||
|
|
53fb2a66f9 | ||
|
|
a24b189ff2 | ||
|
|
2f8a7341c4 | ||
|
|
0f253788f2 | ||
|
|
6f6918c6a6 | ||
|
|
0c9e7e3763 | ||
|
|
72d0313022 | ||
|
|
6cb649365e | ||
|
|
261b0310ae | ||
|
|
a47b65d961 | ||
|
|
6bf2179c06 | ||
|
|
c072ea3bed | ||
|
|
b4d93e7785 | ||
|
|
1505f463aa | ||
|
|
1d75f8c4e5 | ||
| c8c37762c1 | |||
|
|
e420a68329 | ||
|
|
f010f804ea | ||
|
|
7f978e79b4 | ||
|
|
e481eff279 | ||
|
|
cd6e0d7ee1 | ||
|
|
be343f9cc5 | ||
|
|
5c8efb89db | ||
|
|
9ba9cdbf62 | ||
|
|
f0e6ee2f35 | ||
|
|
473cfee234 | ||
|
|
65d53b994b | ||
|
|
7fc9188227 | ||
| ada9fc0f59 | |||
|
|
2b8a6692b8 | ||
|
|
9e4def0f89 | ||
| b2cdc60a6e |
12
.editorconfig
Normal file
12
.editorconfig
Normal file
@@ -0,0 +1,12 @@
|
||||
# EditorConfig is awesome: https://editorconfig.org
|
||||
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
# Unix-style newlines with a newline ending every file
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
charset = utf-8
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
@@ -1,15 +0,0 @@
|
||||
/* eslint-env node */
|
||||
require('@rushstack/eslint-patch/modern-module-resolution')
|
||||
|
||||
module.exports = {
|
||||
root: true,
|
||||
'extends': [
|
||||
'plugin:vue/vue3-essential',
|
||||
'eslint:recommended',
|
||||
'@vue/eslint-config-typescript',
|
||||
'@vue/eslint-config-prettier/skip-formatting'
|
||||
],
|
||||
parserOptions: {
|
||||
ecmaVersion: 'latest'
|
||||
}
|
||||
}
|
||||
6
.github/linters/.jscpd.json
vendored
Normal file
6
.github/linters/.jscpd.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"threshold": 5,
|
||||
"reporters": ["consoleFull"],
|
||||
"ignore": ["**/__snapshots__/**", "**/node_modules/**"],
|
||||
"absolute": true
|
||||
}
|
||||
32
.github/release-drafter.yml
vendored
Normal file
32
.github/release-drafter.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
name-template: 'v$RESOLVED_VERSION 🌈'
|
||||
tag-template: 'v$RESOLVED_VERSION'
|
||||
categories:
|
||||
- title: '🚀 Features'
|
||||
labels:
|
||||
- 'feature'
|
||||
- 'enhancement'
|
||||
- title: '🐛 Bug Fixes'
|
||||
labels:
|
||||
- 'fix'
|
||||
- 'bugfix'
|
||||
- 'bug'
|
||||
- title: '🧰 Maintenance'
|
||||
label: 'chore'
|
||||
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
|
||||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
|
||||
version-resolver:
|
||||
major:
|
||||
labels:
|
||||
- 'major'
|
||||
minor:
|
||||
labels:
|
||||
- 'minor'
|
||||
patch:
|
||||
labels:
|
||||
- 'patch'
|
||||
default: patch
|
||||
template: |
|
||||
## Changes
|
||||
|
||||
$CHANGES
|
||||
2
.github/renovate.json
vendored
2
.github/renovate.json
vendored
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": ["github>ivuorinen/.github:renovate-config"]
|
||||
"extends": ["github>ivuorinen/renovate-config"]
|
||||
}
|
||||
|
||||
39
.github/workflows/build-and-deploy.yml
vendored
39
.github/workflows/build-and-deploy.yml
vendored
@@ -1,4 +1,5 @@
|
||||
---
|
||||
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
||||
name: Build and Deploy Vue Application to Github Pages
|
||||
on:
|
||||
# Runs on pushes targeting the default branch
|
||||
@@ -8,48 +9,48 @@ on:
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
||||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
|
||||
concurrency:
|
||||
group: "pages"
|
||||
group: 'pages'
|
||||
cancel-in-progress: false
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
statuses: write
|
||||
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [20.x]
|
||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
- run: npm ci
|
||||
shell: bash
|
||||
- run: npm run build --if-present
|
||||
shell: bash
|
||||
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v5
|
||||
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
|
||||
with:
|
||||
# Upload entire repository
|
||||
path: './dist/'
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4
|
||||
|
||||
12
.github/workflows/compress-images.yml
vendored
12
.github/workflows/compress-images.yml
vendored
@@ -6,24 +6,28 @@ on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "00 23 * * 0"
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
CompressOnDemandOrSchedule:
|
||||
name: calibreapp/image-actions
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
|
||||
- name: Compress Images
|
||||
id: calibre
|
||||
uses: calibreapp/image-actions@main
|
||||
uses: calibreapp/image-actions@737ceeaeed61e17b8d358358a303f1b8d177b779 # 1.1.0
|
||||
with:
|
||||
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
compressOnly: true
|
||||
|
||||
- name: Create New Pull Request If Needed
|
||||
if: steps.calibre.outputs.markdown != ''
|
||||
uses: peter-evans/create-pull-request@v6
|
||||
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7
|
||||
with:
|
||||
title: Compressed Images Nightly
|
||||
branch-suffix: timestamp
|
||||
|
||||
17
.github/workflows/dependency-review.yml
vendored
17
.github/workflows/dependency-review.yml
vendored
@@ -8,19 +8,22 @@
|
||||
#
|
||||
# Source repository: https://github.com/actions/dependency-review-action
|
||||
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
|
||||
name: "Dependency Review"
|
||||
name: 'Dependency Review'
|
||||
|
||||
on: [pull_request]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
dependency-review:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: "Checkout Repository"
|
||||
uses: actions/checkout@v4
|
||||
- name: 'Checkout Repository'
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
|
||||
- name: "Dependency Review"
|
||||
uses: actions/dependency-review-action@v4
|
||||
- name: 'Dependency Review'
|
||||
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4
|
||||
with:
|
||||
comment-summary-in-pr: always
|
||||
|
||||
20
.github/workflows/pr-build.yml
vendored
20
.github/workflows/pr-build.yml
vendored
@@ -5,24 +5,22 @@ name: Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: ["main"]
|
||||
branches: ['main']
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [20.x]
|
||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
- run: npm ci
|
||||
shell: bash
|
||||
- run: npm run build --if-present
|
||||
shell: bash
|
||||
|
||||
21
.github/workflows/pr-compress-images.yml
vendored
21
.github/workflows/pr-compress-images.yml
vendored
@@ -5,26 +5,25 @@ on:
|
||||
# Run Image Actions when JPG, JPEG, PNG or WebP files are added or changed.
|
||||
# See https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#onpushpull_requestpaths for reference.
|
||||
paths:
|
||||
- "**.jpg"
|
||||
- "**.jpeg"
|
||||
- "**.png"
|
||||
- "**.webp"
|
||||
- '**.jpg'
|
||||
- '**.jpeg'
|
||||
- '**.png'
|
||||
- '**.webp'
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
CompressInPR:
|
||||
# Only run on Pull Requests within the same repository, and not from forks.
|
||||
if: github.event.pull_request.head.repo.full_name == github.repository
|
||||
name: calibreapp/image-actions
|
||||
permissions: write-all
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
|
||||
- name: Compress Images
|
||||
uses: calibreapp/image-actions@main
|
||||
uses: calibreapp/image-actions@737ceeaeed61e17b8d358358a303f1b8d177b779 # 1.1.0
|
||||
with:
|
||||
# The `GITHUB_TOKEN` is automatically generated by GitHub and scoped only to the repository that is
|
||||
# currently running the action. By default, the action can’t update Pull Requests initiated from
|
||||
# forked repositories.
|
||||
# See https://docs.github.com/en/actions/reference/authentication-in-a-workflow and
|
||||
# https://help.github.com/en/articles/virtual-environments-for-github-actions#token-permissions
|
||||
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
58
.github/workflows/pr-lint.yml
vendored
58
.github/workflows/pr-lint.yml
vendored
@@ -1,68 +1,26 @@
|
||||
---
|
||||
#################################
|
||||
#################################
|
||||
## Super Linter GitHub Actions ##
|
||||
#################################
|
||||
#################################
|
||||
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
||||
name: Lint Code Base
|
||||
|
||||
#
|
||||
# Documentation:
|
||||
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
|
||||
#
|
||||
|
||||
env:
|
||||
MAIN_BRANCH: main
|
||||
|
||||
#############################
|
||||
# Start the job on all push #
|
||||
#############################
|
||||
on:
|
||||
push:
|
||||
branches-ignore: [master, main]
|
||||
# Remove the line above to run when pushing to master
|
||||
branches: [master, main]
|
||||
pull_request:
|
||||
branches: [master, main]
|
||||
|
||||
###############
|
||||
# Set the Job #
|
||||
###############
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
build:
|
||||
# Name the Job
|
||||
name: Lint Code Base
|
||||
# Set the agent to run on
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
############################################
|
||||
# Grant status permission for MULTI_STATUS #
|
||||
############################################
|
||||
permissions:
|
||||
statuses: write
|
||||
contents: read
|
||||
packages: read
|
||||
statuses: write
|
||||
|
||||
##################
|
||||
# Load all steps #
|
||||
##################
|
||||
steps:
|
||||
##########################
|
||||
# Checkout the code base #
|
||||
##########################
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
# Full git history is needed to get a proper
|
||||
# list of changed files within `super-linter`
|
||||
fetch-depth: 0
|
||||
|
||||
################################
|
||||
# Run Linter against code base #
|
||||
################################
|
||||
- name: Lint Code Base
|
||||
uses: github/super-linter@v5
|
||||
env:
|
||||
VALIDATE_ALL_CODEBASE: false
|
||||
# Change to 'master' if your main branch differs
|
||||
DEFAULT_BRANCH: ${{ env.MAIN_BRANCH }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# https://github.com/ivuorinen/actions
|
||||
- uses: ivuorinen/actions/pr-lint@85811a09abc994fcc6bdb7930faab3678ca9655a # 25.3.13
|
||||
|
||||
14
.github/workflows/release-drafter.yml
vendored
14
.github/workflows/release-drafter.yml
vendored
@@ -4,13 +4,25 @@ name: Release Drafter
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
workflow_call:
|
||||
# pull_request event is required only for autolabeler
|
||||
pull_request:
|
||||
# Only following types are handled by the action, but one can default to all as well
|
||||
types: [opened, reopened, synchronize]
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
update_release_draft:
|
||||
name: ✏️ Draft release
|
||||
permissions:
|
||||
# write permission is required to create a github release
|
||||
contents: write
|
||||
# write permission is required for autolabeler
|
||||
# otherwise, read permission is required at least
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 🚀 Run Release Drafter
|
||||
uses: release-drafter/release-drafter@v6.0.0
|
||||
uses: release-drafter/release-drafter@b1476f6e6eb133afa41ed8589daba6dc69b4d3f5 # v6.1.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
22
.github/workflows/stale.yml
vendored
22
.github/workflows/stale.yml
vendored
@@ -4,30 +4,30 @@ name: Stale
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 8 * * *"
|
||||
- cron: '0 8 * * *'
|
||||
workflow_call:
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
permissions:
|
||||
contents: write # only for delete-branch option
|
||||
issues: write
|
||||
pull-requests: write
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
name: 🧹 Clean up stale issues and PRs
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write # only for delete-branch option
|
||||
issues: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: 🚀 Run stale
|
||||
uses: actions/stale@v9.0.0
|
||||
uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
days-before-stale: 30
|
||||
days-before-close: 7
|
||||
remove-stale-when-updated: true
|
||||
stale-issue-label: "stale"
|
||||
exempt-issue-labels: "no-stale,help-wanted"
|
||||
stale-issue-label: 'stale'
|
||||
exempt-issue-labels: 'no-stale,help-wanted'
|
||||
stale-issue-message: >
|
||||
There hasn't been any activity on this issue recently, so we
|
||||
clean up some of the older and inactive issues.
|
||||
@@ -38,8 +38,8 @@ jobs:
|
||||
|
||||
This issue has now been marked as stale and will be closed if no
|
||||
further activity occurs. Thanks!
|
||||
stale-pr-label: "stale"
|
||||
exempt-pr-labels: "no-stale"
|
||||
stale-pr-label: 'stale'
|
||||
exempt-pr-labels: 'no-stale'
|
||||
stale-pr-message: >
|
||||
There hasn't been any activity on this pull request recently. This
|
||||
pull request has been automatically marked as stale because of that
|
||||
|
||||
3
.prettierignore
Normal file
3
.prettierignore
Normal file
@@ -0,0 +1,3 @@
|
||||
# Ignore artifacts:
|
||||
build
|
||||
coverage
|
||||
@@ -5,4 +5,4 @@
|
||||
"singleQuote": true,
|
||||
"printWidth": 100,
|
||||
"trailingComma": "none"
|
||||
}
|
||||
}
|
||||
|
||||
6
.vscode/extensions.json
vendored
6
.vscode/extensions.json
vendored
@@ -1,7 +1,3 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"Vue.volar",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"esbenp.prettier-vscode"
|
||||
]
|
||||
"recommendations": ["Vue.volar", "dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
|
||||
}
|
||||
|
||||
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'
|
||||
}
|
||||
}
|
||||
]
|
||||
17
index.html
17
index.html
@@ -1,15 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="icon" href="favicon.ico">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
|
||||
<link rel="manifest" href="site.webmanifest">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="favicon.ico" />
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png" />
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png" />
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png" />
|
||||
<link rel="manifest" href="site.webmanifest" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>sysvinit service generator</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
|
||||
3219
package-lock.json
generated
3219
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
28
package.json
28
package.json
@@ -9,26 +9,28 @@
|
||||
"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",
|
||||
"format": "prettier --write src/"
|
||||
"lint": "eslint . --fix",
|
||||
"format": "prettier --write src/ index.html .github/ .vscode/"
|
||||
},
|
||||
"dependencies": {
|
||||
"vue": "^3.4.21"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rushstack/eslint-patch": "^1.3.3",
|
||||
"@tsconfig/node20": "^20.1.2",
|
||||
"@types/node": "^20.11.28",
|
||||
"@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": "^9.0.0",
|
||||
"@vue/eslint-config-typescript": "^13.0.0",
|
||||
"@vue/tsconfig": "^0.5.1",
|
||||
"eslint": "^8.49.0",
|
||||
"eslint-plugin-vue": "^9.17.0",
|
||||
"npm-run-all2": "^6.1.2",
|
||||
"@vue/eslint-config-prettier": "^10",
|
||||
"@vue/eslint-config-typescript": "^14",
|
||||
"@vue/tsconfig": "^0.7.0",
|
||||
"eslint": "^9",
|
||||
"eslint-plugin-vue": "^9.28.0",
|
||||
"npm-run-all2": "^7.0.0",
|
||||
"prettier": "^3.0.3",
|
||||
"typescript": "~5.4.0",
|
||||
"vite": "^5.1.6",
|
||||
"typescript": "~5.8.0",
|
||||
"vite": "^6",
|
||||
"vite-plugin-vue-devtools": "^7.0.18",
|
||||
"vue-tsc": "^2.0.6"
|
||||
}
|
||||
|
||||
@@ -1 +1,11 @@
|
||||
{"name":"","short_name":"","icons":[{"src":"android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
|
||||
{
|
||||
"name": "",
|
||||
"short_name": "",
|
||||
"icons": [
|
||||
{ "src": "android-chrome-192x192.png", "sizes": "192x192", "type": "image/png" },
|
||||
{ "src": "android-chrome-512x512.png", "sizes": "512x512", "type": "image/png" }
|
||||
],
|
||||
"theme_color": "#ffffff",
|
||||
"background_color": "#ffffff",
|
||||
"display": "standalone"
|
||||
}
|
||||
|
||||
54
src/App.vue
54
src/App.vue
@@ -1,16 +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(`sudo chmod +x ${servicePath.value} && sudo update-rc.d ${service.value} defaults`)
|
||||
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
|
||||
@@ -110,7 +112,7 @@ case "$1" in
|
||||
esac
|
||||
`
|
||||
|
||||
let logRotateString = `/var/log/<NAME>.log {
|
||||
const logRotateString = `/var/log/<NAME>.log {
|
||||
rotate 4
|
||||
weekly
|
||||
missingok
|
||||
@@ -127,18 +129,20 @@ let serviceTemplate = serviceTemplateString
|
||||
|
||||
let logRotate = logRotateString.replace(/<NAME>/g, service.value)
|
||||
|
||||
watch([service, description, username, command], ([newService, newDescription, newUsername, newCommand]) => {
|
||||
serviceTemplate = serviceTemplateString
|
||||
.replace(/<NAME>/g, newService)
|
||||
.replace(/<DESCRIPTION>/g, newDescription)
|
||||
.replace(/<USERNAME>/g, newUsername)
|
||||
.replace(/<COMMAND>/g, newCommand)
|
||||
servicePath.value = '/etc/init.d/' + newService
|
||||
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`
|
||||
})
|
||||
|
||||
watch(
|
||||
[service, description, username, command],
|
||||
([newService, newDescription, newUsername, newCommand]) => {
|
||||
serviceTemplate = serviceTemplateString
|
||||
.replace(/<NAME>/g, newService)
|
||||
.replace(/<DESCRIPTION>/g, newDescription)
|
||||
.replace(/<USERNAME>/g, newUsername)
|
||||
.replace(/<COMMAND>/g, newCommand)
|
||||
servicePath.value = '/etc/init.d/' + newService
|
||||
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>
|
||||
|
||||
<template>
|
||||
@@ -168,11 +172,15 @@ watch([service, description, username, command], ([newService, newDescription, n
|
||||
|
||||
<main>
|
||||
<h3>Generated service script:</h3>
|
||||
<div>Path: <code>{{ servicePath }}</code></div>
|
||||
<div>
|
||||
Save as: <code>{{ servicePath }}</code>
|
||||
</div>
|
||||
<textarea style="height: 400px" v-text="serviceTemplate"></textarea>
|
||||
<details>
|
||||
<summary>Logrotate</summary>
|
||||
<div>Path: <code>{{ logRotatePath }}</code></div>
|
||||
<div>
|
||||
Save as: <code>{{ logRotatePath }}</code>
|
||||
</div>
|
||||
<textarea class="just-right noresize" v-text="logRotate"></textarea>
|
||||
</details>
|
||||
<details>
|
||||
|
||||
@@ -1,69 +1,71 @@
|
||||
/* color palette from <https://github.com/vuejs/theme> */
|
||||
:root {
|
||||
--vt-c-white: #ffffff;
|
||||
--vt-c-white-soft: #f8f8f8;
|
||||
--vt-c-white-mute: #f2f2f2;
|
||||
--vt-c-white: #ffffff;
|
||||
--vt-c-white-soft: #f8f8f8;
|
||||
--vt-c-white-mute: #f2f2f2;
|
||||
|
||||
--vt-c-black: #181818;
|
||||
--vt-c-black-soft: #222222;
|
||||
--vt-c-black-mute: #282828;
|
||||
--vt-c-black: #181818;
|
||||
--vt-c-black-soft: #222222;
|
||||
--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-2: rgba(60, 60, 60, 0.12);
|
||||
--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-light-1: rgba(60, 60, 60, 0.29);
|
||||
--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-2: rgba(84, 84, 84, 0.48);
|
||||
|
||||
--vt-c-text-light-1: var(--vt-c-indigo);
|
||||
--vt-c-text-light-2: rgba(60, 60, 60, 0.66);
|
||||
--vt-c-text-dark-1: var(--vt-c-white);
|
||||
--vt-c-text-dark-2: rgba(235, 235, 235, 0.64);
|
||||
--vt-c-text-light-1: var(--vt-c-indigo);
|
||||
--vt-c-text-light-2: rgba(60, 60, 60, 0.66);
|
||||
--vt-c-text-dark-1: var(--vt-c-white);
|
||||
--vt-c-text-dark-2: rgba(235, 235, 235, 0.64);
|
||||
|
||||
/* semantic color variables for this project */
|
||||
--color-background: var(--vt-c-white);
|
||||
--color-background-soft: var(--vt-c-white-soft);
|
||||
--color-background-mute: var(--vt-c-white-mute);
|
||||
/* semantic color variables for this project */
|
||||
--color-background: var(--vt-c-white);
|
||||
--color-background-soft: var(--vt-c-white-soft);
|
||||
--color-background-mute: var(--vt-c-white-mute);
|
||||
|
||||
--color-border: var(--vt-c-divider-light-2);
|
||||
--color-border-hover: var(--vt-c-divider-light-1);
|
||||
--color-border: var(--vt-c-divider-light-2);
|
||||
--color-border-hover: var(--vt-c-divider-light-1);
|
||||
|
||||
--color-heading: var(--vt-c-text-light-1);
|
||||
--color-text: var(--vt-c-text-light-1);
|
||||
--color-heading: 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) {
|
||||
:root {
|
||||
--color-background: var(--vt-c-black);
|
||||
--color-background-soft: var(--vt-c-black-soft);
|
||||
--color-background-mute: var(--vt-c-black-mute);
|
||||
:root {
|
||||
--color-background: var(--vt-c-black);
|
||||
--color-background-soft: var(--vt-c-black-soft);
|
||||
--color-background-mute: var(--vt-c-black-mute);
|
||||
|
||||
--color-border: var(--vt-c-divider-dark-2);
|
||||
--color-border-hover: var(--vt-c-divider-dark-1);
|
||||
--color-border: var(--vt-c-divider-dark-2);
|
||||
--color-border-hover: var(--vt-c-divider-dark-1);
|
||||
|
||||
--color-heading: var(--vt-c-text-dark-1);
|
||||
--color-text: var(--vt-c-text-dark-2);
|
||||
}
|
||||
--color-heading: var(--vt-c-text-dark-1);
|
||||
--color-text: var(--vt-c-text-dark-2);
|
||||
}
|
||||
}
|
||||
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
font-weight: normal;
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
body {
|
||||
min-height: 100vh;
|
||||
color: var(--color-text);
|
||||
background: var(--color-background);
|
||||
transition: color 0.5s,
|
||||
min-height: 100vh;
|
||||
color: var(--color-text);
|
||||
background: var(--color-background);
|
||||
transition:
|
||||
color 0.5s,
|
||||
background-color 0.5s;
|
||||
line-height: 1.6;
|
||||
font-family: Inter,
|
||||
line-height: 1.6;
|
||||
font-family:
|
||||
Inter,
|
||||
-apple-system,
|
||||
BlinkMacSystemFont,
|
||||
'Segoe UI',
|
||||
@@ -75,8 +77,8 @@ body {
|
||||
'Droid Sans',
|
||||
'Helvetica Neue',
|
||||
sans-serif;
|
||||
font-size: 15px;
|
||||
text-rendering: optimizeLegibility;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
font-size: 15px;
|
||||
text-rendering: optimizeLegibility;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
@@ -1,102 +1,101 @@
|
||||
@import './base.css';
|
||||
|
||||
#app {
|
||||
max-width: 1280px;
|
||||
margin: 0 auto;
|
||||
padding: 2rem;
|
||||
font-weight: normal;
|
||||
max-width: 1280px;
|
||||
margin: 0 auto;
|
||||
padding: 2rem;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
a,
|
||||
.green {
|
||||
text-decoration: none;
|
||||
color: hsla(160, 100%, 37%, 1);
|
||||
transition: 0.4s;
|
||||
padding: 3px;
|
||||
text-decoration: none;
|
||||
color: hsla(160, 100%, 37%, 1);
|
||||
transition: 0.4s;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
header {
|
||||
line-height: 1.2;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
margin-bottom: 1rem;
|
||||
display: block;
|
||||
margin-bottom: 1rem;
|
||||
|
||||
input {
|
||||
display: block;
|
||||
margin-top: 1rem;
|
||||
padding: 0.4rem;
|
||||
font-size: 1rem;
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: 4px;
|
||||
}
|
||||
input {
|
||||
display: block;
|
||||
margin-top: 1rem;
|
||||
padding: 0.4rem;
|
||||
font-size: 1rem;
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-weight: 500;
|
||||
font-size: 2.6rem;
|
||||
margin-bottom: 2rem;
|
||||
font-weight: 500;
|
||||
font-size: 2.6rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 1.2rem;
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
|
||||
@media (hover: hover) {
|
||||
a:hover {
|
||||
background-color: hsla(160, 100%, 37%, 0.2);
|
||||
}
|
||||
a:hover {
|
||||
background-color: hsla(160, 100%, 37%, 0.2);
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
body {
|
||||
display: flex;
|
||||
place-items: center;
|
||||
}
|
||||
body {
|
||||
display: flex;
|
||||
place-items: center;
|
||||
}
|
||||
|
||||
#app {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 2fr;
|
||||
padding: 0 2rem;
|
||||
}
|
||||
#app {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 2fr;
|
||||
padding: 0 2rem;
|
||||
}
|
||||
|
||||
footer {
|
||||
border-top: 1px solid var(--color-border);
|
||||
padding-top: 1rem;
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
footer {
|
||||
border-top: 1px solid var(--color-border);
|
||||
padding-top: 1rem;
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
}
|
||||
|
||||
textarea {
|
||||
width: 100%;
|
||||
min-width: 100%;
|
||||
max-width: fit-content;
|
||||
padding: 1rem;
|
||||
margin: 1rem 0;
|
||||
border: 1px solid hsla(160, 100%, 37%, 1);
|
||||
border-radius: 5px;
|
||||
background: #222222;
|
||||
color: #f8f8f8;
|
||||
font-family: monospace;
|
||||
width: 100%;
|
||||
min-width: 100%;
|
||||
max-width: fit-content;
|
||||
padding: 1rem;
|
||||
margin: 1rem 0;
|
||||
border: 1px solid hsla(160, 100%, 37%, 1);
|
||||
border-radius: 5px;
|
||||
background: #222222;
|
||||
color: #f8f8f8;
|
||||
font-family: monospace;
|
||||
|
||||
&.just-right {
|
||||
height: fit-content;
|
||||
min-height: fit-content;
|
||||
max-height: fit-content;
|
||||
}
|
||||
&.just-right {
|
||||
height: fit-content;
|
||||
min-height: fit-content;
|
||||
max-height: fit-content;
|
||||
}
|
||||
|
||||
&.noresize {
|
||||
resize: none;
|
||||
}
|
||||
&.noresize {
|
||||
resize: none;
|
||||
}
|
||||
}
|
||||
|
||||
summary {
|
||||
cursor: pointer;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
footer {
|
||||
margin-top: 2rem;
|
||||
text-align: center;
|
||||
margin-top: 2rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
||||
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "@tsconfig/node20/tsconfig.json",
|
||||
"extends": "@tsconfig/node22/tsconfig.json",
|
||||
"include": [
|
||||
"vite.config.*",
|
||||
"vitest.config.*",
|
||||
@@ -11,9 +11,10 @@
|
||||
"composite": true,
|
||||
"noEmit": true,
|
||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
||||
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"types": ["node"]
|
||||
"types": [
|
||||
"node"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,10 +6,7 @@ import VueDevTools from 'vite-plugin-vue-devtools'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
vue(),
|
||||
VueDevTools(),
|
||||
],
|
||||
plugins: [vue(), VueDevTools()],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||
|
||||
Reference in New Issue
Block a user