From c3f3762ad494eafe7a46f288f4a105f30b0eefc2 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Sat, 7 Jun 2025 18:49:56 -0700 Subject: [PATCH] feat(create): Add new command for el-project --- cmds/create/el-project.js | 25 +++++++++++++++++++ cmds/create/package.js | 2 +- .../Commands-and-options/_index.en.md | 8 ++++++ .../Commands-and-options/_index.zh-tw.md | 8 ++++++ lisp/_prepare.el | 2 +- lisp/create/el-project.el | 25 +++++++++++++++++++ 6 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 cmds/create/el-project.js create mode 100644 lisp/create/el-project.el diff --git a/cmds/create/el-project.js b/cmds/create/el-project.js new file mode 100644 index 00000000..2c7a33e4 --- /dev/null +++ b/cmds/create/el-project.js @@ -0,0 +1,25 @@ +/** + * Copyright (C) 2025 the Eask authors. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +"use strict"; + +exports.command = ['el-project']; +exports.desc = 'Create a new project with `el-project`'; + +exports.handler = async (argv) => { + await UTIL.e_call(argv, 'create/el-project'); +}; diff --git a/cmds/create/package.js b/cmds/create/package.js index e61478c3..81c6fb90 100644 --- a/cmds/create/package.js +++ b/cmds/create/package.js @@ -24,7 +24,7 @@ exports.desc = 'Create a new package'; exports.builder = yargs => yargs .positional( '', { - description: 'new project name', + description: 'new package name', type: 'string', }); diff --git a/docs/content/Getting-Started/Commands-and-options/_index.en.md b/docs/content/Getting-Started/Commands-and-options/_index.en.md index d39abb6b..3bc6cb6e 100644 --- a/docs/content/Getting-Started/Commands-and-options/_index.en.md +++ b/docs/content/Getting-Started/Commands-and-options/_index.en.md @@ -37,6 +37,14 @@ eask [GLOBAL-OPTIONS] create elpa 💡 The template project is located in https://github.com/emacs-eask/template-elpa {{< /hint >}} +## 🔍 eask create el-project + +Create a new project with [el-project](https://github.com/Kyure-A/el-project). + +```sh +eask [GLOBAL-OPTIONS] create el-project +``` + # 🚩 Core Often use commands that are uncategorized. diff --git a/docs/content/Getting-Started/Commands-and-options/_index.zh-tw.md b/docs/content/Getting-Started/Commands-and-options/_index.zh-tw.md index 93eb309d..60a023ee 100644 --- a/docs/content/Getting-Started/Commands-and-options/_index.zh-tw.md +++ b/docs/content/Getting-Started/Commands-and-options/_index.zh-tw.md @@ -37,6 +37,14 @@ eask [GLOBAL-OPTIONS] create elpa 💡 模板項目位於 https://github.com/emacs-eask/template-elpa。 {{< /hint >}} +## 🔍 eask create el-project + +使用 [el-project](https://github.com/Kyure-A/el-project) 創建一個新專案。 + +```sh +eask [GLOBAL-OPTIONS] create el-project +``` + # 🚩 核心 經常使用未分類的命令。 diff --git a/lisp/_prepare.el b/lisp/_prepare.el index 321592cd..a075f3d6 100644 --- a/lisp/_prepare.el +++ b/lisp/_prepare.el @@ -191,7 +191,7 @@ will return `lint/checkdoc' with a dash between two subcommands." These commands will first respect the current workspace. If the current workspace has no valid Eask-file; it will load global workspace instead." (eask-command-p '("init" "init/source" "init/cask" "init/eldev" "init/keg" - "create/package" "create/elpa" + "create/package" "create/elpa" "create/el-project" "bump" "cat" "keywords" "repl" "generate/ignore" "generate/license" "test/melpazoid"))) diff --git a/lisp/create/el-project.el b/lisp/create/el-project.el new file mode 100644 index 00000000..0075cf95 --- /dev/null +++ b/lisp/create/el-project.el @@ -0,0 +1,25 @@ +;;; create/el-project.el --- Create a new elisp project -*- lexical-binding: t; -*- + +;;; Commentary: +;; +;; Create a new elisp project, +;; +;; $ eask create el-project +;; + +;;; Code: + +(let ((dir (file-name-directory (nth 1 (member "-scriptload" command-line-args))))) + (load (expand-file-name "_prepare.el" + (locate-dominating-file dir "_prepare.el")) + nil t)) + +(eask-start + ;; Preparation + (eask-archive-install-packages '("gnu" "melpa" "jcs-elpa") + 'el-project) + ;; Start project creation. + (require 'el-project) + (el-project-make-project)) + +;;; create/el-project.el ends here