@makano/rew 1.2.97 → 1.2.99

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.
@@ -44,6 +44,11 @@ function runFileWithArgv(filePath, options = {}, cargv) {
44
44
  }
45
45
  if (argv.includes('--')) {
46
46
  argv = argv.slice(argv.indexOf('--') + 1, argv.length);
47
+ } else {
48
+ const index = argv.find(p => filePath.endsWith(p.replace(/(\.|\.\.)\//, '/')));
49
+ if(index){
50
+ argv = argv.slice(argv.indexOf(index) + 1, argv.length);
51
+ }
47
52
  }
48
53
  runFile(filePath, options, argv);
49
54
  }
@@ -46,7 +46,7 @@ module.exports.imp = function (runPath, context) {
46
46
  if(filename == 'std' || filename == '#std') return {};
47
47
  let type = options.type ? options.type : filename.endsWith('.coffee') ? 'coffee' : (
48
48
  filename.endsWith(REW_FILE_TYPE.EXTENSION) ? REW_FILE_TYPE.TYPE :
49
- path.extname(filename).slice(1)
49
+ 'coffee'
50
50
  );
51
51
  let exports,
52
52
  ispkg = findPackage(filename);
@@ -71,7 +71,7 @@ module.exports.imp = function (runPath, context) {
71
71
  const foundCache = cachedFiles.find((f) => f.filepath == type+':'+filepath);
72
72
 
73
73
  if (!ispkg && foundCache) {
74
- exports = options.useDefaultForPackages === false ? foundCache.exports.default || foundCache.exports : _returns(options, foundCache.exports);
74
+ exports = type === 'coffee' || type === REW_FILE_TYPE.EXTENSION ? foundCache.exports : options.useDefaultForPackages === false ? foundCache.exports.default || foundCache.exports : _returns(options, foundCache.exports);
75
75
  }
76
76
 
77
77
  if (!ispkg && !existsSync(filepath) && !foundCache) {
@@ -407,6 +407,20 @@ function compileRewStuff(content, options) {
407
407
  straceLog('APP_PACKAGE_CHANGE()');
408
408
  }
409
409
 
410
+ if (
411
+ token.type === 'OTHER' && token.value === '-' &&
412
+ nextToken.type == 'IDENTIFIER' && nextToken.value === 'wait'
413
+ ) {
414
+ const { token: nextNextToken } = gnextToken(i, 2, tokens) || {};
415
+ if(nextNextToken?.type == 'IDENTIFIER'){
416
+ token.value = '';
417
+ hooks.push({
418
+ index: i + 3,
419
+ value: ','
420
+ });
421
+ }
422
+ }
423
+
410
424
  if (token.type === 'IDENTIFIER' && token.value === 'using' && !options.disableUse) {
411
425
  straceLog('USING()');
412
426
  const next = nextToken.value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makano/rew",
3
- "version": "1.2.97",
3
+ "version": "1.2.99",
4
4
  "description": "A simple coffescript runtime and app manager",
5
5
  "main": "main.js",
6
6
  "directories": {