@makano/rew 1.1.73 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/coffeescript/browser.js +144 -139
- package/lib/coffeescript/cake.js +132 -133
- package/lib/coffeescript/coffeescript.js +437 -381
- package/lib/coffeescript/command.js +806 -724
- package/lib/coffeescript/grammar.js +1908 -2474
- package/lib/coffeescript/helpers.js +509 -473
- package/lib/coffeescript/index.js +228 -215
- package/lib/coffeescript/lexer.js +2282 -1909
- package/lib/coffeescript/nodes.js +9782 -9202
- package/lib/coffeescript/optparse.js +255 -227
- package/lib/coffeescript/parser.js +20305 -1265
- package/lib/coffeescript/register.js +107 -87
- package/lib/coffeescript/repl.js +307 -284
- package/lib/coffeescript/rewriter.js +1389 -1079
- package/lib/coffeescript/scope.js +176 -172
- package/lib/coffeescript/sourcemap.js +242 -227
- package/lib/rew/cli/cli.js +288 -186
- package/lib/rew/cli/log.js +31 -32
- package/lib/rew/cli/run.js +10 -12
- package/lib/rew/cli/utils.js +344 -176
- package/lib/rew/const/config_path.js +4 -0
- package/lib/rew/const/default.js +38 -35
- package/lib/rew/const/files.js +9 -9
- package/lib/rew/const/opt.js +8 -8
- package/lib/rew/css/theme.css +2 -2
- package/lib/rew/functions/core.js +55 -57
- package/lib/rew/functions/curl.js +23 -0
- package/lib/rew/functions/emitter.js +52 -55
- package/lib/rew/functions/exec.js +25 -21
- package/lib/rew/functions/export.js +18 -20
- package/lib/rew/functions/fs.js +55 -54
- package/lib/rew/functions/future.js +29 -21
- package/lib/rew/functions/id.js +8 -9
- package/lib/rew/functions/import.js +107 -93
- package/lib/rew/functions/map.js +13 -16
- package/lib/rew/functions/match.js +35 -26
- package/lib/rew/functions/path.js +8 -8
- package/lib/rew/functions/require.js +32 -33
- package/lib/rew/functions/sleep.js +2 -2
- package/lib/rew/functions/stdout.js +20 -20
- package/lib/rew/functions/types.js +96 -95
- package/lib/rew/html/ui.html +12 -13
- package/lib/rew/html/ui.js +205 -168
- package/lib/rew/main.js +14 -14
- package/lib/rew/misc/bin.js +37 -0
- package/lib/rew/misc/findAppInfo.js +16 -0
- package/lib/rew/misc/findAppPath.js +21 -0
- package/lib/rew/misc/req.js +7 -0
- package/lib/rew/misc/seededid.js +13 -0
- package/lib/rew/models/enum.js +12 -12
- package/lib/rew/models/struct.js +30 -32
- package/lib/rew/modules/compiler.js +237 -177
- package/lib/rew/modules/context.js +35 -22
- package/lib/rew/modules/fs.js +10 -10
- package/lib/rew/modules/runtime.js +17 -21
- package/lib/rew/modules/yaml.js +27 -30
- package/lib/rew/pkgs/conf.js +82 -75
- package/lib/rew/pkgs/data.js +12 -7
- package/lib/rew/pkgs/date.js +27 -28
- package/lib/rew/pkgs/env.js +6 -8
- package/lib/rew/pkgs/modules/data/bintree.js +52 -52
- package/lib/rew/pkgs/modules/data/doublylinked.js +85 -85
- package/lib/rew/pkgs/modules/data/linkedList.js +73 -73
- package/lib/rew/pkgs/modules/data/queue.js +19 -20
- package/lib/rew/pkgs/modules/data/stack.js +19 -19
- package/lib/rew/pkgs/modules/threads/worker.js +36 -26
- package/lib/rew/pkgs/modules/ui/classes.js +182 -178
- package/lib/rew/pkgs/pkgs.js +9 -10
- package/lib/rew/pkgs/rune.js +400 -0
- package/lib/rew/pkgs/threads.js +57 -53
- package/lib/rew/pkgs/ui.js +148 -136
- package/lib/rew/qrew/compile.js +12 -0
- package/package.json +11 -4
@@ -1,100 +1,120 @@
|
|
1
1
|
// Generated by CoffeeScript 2.7.0
|
2
|
-
(function() {
|
3
|
-
|
2
|
+
(function () {
|
3
|
+
var CoffeeScript,
|
4
|
+
Module,
|
5
|
+
binary,
|
6
|
+
cacheSourceMaps,
|
7
|
+
child_process,
|
8
|
+
ext,
|
9
|
+
findExtension,
|
10
|
+
fork,
|
11
|
+
getRootModule,
|
12
|
+
helpers,
|
13
|
+
i,
|
14
|
+
len,
|
15
|
+
loadFile,
|
16
|
+
nodeSourceMapsSupportEnabled,
|
17
|
+
patchStackTrace,
|
18
|
+
path,
|
19
|
+
ref,
|
20
|
+
ref1;
|
4
21
|
|
5
|
-
|
22
|
+
CoffeeScript = require('./');
|
6
23
|
|
7
|
-
|
24
|
+
child_process = require('child_process');
|
8
25
|
|
9
|
-
|
26
|
+
helpers = require('./helpers');
|
10
27
|
|
11
|
-
|
28
|
+
path = require('path');
|
12
29
|
|
13
|
-
|
30
|
+
({ patchStackTrace } = CoffeeScript);
|
14
31
|
|
15
|
-
|
16
|
-
|
32
|
+
// Check if Node's built-in source map stack trace transformations are enabled.
|
33
|
+
nodeSourceMapsSupportEnabled =
|
34
|
+
typeof process !== 'undefined' &&
|
35
|
+
process !== null &&
|
36
|
+
(process.execArgv.includes('--enable-source-maps') ||
|
37
|
+
((ref = process.env.NODE_OPTIONS) != null ? ref.includes('--enable-source-maps') : void 0));
|
17
38
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
39
|
+
if (!(Error.prepareStackTrace || nodeSourceMapsSupportEnabled)) {
|
40
|
+
cacheSourceMaps = true;
|
41
|
+
patchStackTrace();
|
42
|
+
}
|
22
43
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
44
|
+
// Load and run a CoffeeScript file for Node, stripping any `BOM`s.
|
45
|
+
loadFile = function (module, filename) {
|
46
|
+
var js, options;
|
47
|
+
options = module.options || getRootModule(module).options || {};
|
48
|
+
// Currently `CoffeeScript.compile` caches all source maps if present. They
|
49
|
+
// are available in `getSourceMap` retrieved by `filename`.
|
50
|
+
if (cacheSourceMaps || nodeSourceMapsSupportEnabled) {
|
51
|
+
options.inlineMap = true;
|
52
|
+
}
|
53
|
+
js = CoffeeScript._compileFile(filename, options);
|
54
|
+
return module._compile(js, filename);
|
55
|
+
};
|
35
56
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
57
|
+
// If the installed version of Node supports `require.extensions`, register
|
58
|
+
// CoffeeScript as an extension.
|
59
|
+
if (require.extensions) {
|
60
|
+
ref1 = CoffeeScript.FILE_EXTENSIONS;
|
61
|
+
for (i = 0, len = ref1.length; i < len; i++) {
|
62
|
+
ext = ref1[i];
|
63
|
+
require.extensions[ext] = loadFile;
|
64
|
+
}
|
65
|
+
// Patch Node's module loader to be able to handle multi-dot extensions.
|
66
|
+
// This is a horrible thing that should not be required.
|
67
|
+
Module = require('module');
|
68
|
+
findExtension = function (filename) {
|
69
|
+
var curExtension, extensions;
|
70
|
+
extensions = path.basename(filename).split('.');
|
71
|
+
if (extensions[0] === '') {
|
72
|
+
// Remove the initial dot from dotfiles.
|
73
|
+
extensions.shift();
|
74
|
+
}
|
75
|
+
// Start with the longest possible extension and work our way shortwards.
|
76
|
+
while (extensions.shift()) {
|
77
|
+
curExtension = '.' + extensions.join('.');
|
78
|
+
if (Module._extensions[curExtension]) {
|
79
|
+
return curExtension;
|
80
|
+
}
|
81
|
+
}
|
82
|
+
return '.js';
|
83
|
+
};
|
84
|
+
Module.prototype.load = function (filename) {
|
85
|
+
var extension;
|
86
|
+
this.filename = filename;
|
87
|
+
this.paths = Module._nodeModulePaths(path.dirname(filename));
|
88
|
+
extension = findExtension(filename);
|
89
|
+
Module._extensions[extension](this, filename);
|
90
|
+
return (this.loaded = true);
|
91
|
+
};
|
92
|
+
}
|
72
93
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
// Utility function to find the `options` object attached to the topmost module.
|
92
|
-
getRootModule = function(module) {
|
93
|
-
if (module.parent) {
|
94
|
-
return getRootModule(module.parent);
|
95
|
-
} else {
|
96
|
-
return module;
|
97
|
-
}
|
98
|
-
};
|
94
|
+
// If we're on Node, patch `child_process.fork` so that Coffee scripts are able
|
95
|
+
// to fork both CoffeeScript files, and JavaScript files, directly.
|
96
|
+
if (child_process) {
|
97
|
+
({ fork } = child_process);
|
98
|
+
binary = require.resolve('../../bin/coffee');
|
99
|
+
child_process.fork = function (path, args, options) {
|
100
|
+
if (helpers.isCoffee(path)) {
|
101
|
+
if (!Array.isArray(args)) {
|
102
|
+
options = args || {};
|
103
|
+
args = [];
|
104
|
+
}
|
105
|
+
args = [path].concat(args);
|
106
|
+
path = binary;
|
107
|
+
}
|
108
|
+
return fork(path, args, options);
|
109
|
+
};
|
110
|
+
}
|
99
111
|
|
112
|
+
// Utility function to find the `options` object attached to the topmost module.
|
113
|
+
getRootModule = function (module) {
|
114
|
+
if (module.parent) {
|
115
|
+
return getRootModule(module.parent);
|
116
|
+
} else {
|
117
|
+
return module;
|
118
|
+
}
|
119
|
+
};
|
100
120
|
}).call(this);
|