@yr-lang/yr 0.3.10 → 0.3.12

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/%build.yr CHANGED
@@ -1,3 +1,4 @@
1
1
  **
2
2
 
3
3
  cd "$_PROJECT_PATH"
4
+ if [[ ! -d node_modules ]]; then npm i $(cat node_modules.txt); fi
package/lib/%serve.yr CHANGED
@@ -4,7 +4,6 @@ ___serve
4
4
 
5
5
  APP_NAME=$(echo $_CONFIG | jq -r .name)
6
6
  cd $_PROJECT_PATH
7
- if [[ ! -d node_modules ]]; then npm i $(cat node_modules.txt); fi
8
7
 
9
8
  pkill -9 -f "^node app/app.js$"
10
9
  node app/app.js
package/node.js CHANGED
@@ -430,8 +430,13 @@ const window = {
430
430
  __api: '',
431
431
  };
432
432
  const fs = require('fs');
433
- let _PROJECT_PATH = '${parsePaths(projectPath)}';
434
433
  const _globals = [];
434
+ function setGlobal(name, item, subscribe=false) {
435
+ if (!_globals.includes(name) || subscribe) {
436
+ global[name] = item;
437
+ _globals.push(name);
438
+ }
439
+ }
435
440
  function parsePaths(newPaths) {
436
441
  let newStrPath = [];
437
442
  for (let item of newPaths.split(',')) {
@@ -442,15 +447,17 @@ function parsePaths(newPaths) {
442
447
 
443
448
  return newStrPath.join(',');
444
449
  }
445
- function setGlobal(name, item, subscribe=false) {
446
- if (!_globals.includes(name) || subscribe) {
447
- global[name] = item;
448
- _globals.push(name);
449
- }
450
- }
450
+ setGlobal('path', require('path'));
451
+ let _PROJECT_PATH = '${parsePaths(projectPath)}';
451
452
  _PROJECT_PATH = parsePaths(_PROJECT_PATH);
452
- const _config = require(\`\${_PROJECT_PATH}/yrconfig.json\`);
453
- const env = require(\`\${_PROJECT_PATH}/.env.json\`);
453
+ //const _PROJECT_PATH = path.resolve(process.cwd(), '..');
454
+ const PROJECT_PATH = _PROJECT_PATH;
455
+ //const _config = require(\`\${_PROJECT_PATH}/yrconfig.json\`);
456
+ //const env = require(\`\${_PROJECT_PATH}/.env.json\`);
457
+ const _config = JSON.parse(
458
+ fs.readFileSync(path.join(PROJECT_PATH, 'yrconfig.json'), 'utf8'));
459
+ const env = JSON.parse(
460
+ fs.readFileSync(path.join(PROJECT_PATH, '.env.json'), 'utf8'));
454
461
  for (let item of ['HOME', 'LIBS', 'BUILDS', 'TREE', 'CONFIG']) {
455
462
  if (typeof env[item] === 'object') {
456
463
  env[item] = parsePaths(env[item].join(',')).split(',');
@@ -503,10 +510,8 @@ for (let item of ['HOME', 'LIBS', 'BUILDS', 'TREE', 'CONFIG']) {
503
510
  *\:Zone.Identifier
504
511
  node_modules/
505
512
  __pycache__/
506
- dist/
507
- .yrkitconf
508
513
  package*.json
509
- app/assets/`);
514
+ .yrkitconf`);
510
515
 
511
516
  fs.writeFileSync(projectPath + '/yrconfig.json', JSON.stringify(result.config, null, 2));
512
517
  fs.writeFileSync(projectPath + '/app/app.js', result.app);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yr-lang/yr",
3
- "version": "0.3.10",
3
+ "version": "0.3.12",
4
4
  "description": "Yr is a modern structural language and parser",
5
5
  "main": "./node.js",
6
6
  "exports": {