Commit 51617459 authored by nanahira's avatar nanahira

new

parent 584f0f19
Pipeline #3128 passed with stages
in 1 minute and 34 seconds
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# Next.js build output
.next
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
/build
/output
/dest
/config.yaml
.idea
stages:
- build
- deploy
variables:
GIT_DEPTH: "1"
build:
stage: build
tags:
- linux
image: node:buster-slim
script:
- npm ci
- npm run build
This diff is collapsed.
{
"name": "koishi-plugin-init",
"version": "1.0.0",
"description": "Koishi Plugin",
"main": "dist/index.js",
"dependencies": {
"source-map-support": "^0.5.19"
},
"devDependencies": {
"@types/lodash": "^4.14.168",
"@types/node": "^15.0.1",
"koishi": "^3.10.1",
"koishi-core": "^3.10.1",
"lodash": "^4.17.21",
"raw-loader": "^4.0.2",
"ts-loader": "^9.1.1",
"ts-node": "^9.1.1",
"typescript": "^4.2.4",
"webpack": "^5.36.2",
"webpack-cli": "^4.6.0"
},
"scripts": {
"build": "webpack"
},
"repository": {
"type": "git",
"url": "git@git.mycard.moe:nanahira/koishi-plugin-init.git"
},
"keywords": [
"Koishi.js"
],
"author": "Nanahira",
"license": "ISC"
}
import { Context } from "koishi-core";
import _ from "lodash";
import "source-map-support/register";
interface Config {
prefix: string;
}
export const name = "plugin_name";
export function apply(ctx: Context, config: Config = { prefix: "message" }) {
ctx.command("echo <message:text>").action((argv, message) => {
return _.join([config.prefix, message], ":");
});
}
{
"compilerOptions": {
"outDir": "dist",
"module": "commonjs",
"target": "esnext",
"esModuleInterop": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"declaration": true,
"sourceMap": true
},
"compileOnSave": true,
"allowJs": true,
"include": [
"*.ts",
"src/*.ts"
]
}
const path = require("path");
module.exports = {
entry: "./src/index.ts",
mode: "production",
target: "node",
devtool: "source-map",
module: {
rules: [
{
test: /\.tsx?$/,
use: "ts-loader",
exclude: /node_modules/,
},
{ test: /\.mustache$/, use: "raw-loader" },
],
},
resolve: {
extensions: [".tsx", ".ts", ".js"],
},
output: {
filename: "index.js",
library: {
type: "commonjs",
},
path: path.resolve(__dirname, "dist"),
},
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment