Skip to content

Commit d538c95

Browse files
committed
v1.7.1
1 parent 14f7266 commit d538c95

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
url = https://github.com/scriptmaster/import
77
[submodule "apps/emeraldcss"]
88
path = apps/emeraldcss
9-
url = ssh://git@github.com/scriptmaster/emeraldcss
9+
url = https://github.com/scriptmaster/emeraldcss
1010
[submodule "sergeant_create_app"]
1111
path = sergeant_create_app
1212
url = https://github.com/scriptmaster/sergeant_create_app

sergeant.ts

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
import * as esbuild from "https://deno.land/x/esbuild@v0.19.2/mod.js"; //v0.19.1 was better?
2-
// import Babel from "https://esm.sh/@babel/standalone@7.18.8"; // causes typedarray issue
3-
import Babel from "https://esm.sh/@babel/standalone@7.23.10"; // causes typedarray issue
4-
5-
//import { denoPlugins } from "https://esm.sh/gh/scriptmaster/esbuild_deno_loader@0.8.4/mod.ts";
6-
import { denoPlugins } from "./plugins/esbuild_deno_loader/mod.ts"; // path issue
7-
// import pluginVue from "https://esm.sh/esbuild-plugin-vue-next";
8-
// import esbuildSveltePlugin from "https://esm.sh/esbuild-svelte@0.8.0";
9-
// import esbuildSveltePlugin from "./plugins/esbuild-svelte/index.deno.ts";
1+
import * as esbuild from "https://deno.land/x/esbuild@v0.19.2/mod.js";
2+
import Babel from "https://esm.sh/@babel/standalone@7.23.10"; // For transpiling .html files to h() or m() calls.
3+
import { denoPlugins } from "./plugins/esbuild_deno_loader/mod.ts";
104

115
import { NodeGlobalsPolyfillPlugin } from 'https://esm.sh/@esbuild-plugins/node-globals-polyfill';
126
import { NodeModulesPolyfillPlugin } from 'https://esm.sh/@esbuild-plugins/node-modules-polyfill'
@@ -35,7 +29,7 @@ import { alias, awsS3Deploy, certbot, congrats, csv, head, install, nginx, readL
3529
// deno install -f -A sergeant.ts; sergeant serve
3630

3731
const portRangeStart = 3000;
38-
const VERSION = 'v1.7.0';
32+
const VERSION = 'v1.7.1';
3933
const ESBUILD_MODE = Deno.env.get('ESBUILD_PLATFORM') || Deno.env.get('ESBUILD_MODE') || 'neutral';
4034
const ESBUILD_FORMAT = Deno.env.get('ESBUILD_FORMAT') || 'esm';
4135
const ESBUILD_TARGET = Deno.env.get('ESBUILD_TARGET') || 'esnext';
@@ -65,8 +59,11 @@ async function main() {
6559
versionCheck();
6660
} else {
6761
switch (true) {
68-
case /^\W*help$/i.test(command):
69-
console.log('SHOW HELP')
62+
case /^\W*h(elp)?$/i.test(command):
63+
// TODO: should do something like golang's cobra does
64+
console.log('To get started:\n\tsergeant create [scaffold] [appname]\n\tsergeant create react [appname]\n\tsergeant create preact mypreactapp\n\tNote: `sergeant ls` to list all available [templates] to scaffold.\n');
65+
console.log('To HMR serve:\n\tsergeant serve [appname]\n');
66+
console.log('To build:\n\tsergeant build [appname]\n');
7067
break;
7168
case /^build$/i.test(command):
7269
await buildApps(args[1] || "");
@@ -79,6 +76,7 @@ async function main() {
7976
//await chooseAppForMap(args[1] || "");
8077
break;
8178
case /^(scaffold|create|new|n)$/i.test(command):
79+
if (!args[1]) return lsRemoteScaffolds();
8280
create(args[1] || "builder", args[2] || "app_builder");
8381
break;
8482
case /^(ls|list|ls-remote|ls_remote|scaffolds)$/i.test(command):
@@ -121,8 +119,7 @@ async function main() {
121119
source();
122120
break;
123121
case /^(version|-v|--version|-version|v|info|about|-info|--info)$/i.test(command):
124-
// console.log(green(VERSION));
125-
// versionCheck();
122+
versionCheck();
126123
break;
127124
default:
128125
console.log(gray('>'), command || '');
@@ -147,7 +144,7 @@ function lsRemoteScaffolds(command?: string): Array<string> {
147144
const scaffoldApps = list_remote_apps(command);
148145
scaffoldApps.map(s => console.log('\tsergeant create', s, 'my_'+s+'_app'));
149146

150-
const builderApp = (prompt('Create a builder app? [y/N/scaffoldName]', 'N') || 'N').toLowerCase();
147+
const builderApp = (prompt('Create a builder app? [y/N/react] or type another scaffold name:', 'N') || 'N').toLowerCase();
151148
if (builderApp == 'y') {
152149
ensureDir(appsDir);
153150
create(args[1] || "builder", args[2] || 'my_builder_app');
@@ -160,8 +157,8 @@ function lsRemoteScaffolds(command?: string): Array<string> {
160157

161158
function versionCheck() {
162159
try {
160+
console.log(green('VERSION UPDATES\n==============='));
163161
fetch('https://raw.githubusercontent.com/scriptmaster/sergeant/master/CLI_ANNOUNCE.md').then((o) => {
164-
// console.log(o.split('\n'));
165162
if(o.ok) {
166163
o.text().then(t => {
167164
const firstLine = t.split("\n")[0];

0 commit comments

Comments
 (0)