gant-core 0.2.5 → 0.2.6

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.
@@ -1,10 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var t=require("fs"),e=require("esbuild"),r=require("../create/config/index.js"),n=require("os"),i=require("path"),o=require("crypto"),c={exports:{}};
3
- /*!
4
- * Tmp
5
- *
6
- * Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
7
- *
8
- * MIT Licensed
9
- */
10
- !function(e){const r=t,c=n,s=i,u=o,a={fs:r.constants,os:c.constants},f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",l=/XXXXXX/,p=3,d=(a.O_CREAT||a.fs.O_CREAT)|(a.O_EXCL||a.fs.O_EXCL)|(a.O_RDWR||a.fs.O_RDWR),m="win32"===c.platform(),h=a.EBADF||a.os.errno.EBADF,v=a.ENOENT||a.os.errno.ENOENT,x=[],y=r.rmdirSync.bind(r);let E=!1;function w(t,e){return r.rm(t,{recursive:!0},e)}function b(t){return r.rmSync(t,{recursive:!0})}function D(t,e){const n=q(t,e),i=n[0],o=n[1];try{A(i)}catch(t){return o(t)}let c=i.tries;!function t(){try{const e=X(i);r.stat(e,(function(r){if(!r)return c-- >0?t():o(new Error("Could not get a unique tmp filename, max tries reached "+e));o(null,e)}))}catch(t){o(t)}}()}function C(t){const e=q(t)[0];A(e);let n=e.tries;do{const t=X(e);try{r.statSync(t)}catch(e){return t}}while(n-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function g(t,e){const n=function(t){if(t&&!_(t))return e(t);e()};0<=t[0]?r.close(t[0],(function(){r.unlink(t[1],n)})):r.unlink(t[1],n)}function S(t){let e=null;try{0<=t[0]&&r.closeSync(t[0])}catch(t){if(!(n=t,B(n,-h,"EBADF")||_(t)))throw t}finally{try{r.unlinkSync(t[1])}catch(t){_(t)||(e=t)}}var n;if(null!==e)throw e}function j(t,e,r,n){const i=O(S,[e,t],n),o=O(g,[e,t],n,i);return r.keep||x.unshift(i),n?i:o}function k(t,e,n){const i=e.unsafeCleanup?w:r.rmdir.bind(r),o=O(e.unsafeCleanup?b:y,t,n),c=O(i,t,n,o);return e.keep||x.unshift(o),n?o:c}function O(t,e,r,n){let i=!1;return function o(c){if(!i){const s=n||o,u=x.indexOf(s);return u>=0&&x.splice(u,1),i=!0,r||t===y||t===b?t(e):t(e,c||function(){})}}}function N(t){let e=[],r=null;try{r=u.randomBytes(t)}catch(e){r=u.pseudoRandomBytes(t)}for(var n=0;n<t;n++)e.push(f[r[n]%f.length]);return e.join("")}function $(t){return void 0===t}function q(t,e){if("function"==typeof t)return[{},t];if($(t))return[{},e];const r={};for(const e of Object.getOwnPropertyNames(t))r[e]=t[e];return[r,e]}function X(t){const e=t.tmpdir;if(!$(t.name))return s.join(e,t.dir,t.name);if(!$(t.template))return s.join(e,t.dir,t.template).replace(l,N(6));const r=[t.prefix?t.prefix:"tmp","-",process.pid,"-",N(12),t.postfix?"-"+t.postfix:""].join("");return s.join(e,t.dir,r)}function A(t){t.tmpdir=T(t);const e=t.tmpdir;if($(t.name)||R(t.name,"name",e),$(t.dir)||R(t.dir,"dir",e),!$(t.template)&&(R(t.template,"template",e),!t.template.match(l)))throw new Error(`Invalid template, found "${t.template}".`);if(!$(t.tries)&&isNaN(t.tries)||t.tries<0)throw new Error(`Invalid tries, found "${t.tries}".`);var r;t.tries=$(t.name)?t.tries||p:1,t.keep=!!t.keep,t.detachDescriptor=!!t.detachDescriptor,t.discardDescriptor=!!t.discardDescriptor,t.unsafeCleanup=!!t.unsafeCleanup,t.dir=$(t.dir)?"":s.relative(e,F(t.dir,e)),t.template=$(t.template)?void 0:s.relative(e,F(t.template,e)),t.template=null===(r=t.template)||$(r)||!r.trim()?void 0:s.relative(t.dir,t.template),t.name=$(t.name)?void 0:t.name,t.prefix=$(t.prefix)?"":t.prefix,t.postfix=$(t.postfix)?"":t.postfix}function F(t,e){return t.startsWith(e)?s.resolve(t):s.resolve(s.join(e,t))}function R(t,e,r){if("name"===e){if(s.isAbsolute(t))throw new Error(`${e} option must not contain an absolute path, found "${t}".`);let r=s.basename(t);if(".."===r||"."===r||r!==t)throw new Error(`${e} option must not contain a path, found "${t}".`)}else{if(s.isAbsolute(t)&&!t.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${t}".`);let n=F(t,r);if(!n.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${n}".`)}}function _(t){return B(t,-v,"ENOENT")}function B(t,e,r){return m?t.code===r:t.code===r&&t.errno===e}function T(t){return s.resolve(t&&t.tmpdir||c.tmpdir())}process.addListener("exit",(function(){if(E)for(;x.length;)try{x[0]()}catch(t){}})),Object.defineProperty(e.exports,"tmpdir",{enumerable:!0,configurable:!1,get:function(){return T()}}),e.exports.dir=function(t,e){const n=q(t,e),i=n[0],o=n[1];D(i,(function(t,e){if(t)return o(t);r.mkdir(e,i.mode||448,(function(t){if(t)return o(t);o(null,e,k(e,i,!1))}))}))},e.exports.dirSync=function(t){const e=q(t)[0],n=C(e);return r.mkdirSync(n,e.mode||448),{name:n,removeCallback:k(n,e,!0)}},e.exports.file=function(t,e){const n=q(t,e),i=n[0],o=n[1];D(i,(function(t,e){if(t)return o(t);r.open(e,d,i.mode||384,(function(t,n){if(t)return o(t);if(i.discardDescriptor)return r.close(n,(function(t){return o(t,e,void 0,j(e,-1,i,!1))}));{const t=i.discardDescriptor||i.detachDescriptor;o(null,e,n,j(e,t?-1:n,i,!1))}}))}))},e.exports.fileSync=function(t){const e=q(t)[0],n=e.discardDescriptor||e.detachDescriptor,i=C(e);var o=r.openSync(i,d,e.mode||384);return e.discardDescriptor&&(r.closeSync(o),o=void 0),{name:i,fd:o,removeCallback:j(i,n?-1:o,e,!0)}},e.exports.tmpName=D,e.exports.tmpNameSync=C,e.exports.setGracefulCleanup=function(){E=!0}}(c);var s=c.exports,u=r.getDefaultExportFromCjs(s);exports.getJavascriptfile=function(r){try{const{outputFiles:n}=e.buildSync({entryPoints:[r],bundle:!0,format:"cjs",write:!1,platform:"node",tsconfig:i.resolve(__dirname,"../template/template.package.json")});if(n){const e=i.dirname(r),o=n[0].text,c=u.fileSync({tmpdir:e,prefix:"temp-",postfix:".js"});t.writeFileSync(c.name,o);const s=require(c.name).default;return c.removeCallback(),s}return console.error("No output files generated."),{}}catch(t){return console.log("GetJavascriptFile Error:",t),{}}};
2
+ "use strict";var e=require("path"),t=require("module"),r="undefined"!=typeof document?document.currentScript:null;const s=t.createRequire("undefined"==typeof document?require("url").pathToFileURL(__filename).href:r&&r.src||new URL("utils/getJavascriptfile.js",document.baseURI).href);exports.getJavascriptfile=function(t){const r=e.resolve(t);if(r.endsWith(".ts")){s("ts-node").register({transpileOnly:!0,compilerOptions:{module:"commonjs"}})}let n;s("@babel/register")({extensions:[".js",".ts"],presets:["@babel/preset-env"],plugins:["@babel/plugin-transform-modules-commonjs"]});try{n=s(r)}catch(e){throw new Error(`Failed to load config file: ${e.message}`)}return n.default||n};