Skip to content

Commit b5940b8

Browse files
committed
update content
1 parent c0af953 commit b5940b8

14 files changed

+58
-46
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ node_modules
3535

3636
# Temporary files
3737
temp
38+
*.DS_Store

.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"nirl",
77
"nirlstudio",
88
"res",
9-
"sugly"
9+
"eslang"
1010
],
1111
"files.trimTrailingWhitespace": true,
1212
"javascript.validate.enable": false,

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# sugly-npm
2-
A command line tool to create npm compatible sugly packages.
1+
# es-npm
2+
A command line tool to create npm compatible Espresso packages.
33

44
## Install
55
````sh
6-
npm i -g sugly-npm
6+
npm i -g es-npm
77
````
88

99
## Usage
1010
````sh
11-
mkdir my-sugly-app
12-
cd my-sugly-app
13-
sugly-npm init [default|app|module|web|site] [-c|--compact] [-d|--dev]
11+
mkdir my-espresso-app
12+
cd my-espresso-app
13+
es-npm init [default|app|module|web|site] [-c|--compact] [-d|--dev]
1414
````
1515
### Templates
1616
- default - A project serves in both app and module modes..
@@ -22,4 +22,4 @@ sugly-npm init [default|app|module|web|site] [-c|--compact] [-d|--dev]
2222

2323
### Options
2424
- -c, --compact: remove test code and dependency on mocha.
25-
- -d, --dev: use development (non-published & unstable) branch of sugly-lang.
25+
- -d, --dev: use development (non-published & unstable) branch of eslang.

es/app.s

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
#!/usr/bin/env sugly
1+
#!/usr/bin/env es
22

33
const cli (import "./cli");
44
const profile (import "./profile");
55

66
(const valid-templates (@
7-
"default", "app", "module", "web", "api"
7+
"default", "app", "module", "api", "web"
88
).
99

1010
(const valid-options (@
@@ -14,18 +14,18 @@ const profile (import "./profile");
1414
(const exit-with-help (= ()
1515
(print "
1616
Usage:\
17-
\tsugly-npm init [default|app|module|web|api] [-c|--compact] [-d|--dev]\
17+
\tes-npm init [default|app|module|web|api] [-c|--compact] [-d|--dev]\
1818
\
1919
Templates:\
2020
\tdefault \tA project which may serve in both app and module modes.\
2121
\tapp \tA project which only serves as an app.\
2222
\tmodule \tA project which only serves as a module.\
23-
\tweb \tA web site project which serves as a sugly-based web app.\
2423
\tapi \tAn app project which serves as a RESTful service.\
24+
\tweb \tA web site project which serves as a web app.\
2525
\
2626
Options:\
2727
\t-c, --compact \tremove test code, dependency on mocha and default vscode settings.\
28-
\t-d, --dev \tuse development (non-published & unstable) branch of sugly-lang.\
28+
\t-d, --dev \tuse development (non-published & unstable) branch of eslang.\
2929
"
3030
).
3131
exit 1;

es/cli.s

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
const fs (suglify (import "$fs");
1+
const fs (espress (import "$fs");
22
const path (import "$path");
33
const shell (import "$shelljs");
44
const profile (import "./profile");
55

66
const app-name (path basename (env "home");
77

88
(const repo-of (= (template)
9-
'https://github.com/NirlStudio/sugly-npm-template-$(template ?* "default")'
9+
'https://github.com/NirlStudio/es-npm-template-$(template ?* "default")'
1010
).
1111

1212
(const clone (=> (repo)
1313
log info "Downloading template ...";
1414
shell exec 'git clone $repo .';
1515
shell rm "-rf", ".git/";
16-
(fs exists-sync "package.json") and (fs exists-sync "sugly/");
16+
(fs exists-sync "package.json") and (fs exists-sync "es/");
1717
).
1818

1919
(const update-info (=> (pkg)
@@ -34,7 +34,7 @@ const app-name (path basename (env "home");
3434
(app-name): 'bin/$app-name'
3535
).
3636
pkg "repository", "";
37-
pkg "keywords", (@ "sugly");
37+
pkg "keywords", (@ "eslang", "espresso", "espressolang", "espresso-lang");
3838
).
3939

4040
(const compact (=> (pkg)
@@ -54,9 +54,11 @@ const app-name (path basename (env "home");
5454
shell mv "bin/hello.cmd", 'bin/$(app-name).cmd';
5555
).
5656

57-
# without this, a sugly dependency will not be linked.
58-
log info "Creating sugly/modules ...";
59-
shell mkdir "sugly/modules";
57+
# without this, an Espresso dependency will not be linked.
58+
(if (fs exists-sync "bin/hello":: is-not true)
59+
log info "Creating es/modules ...";
60+
shell mkdir "es/modules";
61+
).
6062

6163
log info "Generating README.md ...";
6264
fs write-file-sync "README.md", '# $app-name\n\n**UPDATE ME**';
@@ -78,7 +80,7 @@ const app-name (path basename (env "home");
7880

7981
update-info pkg;
8082
(if (options contains "--dev")
81-
pkg dependencies:: "sugly", "github:NirlStudio/sugly-lang#development";
83+
pkg dependencies:: "es", "github:NirlStudio/eslang#development";
8284
).
8385
(if (options contains "--compact")
8486
compact pkg;
@@ -109,6 +111,6 @@ const app-name (path basename (env "home");
109111
return false;
110112
).
111113

112-
printf 'Project $app-name has been initialized. Enjoy the sugliness.\n', "green";
114+
printf 'Project $app-name has been initialized. Enjoy the Espresso.\n', "green";
113115
return true;
114116
).

es/profile.s

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ const fs (import "$fs");
22
const path (import "$path");
33

44
const user-home (env "user-home");
5-
const sugly-home (path resolve user-home, ".sugly");
6-
const profile-path (path resolve sugly-home, "npm.s");
5+
const espresso-home (path resolve user-home, ".es");
6+
const profile-path (path resolve espresso-home, "npm.s");
77

88
(const default-profile (=> () (@
99
name: (path basename user-home),
@@ -15,8 +15,8 @@ const profile-path (path resolve sugly-home, "npm.s");
1515
(if (fs existsSync user-home:: is false)
1616
return (default-profile );
1717
).
18-
(if (fs existsSync sugly-home:: is false)
19-
fs mkdir sugly-home;
18+
(if (fs existsSync espresso-home:: is false)
19+
fs mkdir espresso-home;
2020
).
2121
(if (fs existsSync profile-path:: is false)
2222
fs writeFileSync profile-path, (default-profile :: to-code:: to-string);

index.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
'use strict'
22

33
var path = require('path')
4-
var sugly = require('sugly')
5-
var modules = require('sugly/modules')
4+
var eslang = require('eslang')
5+
var modules = require('eslang/modules')
66

77
// expose some native modules.
88
modules.register(require('./modules.js'))
99

1010
// create the void.
11-
var $void = sugly()
11+
var $void = eslang()
1212

1313
// prepare the path of app home directory.
14-
var appHome = path.join(__dirname, 'sugly')
14+
var appHome = path.join(__dirname, 'es')
1515

1616
if (require.main === module) {
1717
// running as an app.
1818
var args = global.process.argv.slice(2) || []
1919
module.exports = $void.$run('app', args, appHome)
2020
} else {
21-
// running as a module (exposing sugly module to JS code)
21+
// running as a module (exposing Espresso module to JS code)
2222
var being = $void.createBootstrapSpace(path.join(appHome, '@'))
2323
module.exports = being.$import('cli')
2424
}

modules.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22
/**
3-
* all native modules must be explicitly exposed to sugly code.
3+
* all native modules must be explicitly exposed to Espresso script.
44
*/
55

66
function copy (source, exporting) {
@@ -18,7 +18,7 @@ module.exports = function (uri) {
1818
case 'shelljs':
1919
return copy.bind(null, require('shelljs'))
2020
default:
21-
console.warn('Sugly code is requesting for an unknown module:', uri)
21+
console.warn('Espresso script is requesting for an unknown module:', uri)
2222
return null
2323
}
2424
}

package.json

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
{
2-
"name": "sugly-npm",
3-
"version": "0.2.1",
4-
"description": "A command line tool to create npm compatible sugly packages.",
2+
"name": "es-npm",
3+
"version": "1.0.1",
4+
"description": "A command line tool to create npm compatible Espresso script packages.",
55
"author": {
66
"email": "[email protected]",
77
"name": "Leevi Li"
88
},
99
"license": "MIT",
10-
"repository": "NirlStudio/sugly-npm",
10+
"repository": "NirlStudio/es-npm",
1111
"main": "index.js",
1212
"bin": {
13-
"hello": "bin/sugly-npm"
13+
"es-npm": "bin/es-npm"
1414
},
1515
"scripts": {
1616
"test": "mocha",
1717
"install": "scripts/install",
1818
"uninstall": "scripts/uninstall"
1919
},
2020
"keywords": [
21-
"sugly",
22-
"sugly-lang",
21+
"eslang",
22+
"espresso",
23+
"espresso-lang",
2324
"command",
2425
"line",
2526
"tool",
@@ -35,7 +36,7 @@
3536
},
3637
"dependencies": {
3738
"shelljs": "^0.8.3",
38-
"sugly": "github:NirlStudio/sugly-lang#development"
39+
"eslang": "^1.0.3"
3940
},
4041
"devDependencies": {
4142
"mocha": "^6.1.4",

scripts/install

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ PKG_NAME=$(basename $BASE_DIR)
1414
CONTAINER_DIR=$(dirname $BASE_DIR)
1515
APP_DIR=$(dirname $CONTAINER_DIR)
1616

17-
if [ $(basename $CONTAINER_DIR) == "node_modules" ] && [ -d $APP_DIR/sugly/modules ]; then
18-
ln -s $BASE_DIR/sugly $APP_DIR/sugly/modules/$PKG_NAME
17+
if [ $(basename $CONTAINER_DIR) == "node_modules" ] && [ -d $APP_DIR/es/modules ]; then
18+
ln -s $BASE_DIR/es $APP_DIR/es/modules/$PKG_NAME
1919
fi

scripts/install.cmd

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ECHO OFF
2+
3+
echo Windows is not supported yet, but it's comming soon.
4+
echo.

scripts/uninstall

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ PKG_NAME=$(basename $BASE_DIR)
1414
CONTAINER_DIR=$(dirname $BASE_DIR)
1515
APP_DIR=$(dirname $CONTAINER_DIR)
1616

17-
if [ $(basename $CONTAINER_DIR) == "node_modules" ] && [ -d $APP_DIR/sugly/modules ]; then
18-
rm $APP_DIR/sugly/modules/$PKG_NAME
17+
if [ $(basename $CONTAINER_DIR) == "node_modules" ] && [ -d $APP_DIR/es/modules ]; then
18+
rm $APP_DIR/es/modules/$PKG_NAME
1919
fi

scripts/uninstall.cmd

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ECHO OFF
2+
3+
echo Windows is not supported yet, but it's comming soon.
4+
echo.

test/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var assert = require('assert')
22

3-
describe('sugly/cli', function () {
3+
describe('es/cli', function () {
44
var cli = require('../index.js')
55

66
describe('cli', function () {

0 commit comments

Comments
 (0)