@taqueria/toolkit 0.56.15 → 0.57.8
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/bin/run.js +3 -6
- package/bin/run.js.map +1 -1
- package/{chunk-UWGPOHCN.js → chunk-C4IKSAN2.js} +2 -3
- package/{chunk-UWGPOHCN.js.map → chunk-C4IKSAN2.js.map} +1 -1
- package/{chunk-CSAU5B4Q.js → chunk-PZ5AY32C.js} +1 -1
- package/{chunk-WNTV7OJQ.js → chunk-XL5LTAAT.js} +2 -2
- package/index.d.ts +1 -1
- package/index.js +4 -5
- package/index.js.map +1 -1
- package/lib/env.d.ts +1 -1
- package/package.json +87 -87
- package/tsconfig.json +5 -1
- package/v1.js +2 -2
- package/v2.js +2 -2
- /package/{chunk-CSAU5B4Q.js.map → chunk-PZ5AY32C.js.map} +0 -0
- /package/{chunk-WNTV7OJQ.js.map → chunk-XL5LTAAT.js.map} +0 -0
package/bin/run.js
CHANGED
|
@@ -34,8 +34,7 @@ async function getConfig(taqDir, prefix) {
|
|
|
34
34
|
const files = await readdir(taqDir);
|
|
35
35
|
return files.reduce(
|
|
36
36
|
async (retval, file) => {
|
|
37
|
-
if (!file.endsWith(".json"))
|
|
38
|
-
return await retval;
|
|
37
|
+
if (!file.endsWith(".json")) return await retval;
|
|
39
38
|
return {
|
|
40
39
|
...await retval,
|
|
41
40
|
[getEnvName(file, prefix)]: await readFile(path.join(taqDir, file), "utf-8")
|
|
@@ -64,8 +63,7 @@ async function getEncodedConfig(taqDir, prefix) {
|
|
|
64
63
|
|
|
65
64
|
// bin/run.ts
|
|
66
65
|
function withArguments(cliArgs, fn) {
|
|
67
|
-
if (cliArgs[0].endsWith("node"))
|
|
68
|
-
cliArgs.shift();
|
|
66
|
+
if (cliArgs[0].endsWith("node")) cliArgs.shift();
|
|
69
67
|
const script = cliArgs.shift();
|
|
70
68
|
const parsedArgs = yargs(cliArgs).option("projectDir", {
|
|
71
69
|
alias: "p",
|
|
@@ -78,8 +76,7 @@ function withArguments(cliArgs, fn) {
|
|
|
78
76
|
}).global(["projectDir"]).parseSync();
|
|
79
77
|
if (parsedArgs._.length > 0 && parsedArgs.projectDir) {
|
|
80
78
|
fn(parsedArgs.projectDir, parsedArgs.prefix, parsedArgs._.join(" "));
|
|
81
|
-
} else
|
|
82
|
-
console.log(`Usage: ${script} --projectDir <projectDir> [--prefix <prefix>] <command>`);
|
|
79
|
+
} else console.log(`Usage: ${script} --projectDir <projectDir> [--prefix <prefix>] <command>`);
|
|
83
80
|
}
|
|
84
81
|
function toCommandWithEnvVars(cmd, config) {
|
|
85
82
|
return Object.entries(config).reduce(
|
package/bin/run.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["run.ts","../lib/env.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { spawn } from 'cross-spawn';\nimport path from 'path';\nimport yargs from 'yargs';\nimport { checkTaqProject, getEncodedConfig, isCustomError } from '../lib/env';\n\nfunction withArguments(cliArgs: string[], fn: (projectDir: string, prefix: string, cmd: string) => Promise<void>) {\n\tif (cliArgs[0].endsWith('node')) cliArgs.shift();\n\n\tconst script = cliArgs.shift();\n\n\tconst parsedArgs = yargs(cliArgs)\n\t\t.option('projectDir', {\n\t\t\talias: 'p',\n\t\t\ttype: 'string',\n\t\t\trequiresArg: true,\n\t\t})\n\t\t.option('prefix', {\n\t\t\ttype: 'string',\n\t\t\trequiresArg: true,\n\t\t\tdefault: '',\n\t\t})\n\t\t.global(['projectDir'])\n\t\t.parseSync();\n\n\tif (parsedArgs._.length > 0 && parsedArgs.projectDir) {\n\t\tfn(parsedArgs.projectDir, parsedArgs.prefix, parsedArgs._.join(' '));\n\t} else console.log(`Usage: ${script} --projectDir <projectDir> [--prefix <prefix>] <command>`);\n}\n\nfunction toCommandWithEnvVars(cmd: string, config: Record<string, string>) {\n\treturn Object.entries(config).reduce(\n\t\t(retval, [key, value]) => {\n\t\t\ttry {\n\t\t\t\treturn `${key}=${value} ${retval}`;\n\t\t\t} catch (err) {\n\t\t\t\tconsole.warn(`Could not set ${key}`);\n\t\t\t\tconsole.warn('Check the contents of the associated file and ensure that it can be Base64 encoded.');\n\t\t\t\treturn retval;\n\t\t\t}\n\t\t},\n\t\tcmd,\n\t);\n}\n\nasync function run(projectDir: string, prefix: string, cmd: string) {\n\ttry {\n\t\tconst taqDir = await checkTaqProject(projectDir);\n\t\tconst config = await getEncodedConfig(taqDir, prefix);\n\t\tconst cmdWithEnvVars = toCommandWithEnvVars(cmd, config);\n\n\t\tspawn(cmdWithEnvVars, {\n\t\t\tshell: true,\n\t\t\tstdio: 'inherit',\n\t\t});\n\t} catch (err) {\n\t\tif (isCustomError(err)) {\n\t\t\tconsole.error(err.message);\n\t\t\treturn;\n\t\t}\n\t\tthrow err;\n\t}\n}\n\nwithArguments(process.argv, run);\n","import { readdir, readFile, stat } from 'fs/promises';\nimport path from 'path';\n\nclass CustomErr extends Error {}\n\nexport class TaqNotFoundError extends CustomErr {\n\tpublic isCustomErr = true;\n}\n\nexport function isCustomError(err: unknown): err is Error {\n\treturn typeof err === 'object' && (err as object).hasOwnProperty('isCustomErr');\n}\n\nexport async function checkTaqProject(dir: string) {\n\ttry {\n\t\tconst searchPath = path.join(dir, '.taq');\n\t\tawait stat(searchPath);\n\t\treturn searchPath;\n\t} catch {\n\t\tthrow new TaqNotFoundError(`${dir} is not a valid Taqueria project.`);\n\t}\n}\n\nfunction getEnvName(filename: string, prefix = '') {\n\treturn `${prefix}TAQ_${filename}`\n\t\t.replace('.json', '')\n\t\t.replace(/\\./mg, '_')\n\t\t.replace(/\\-/mg, '_')\n\t\t.toUpperCase();\n}\n\nexport class TaqConfigError extends CustomErr {}\nexport async function getConfig(taqDir: string, prefix: string) {\n\ttry {\n\t\tconst files = await readdir(taqDir);\n\t\treturn files.reduce(\n\t\t\tasync (retval, file) => {\n\t\t\t\tif (!file.endsWith('.json')) return (await retval);\n\t\t\t\treturn {\n\t\t\t\t\t...(await retval),\n\t\t\t\t\t[getEnvName(file, prefix)]: await readFile(path.join(taqDir, file), 'utf-8'),\n\t\t\t\t};\n\t\t\t},\n\t\t\tPromise.resolve({}),\n\t\t);\n\t} catch {\n\t\tthrow new TaqConfigError(\n\t\t\t`There was a problem reading the config files in ${taqDir}. Please check file permissions are try again.`,\n\t\t);\n\t}\n}\n\nexport function encode(value: string) {\n\tconst buffer = Buffer.from(value, 'utf8');\n\treturn buffer.toString('base64');\n}\n\nexport async function getEncodedConfig(taqDir: string, prefix: string) {\n\tconst config = await getConfig(taqDir, prefix);\n\treturn Object.fromEntries(\n\t\tObject.entries(config).map(\n\t\t\t([k, v]) => [k, encode(v as string)],\n\t\t),\n\t);\n}\n\nexport async function getEnv(env: typeof process.env, taqDir: string, prefix: string = '') {\n\tconst realTaqDir = await checkTaqProject(taqDir);\n\treturn {\n\t\t...env,\n\t\t...await getEncodedConfig(realTaqDir, prefix),\n\t};\n}\n"],"mappings":";;;AACA,SAAS,aAAa;AAEtB,OAAO,WAAW;;;ACHlB,SAAS,SAAS,UAAU,YAAY;AACxC,OAAO,UAAU;AAEjB,IAAM,YAAN,cAAwB,MAAM;AAAC;AAExB,IAAM,mBAAN,cAA+B,UAAU;AAAA,EACxC,cAAc;AACtB;AAEO,SAAS,cAAc,KAA4B;AACzD,SAAO,OAAO,QAAQ,YAAa,IAAe,eAAe,aAAa;AAC/E;AAEA,eAAsB,gBAAgB,KAAa;AAClD,MAAI;AACH,UAAM,aAAa,KAAK,KAAK,KAAK,MAAM;AACxC,UAAM,KAAK,UAAU;AACrB,WAAO;AAAA,EACR,QAAQ;AACP,UAAM,IAAI,iBAAiB,GAAG,GAAG,mCAAmC;AAAA,EACrE;AACD;AAEA,SAAS,WAAW,UAAkB,SAAS,IAAI;AAClD,SAAO,GAAG,MAAM,OAAO,QAAQ,GAC7B,QAAQ,SAAS,EAAE,EACnB,QAAQ,QAAQ,GAAG,EACnB,QAAQ,QAAQ,GAAG,EACnB,YAAY;AACf;AAEO,IAAM,iBAAN,cAA6B,UAAU;AAAC;AAC/C,eAAsB,UAAU,QAAgB,QAAgB;AAC/D,MAAI;AACH,UAAM,QAAQ,MAAM,QAAQ,MAAM;AAClC,WAAO,MAAM;AAAA,MACZ,OAAO,QAAQ,SAAS;AACvB,YAAI,CAAC,KAAK,SAAS,OAAO
|
|
1
|
+
{"version":3,"sources":["run.ts","../lib/env.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { spawn } from 'cross-spawn';\nimport path from 'path';\nimport yargs from 'yargs';\nimport { checkTaqProject, getEncodedConfig, isCustomError } from '../lib/env';\n\nfunction withArguments(cliArgs: string[], fn: (projectDir: string, prefix: string, cmd: string) => Promise<void>) {\n\tif (cliArgs[0].endsWith('node')) cliArgs.shift();\n\n\tconst script = cliArgs.shift();\n\n\tconst parsedArgs = yargs(cliArgs)\n\t\t.option('projectDir', {\n\t\t\talias: 'p',\n\t\t\ttype: 'string',\n\t\t\trequiresArg: true,\n\t\t})\n\t\t.option('prefix', {\n\t\t\ttype: 'string',\n\t\t\trequiresArg: true,\n\t\t\tdefault: '',\n\t\t})\n\t\t.global(['projectDir'])\n\t\t.parseSync();\n\n\tif (parsedArgs._.length > 0 && parsedArgs.projectDir) {\n\t\tfn(parsedArgs.projectDir, parsedArgs.prefix, parsedArgs._.join(' '));\n\t} else console.log(`Usage: ${script} --projectDir <projectDir> [--prefix <prefix>] <command>`);\n}\n\nfunction toCommandWithEnvVars(cmd: string, config: Record<string, string>) {\n\treturn Object.entries(config).reduce(\n\t\t(retval, [key, value]) => {\n\t\t\ttry {\n\t\t\t\treturn `${key}=${value} ${retval}`;\n\t\t\t} catch (err) {\n\t\t\t\tconsole.warn(`Could not set ${key}`);\n\t\t\t\tconsole.warn('Check the contents of the associated file and ensure that it can be Base64 encoded.');\n\t\t\t\treturn retval;\n\t\t\t}\n\t\t},\n\t\tcmd,\n\t);\n}\n\nasync function run(projectDir: string, prefix: string, cmd: string) {\n\ttry {\n\t\tconst taqDir = await checkTaqProject(projectDir);\n\t\tconst config = await getEncodedConfig(taqDir, prefix);\n\t\tconst cmdWithEnvVars = toCommandWithEnvVars(cmd, config);\n\n\t\tspawn(cmdWithEnvVars, {\n\t\t\tshell: true,\n\t\t\tstdio: 'inherit',\n\t\t});\n\t} catch (err) {\n\t\tif (isCustomError(err)) {\n\t\t\tconsole.error(err.message);\n\t\t\treturn;\n\t\t}\n\t\tthrow err;\n\t}\n}\n\nwithArguments(process.argv, run);\n","import { readdir, readFile, stat } from 'fs/promises';\nimport path from 'path';\n\nclass CustomErr extends Error {}\n\nexport class TaqNotFoundError extends CustomErr {\n\tpublic isCustomErr = true;\n}\n\nexport function isCustomError(err: unknown): err is Error {\n\treturn typeof err === 'object' && (err as object).hasOwnProperty('isCustomErr');\n}\n\nexport async function checkTaqProject(dir: string) {\n\ttry {\n\t\tconst searchPath = path.join(dir, '.taq');\n\t\tawait stat(searchPath);\n\t\treturn searchPath;\n\t} catch {\n\t\tthrow new TaqNotFoundError(`${dir} is not a valid Taqueria project.`);\n\t}\n}\n\nfunction getEnvName(filename: string, prefix = '') {\n\treturn `${prefix}TAQ_${filename}`\n\t\t.replace('.json', '')\n\t\t.replace(/\\./mg, '_')\n\t\t.replace(/\\-/mg, '_')\n\t\t.toUpperCase();\n}\n\nexport class TaqConfigError extends CustomErr {}\nexport async function getConfig(taqDir: string, prefix: string) {\n\ttry {\n\t\tconst files = await readdir(taqDir);\n\t\treturn files.reduce(\n\t\t\tasync (retval, file) => {\n\t\t\t\tif (!file.endsWith('.json')) return (await retval);\n\t\t\t\treturn {\n\t\t\t\t\t...(await retval),\n\t\t\t\t\t[getEnvName(file, prefix)]: await readFile(path.join(taqDir, file), 'utf-8'),\n\t\t\t\t};\n\t\t\t},\n\t\t\tPromise.resolve({}),\n\t\t);\n\t} catch {\n\t\tthrow new TaqConfigError(\n\t\t\t`There was a problem reading the config files in ${taqDir}. Please check file permissions are try again.`,\n\t\t);\n\t}\n}\n\nexport function encode(value: string) {\n\tconst buffer = Buffer.from(value, 'utf8');\n\treturn buffer.toString('base64');\n}\n\nexport async function getEncodedConfig(taqDir: string, prefix: string) {\n\tconst config = await getConfig(taqDir, prefix);\n\treturn Object.fromEntries(\n\t\tObject.entries(config).map(\n\t\t\t([k, v]) => [k, encode(v as string)],\n\t\t),\n\t);\n}\n\nexport async function getEnv(env: typeof process.env, taqDir: string, prefix: string = '') {\n\tconst realTaqDir = await checkTaqProject(taqDir);\n\treturn {\n\t\t...env,\n\t\t...await getEncodedConfig(realTaqDir, prefix),\n\t};\n}\n"],"mappings":";;;AACA,SAAS,aAAa;AAEtB,OAAO,WAAW;;;ACHlB,SAAS,SAAS,UAAU,YAAY;AACxC,OAAO,UAAU;AAEjB,IAAM,YAAN,cAAwB,MAAM;AAAC;AAExB,IAAM,mBAAN,cAA+B,UAAU;AAAA,EACxC,cAAc;AACtB;AAEO,SAAS,cAAc,KAA4B;AACzD,SAAO,OAAO,QAAQ,YAAa,IAAe,eAAe,aAAa;AAC/E;AAEA,eAAsB,gBAAgB,KAAa;AAClD,MAAI;AACH,UAAM,aAAa,KAAK,KAAK,KAAK,MAAM;AACxC,UAAM,KAAK,UAAU;AACrB,WAAO;AAAA,EACR,QAAQ;AACP,UAAM,IAAI,iBAAiB,GAAG,GAAG,mCAAmC;AAAA,EACrE;AACD;AAEA,SAAS,WAAW,UAAkB,SAAS,IAAI;AAClD,SAAO,GAAG,MAAM,OAAO,QAAQ,GAC7B,QAAQ,SAAS,EAAE,EACnB,QAAQ,QAAQ,GAAG,EACnB,QAAQ,QAAQ,GAAG,EACnB,YAAY;AACf;AAEO,IAAM,iBAAN,cAA6B,UAAU;AAAC;AAC/C,eAAsB,UAAU,QAAgB,QAAgB;AAC/D,MAAI;AACH,UAAM,QAAQ,MAAM,QAAQ,MAAM;AAClC,WAAO,MAAM;AAAA,MACZ,OAAO,QAAQ,SAAS;AACvB,YAAI,CAAC,KAAK,SAAS,OAAO,EAAG,QAAQ,MAAM;AAC3C,eAAO;AAAA,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EAAE;AAAA,IAC7B,CAAC,QAAQ,CAAC,KAAK,KAAK,MAAM;AACzB,UAAI;AACH,eAAO,GAAG,GAAG,IAAI,KAAK,IAAI,MAAM;AAAA,MACjC,SAAS,KAAK;AACb,gBAAQ,KAAK,iBAAiB,GAAG,EAAE;AACnC,gBAAQ,KAAK,qFAAqF;AAClG,eAAO;AAAA,MACR;AAAA,IACD;AAAA,IACA;AAAA,EACD;AACD;AAEA,eAAe,IAAI,YAAoB,QAAgB,KAAa;AACnE,MAAI;AACH,UAAM,SAAS,MAAM,gBAAgB,UAAU;AAC/C,UAAM,SAAS,MAAM,iBAAiB,QAAQ,MAAM;AACpD,UAAM,iBAAiB,qBAAqB,KAAK,MAAM;AAEvD,UAAM,gBAAgB;AAAA,MACrB,OAAO;AAAA,MACP,OAAO;AAAA,IACR,CAAC;AAAA,EACF,SAAS,KAAK;AACb,QAAI,cAAc,GAAG,GAAG;AACvB,cAAQ,MAAM,IAAI,OAAO;AACzB;AAAA,IACD;AACA,UAAM;AAAA,EACP;AACD;AAEA,cAAc,QAAQ,MAAM,GAAG;","names":[]}
|
|
@@ -5,8 +5,7 @@ var getCurrentEnv = (config) => {
|
|
|
5
5
|
};
|
|
6
6
|
var getAliasAddress = (config, alias) => {
|
|
7
7
|
const currentEnv = getCurrentEnv(config);
|
|
8
|
-
if (currentEnv?.aliases?.[alias]?.address)
|
|
9
|
-
return currentEnv.aliases[alias].address;
|
|
8
|
+
if (currentEnv?.aliases?.[alias]?.address) return currentEnv.aliases[alias].address;
|
|
10
9
|
alert(`Address for alias, ${alias}, is missing. Please deploy a contract with such alias`);
|
|
11
10
|
return "";
|
|
12
11
|
};
|
|
@@ -15,4 +14,4 @@ export {
|
|
|
15
14
|
getCurrentEnv,
|
|
16
15
|
getAliasAddress
|
|
17
16
|
};
|
|
18
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-C4IKSAN2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["v1.ts"],"sourcesContent":["import * as Config from '@taqueria/protocol/Config';\nimport * as Environment from '@taqueria/protocol/Environment';\n\nexport const getCurrentEnv = (config: Config.t): Environment.t | undefined => {\n\tconst currentEnv = config?.environment?.default ? config.environment.default as string : 'development';\n\treturn config.environment && config.environment[currentEnv]\n\t\t? config.environment[currentEnv] as Environment.t | undefined\n\t\t: undefined;\n};\n\nexport const getAliasAddress = (config: any, alias: string): string => {\n\tconst currentEnv = getCurrentEnv(config);\n\tif (currentEnv?.aliases?.[alias]?.address) return currentEnv.aliases[alias].address;\n\talert(`Address for alias, ${alias}, is missing. Please deploy a contract with such alias`);\n\treturn '';\n};\n"],"mappings":";AAGO,IAAM,gBAAgB,CAAC,WAAgD;AAC7E,QAAM,aAAa,QAAQ,aAAa,UAAU,OAAO,YAAY,UAAoB;AACzF,SAAO,OAAO,eAAe,OAAO,YAAY,UAAU,IACvD,OAAO,YAAY,UAAU,IAC7B;AACJ;AAEO,IAAM,kBAAkB,CAAC,QAAa,UAA0B;AACtE,QAAM,aAAa,cAAc,MAAM;AACvC,MAAI,YAAY,UAAU,KAAK,GAAG
|
|
1
|
+
{"version":3,"sources":["v1.ts"],"sourcesContent":["import * as Config from '@taqueria/protocol/Config';\nimport * as Environment from '@taqueria/protocol/Environment';\n\nexport const getCurrentEnv = (config: Config.t): Environment.t | undefined => {\n\tconst currentEnv = config?.environment?.default ? config.environment.default as string : 'development';\n\treturn config.environment && config.environment[currentEnv]\n\t\t? config.environment[currentEnv] as Environment.t | undefined\n\t\t: undefined;\n};\n\nexport const getAliasAddress = (config: any, alias: string): string => {\n\tconst currentEnv = getCurrentEnv(config);\n\tif (currentEnv?.aliases?.[alias]?.address) return currentEnv.aliases[alias].address;\n\talert(`Address for alias, ${alias}, is missing. Please deploy a contract with such alias`);\n\treturn '';\n};\n"],"mappings":";AAGO,IAAM,gBAAgB,CAAC,WAAgD;AAC7E,QAAM,aAAa,QAAQ,aAAa,UAAU,OAAO,YAAY,UAAoB;AACzF,SAAO,OAAO,eAAe,OAAO,YAAY,UAAU,IACvD,OAAO,YAAY,UAAU,IAC7B;AACJ;AAEO,IAAM,kBAAkB,CAAC,QAAa,UAA0B;AACtE,QAAM,aAAa,cAAc,MAAM;AACvC,MAAI,YAAY,UAAU,KAAK,GAAG,QAAS,QAAO,WAAW,QAAQ,KAAK,EAAE;AAC5E,QAAM,sBAAsB,KAAK,wDAAwD;AACzF,SAAO;AACR;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PZ5AY32C.js";
|
|
4
4
|
|
|
5
5
|
// v2.ts
|
|
6
6
|
var v2_exports = {};
|
|
@@ -47,4 +47,4 @@ export {
|
|
|
47
47
|
getContractAddress,
|
|
48
48
|
v2_exports
|
|
49
49
|
};
|
|
50
|
-
//# sourceMappingURL=chunk-
|
|
50
|
+
//# sourceMappingURL=chunk-XL5LTAAT.js.map
|
package/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ declare const isTaqError: (err: unknown) => err is TaqError;
|
|
|
13
13
|
declare const getConfigAsV1: (env: Record<string, string | undefined>, prefix?: string) => Config.t;
|
|
14
14
|
declare function getConfigV2(env: Record<string, string | undefined>, prefix?: string): transform.ConfigFileSetV2;
|
|
15
15
|
declare const getAliasAddress: (config: any, alias: string) => string;
|
|
16
|
-
declare const getCurrentEnv: (config: Config.
|
|
16
|
+
declare const getCurrentEnv: (config: Config.t) => _taqueria_protocol_Environment.t | undefined;
|
|
17
17
|
|
|
18
18
|
type ConfigFileSetV2 = transform.ConfigFileSetV2;
|
|
19
19
|
|
package/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getAliasAddress,
|
|
3
3
|
getCurrentEnv
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-C4IKSAN2.js";
|
|
5
5
|
import {
|
|
6
6
|
TaqError,
|
|
7
7
|
isTaqError,
|
|
8
8
|
v2_exports
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-XL5LTAAT.js";
|
|
10
|
+
import "./chunk-PZ5AY32C.js";
|
|
11
11
|
|
|
12
12
|
// index.ts
|
|
13
13
|
import * as Config from "@taqueria/protocol/Config";
|
|
@@ -82,8 +82,7 @@ var getConfigAsV1 = (env, prefix = DEFAULT_ENV_VAR_PREFIX) => {
|
|
|
82
82
|
const { getRawConfig, getEnvironmentConfig } = withEnv(withFixedEnv(env), prefix);
|
|
83
83
|
const rawConfig = getRawConfig();
|
|
84
84
|
try {
|
|
85
|
-
if (!rawConfig.version || rawConfig.version.toLowerCase() === "v1")
|
|
86
|
-
return Config.from(rawConfig);
|
|
85
|
+
if (!rawConfig.version || rawConfig.version.toLowerCase() === "v1") return Config.from(rawConfig);
|
|
87
86
|
else if (rawConfig.version.toLowerCase() === "v2") {
|
|
88
87
|
const config = ConfigFileV2.from(rawConfig);
|
|
89
88
|
const environments = Object.keys(config.environments ?? {}).reduce(
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["import * as Config from '@taqueria/protocol/Config';\nimport * as ConfigEnvironmentFileV2 from '@taqueria/protocol/ConfigEnvironmentFileV2';\nimport * as ConfigFileV2 from '@taqueria/protocol/ConfigFileV2';\nimport { isTaqError, TaqError } from './TaqError';\nexport { isTaqError, TaqError } from './TaqError';\nimport * as V1 from './v1';\nexport * as V2 from './v2';\nimport * as transform from '@taqueria/protocol/types-config-files';\nimport { Buffer } from 'buffer';\n\nconst DEFAULT_ENV_VAR_PREFIX = '';\n\nfunction withFixedEnv(env: Record<string, string | undefined>) {\n\treturn Object.entries(env).reduce(\n\t\t(acc, [key, value]) => {\n\t\t\tif (key.startsWith('VITE_')) {\n\t\t\t\tconst newKey = key.replace('VITE_', '');\n\t\t\t\tacc[newKey] = value;\n\t\t\t}\n\t\t\tacc[key] = value;\n\t\t\treturn acc;\n\t\t},\n\t\t{} as Record<string, string | undefined>,\n\t);\n}\n\nfunction withEnv(env: Record<string, string | undefined>, prefix = DEFAULT_ENV_VAR_PREFIX) {\n\tconst getConfigEnvKey = () => `${prefix}TAQ_CONFIG`;\n\n\tconst decode = (value: string) => {\n\t\tconst buffer = Buffer.from(value, 'base64');\n\t\treturn buffer.toString('utf8');\n\t};\n\n\tconst getRawConfig = () => {\n\t\tconst key = getConfigEnvKey();\n\t\tconst data = env[key];\n\t\tif (!data) {\n\t\t\tthrow new TaqError(\n\t\t\t\t`Could not find config. Please ensure that the environment variable called ${key} is defined and set to the value of your config.json file using Base64 encoding.`,\n\t\t\t);\n\t\t}\n\t\ttry {\n\t\t\tconst decoded = decode(data);\n\t\t\tconst rawConfig = JSON.parse(decoded);\n\t\t\treturn rawConfig;\n\t\t} catch (err) {\n\t\t\tconsole.debug(err);\n\t\t\tthrow new TaqError(\n\t\t\t\t`Could not parse the config. Please ensure that the environment variable called ${key} is defined and set to the value of your config.json file using Base64 encoding.`,\n\t\t\t);\n\t\t}\n\t};\n\n\tconst getEnvironmentConfigKey = (environmentName: string) =>\n\t\t`${prefix}TAQ_CONFIG_LOCAL_${environmentName.toUpperCase()}`;\n\n\tconst getEnvironmentConfig = (environmentName: string) => {\n\t\tconst key = getEnvironmentConfigKey(environmentName);\n\t\tconst data = env[key];\n\t\tif (!data) {\n\t\t\treturn ConfigEnvironmentFileV2.from({});\n\t\t}\n\t\ttry {\n\t\t\tconst decoded = decode(data);\n\t\t\tconst rawConfig = JSON.parse(decoded);\n\t\t\treturn ConfigEnvironmentFileV2.from(rawConfig);\n\t\t} catch {\n\t\t\tthrow new TaqError(\n\t\t\t\t`Could not parse environment config for an environment called ${environmentName}. Please ensure that the environment variable called ${key} is defined and set to the value of your config.json file using Base64 encoding.`,\n\t\t\t);\n\t\t}\n\t};\n\n\treturn {\n\t\tgetConfigEnvKey,\n\t\tgetRawConfig,\n\t\tgetEnvironmentConfigKey,\n\t\tgetEnvironmentConfig,\n\t};\n}\n\nexport const getConfigAsV1 = (env: Record<string, string | undefined>, prefix = DEFAULT_ENV_VAR_PREFIX): Config.t => {\n\tconst { getRawConfig, getEnvironmentConfig } = withEnv(withFixedEnv(env), prefix);\n\n\tconst rawConfig = getRawConfig();\n\n\ttry {\n\t\t// If version v1, return the config object\n\t\tif (!rawConfig.version || rawConfig.version.toLowerCase() === 'v1') return Config.from(rawConfig);\n\t\t// If version v2, transform to V1 and return that\n\t\telse if (rawConfig.version.toLowerCase() === 'v2') {\n\t\t\tconst config = ConfigFileV2.from(rawConfig);\n\t\t\tconst environments = Object.keys(config.environments ?? {}).reduce(\n\t\t\t\t(retval, envName) => ({\n\t\t\t\t\t...retval,\n\t\t\t\t\t[envName]: getEnvironmentConfig(envName),\n\t\t\t\t}),\n\t\t\t\t{},\n\t\t\t);\n\n\t\t\treturn Config.create(transform.transformConfigFileV2ToConfig({\n\t\t\t\tconfig,\n\t\t\t\tenvironments,\n\t\t\t}));\n\t\t}\n\n\t\t// Other version handlers go here\n\t\tthrow new TaqError(`The version of your configuration is not yet supported.`);\n\t} catch (err) {\n\t\tthrow isTaqError(err)\n\t\t\t? err\n\t\t\t: new TaqError(\n\t\t\t\t`Something went wrong trying to parse your configuration. Please report this to the Taqueria Developers: ${err}`,\n\t\t\t);\n\t}\n};\n\nexport function getConfigV2(\n\tenv: Record<string, string | undefined>,\n\tprefix = DEFAULT_ENV_VAR_PREFIX,\n): transform.ConfigFileSetV2 {\n\tconst { getRawConfig, getEnvironmentConfig } = withEnv(withFixedEnv(env), prefix);\n\n\tconst rawConfig = getRawConfig();\n\n\ttry {\n\t\t// If version v1, return the config object\n\t\tif (!rawConfig.version || rawConfig.version.toLowerCase() === 'v1') {\n\t\t\tconst configV1 = Config.from(rawConfig);\n\t\t\treturn transform.transformConfigToConfigFileV2(configV1);\n\t\t} else if (rawConfig.version.toLowerCase() === 'v2') {\n\t\t\tconst configV2 = ConfigFileV2.from(rawConfig);\n\t\t\tconst environments = Object.keys(configV2.environments ?? {}).reduce(\n\t\t\t\t(retval, envName) => ({ ...retval, [envName]: getEnvironmentConfig(envName) }),\n\t\t\t\t{},\n\t\t\t);\n\t\t\tconst retval: transform.ConfigFileSetV2 = {\n\t\t\t\tconfig: configV2,\n\t\t\t\tenvironments,\n\t\t\t};\n\n\t\t\treturn retval;\n\t\t}\n\t\t// Other version handlers go here\n\t\t// No other versions we're aware of.\n\t\tthrow new TaqError(`The version of your configuration is not yet supported.`);\n\t} catch (err) {\n\t\tthrow isTaqError(err)\n\t\t\t? err\n\t\t\t: new TaqError(\n\t\t\t\t`Something went wrong trying to parse your configuration. Please report this to the Taqueria Developers: ${err}`,\n\t\t\t);\n\t}\n}\n\n// Backwards compatibility\n// Before introducing V1, the toolkit just exported these two functions\nconst getAliasAddress = V1.getAliasAddress;\nconst getCurrentEnv = V1.getCurrentEnv;\nexport { Config, getAliasAddress, getCurrentEnv };\n\n// New exports as of V2\nexport type ConfigFileSetV2 = transform.ConfigFileSetV2;\n"],"mappings":";;;;;;;;;;;;AAAA,YAAY,YAAY;AACxB,YAAY,6BAA6B;AACzC,YAAY,kBAAkB;AAK9B,YAAY,eAAe;AAC3B,SAAS,cAAc;AAEvB,IAAM,yBAAyB;AAE/B,SAAS,aAAa,KAAyC;AAC9D,SAAO,OAAO,QAAQ,GAAG,EAAE;AAAA,IAC1B,CAAC,KAAK,CAAC,KAAK,KAAK,MAAM;AACtB,UAAI,IAAI,WAAW,OAAO,GAAG;AAC5B,cAAM,SAAS,IAAI,QAAQ,SAAS,EAAE;AACtC,YAAI,MAAM,IAAI;AAAA,MACf;AACA,UAAI,GAAG,IAAI;AACX,aAAO;AAAA,IACR;AAAA,IACA,CAAC;AAAA,EACF;AACD;AAEA,SAAS,QAAQ,KAAyC,SAAS,wBAAwB;AAC1F,QAAM,kBAAkB,MAAM,GAAG,MAAM;AAEvC,QAAM,SAAS,CAAC,UAAkB;AACjC,UAAM,S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sourcesContent":["import * as Config from '@taqueria/protocol/Config';\nimport * as ConfigEnvironmentFileV2 from '@taqueria/protocol/ConfigEnvironmentFileV2';\nimport * as ConfigFileV2 from '@taqueria/protocol/ConfigFileV2';\nimport { isTaqError, TaqError } from './TaqError';\nexport { isTaqError, TaqError } from './TaqError';\nimport * as V1 from './v1';\nexport * as V2 from './v2';\nimport * as transform from '@taqueria/protocol/types-config-files';\nimport { Buffer } from 'buffer';\n\nconst DEFAULT_ENV_VAR_PREFIX = '';\n\nfunction withFixedEnv(env: Record<string, string | undefined>) {\n\treturn Object.entries(env).reduce(\n\t\t(acc, [key, value]) => {\n\t\t\tif (key.startsWith('VITE_')) {\n\t\t\t\tconst newKey = key.replace('VITE_', '');\n\t\t\t\tacc[newKey] = value;\n\t\t\t}\n\t\t\tacc[key] = value;\n\t\t\treturn acc;\n\t\t},\n\t\t{} as Record<string, string | undefined>,\n\t);\n}\n\nfunction withEnv(env: Record<string, string | undefined>, prefix = DEFAULT_ENV_VAR_PREFIX) {\n\tconst getConfigEnvKey = () => `${prefix}TAQ_CONFIG`;\n\n\tconst decode = (value: string) => {\n\t\tconst buffer = Buffer.from(value, 'base64');\n\t\treturn buffer.toString('utf8');\n\t};\n\n\tconst getRawConfig = () => {\n\t\tconst key = getConfigEnvKey();\n\t\tconst data = env[key];\n\t\tif (!data) {\n\t\t\tthrow new TaqError(\n\t\t\t\t`Could not find config. Please ensure that the environment variable called ${key} is defined and set to the value of your config.json file using Base64 encoding.`,\n\t\t\t);\n\t\t}\n\t\ttry {\n\t\t\tconst decoded = decode(data);\n\t\t\tconst rawConfig = JSON.parse(decoded);\n\t\t\treturn rawConfig;\n\t\t} catch (err) {\n\t\t\tconsole.debug(err);\n\t\t\tthrow new TaqError(\n\t\t\t\t`Could not parse the config. Please ensure that the environment variable called ${key} is defined and set to the value of your config.json file using Base64 encoding.`,\n\t\t\t);\n\t\t}\n\t};\n\n\tconst getEnvironmentConfigKey = (environmentName: string) =>\n\t\t`${prefix}TAQ_CONFIG_LOCAL_${environmentName.toUpperCase()}`;\n\n\tconst getEnvironmentConfig = (environmentName: string) => {\n\t\tconst key = getEnvironmentConfigKey(environmentName);\n\t\tconst data = env[key];\n\t\tif (!data) {\n\t\t\treturn ConfigEnvironmentFileV2.from({});\n\t\t}\n\t\ttry {\n\t\t\tconst decoded = decode(data);\n\t\t\tconst rawConfig = JSON.parse(decoded);\n\t\t\treturn ConfigEnvironmentFileV2.from(rawConfig);\n\t\t} catch {\n\t\t\tthrow new TaqError(\n\t\t\t\t`Could not parse environment config for an environment called ${environmentName}. Please ensure that the environment variable called ${key} is defined and set to the value of your config.json file using Base64 encoding.`,\n\t\t\t);\n\t\t}\n\t};\n\n\treturn {\n\t\tgetConfigEnvKey,\n\t\tgetRawConfig,\n\t\tgetEnvironmentConfigKey,\n\t\tgetEnvironmentConfig,\n\t};\n}\n\nexport const getConfigAsV1 = (env: Record<string, string | undefined>, prefix = DEFAULT_ENV_VAR_PREFIX): Config.t => {\n\tconst { getRawConfig, getEnvironmentConfig } = withEnv(withFixedEnv(env), prefix);\n\n\tconst rawConfig = getRawConfig();\n\n\ttry {\n\t\t// If version v1, return the config object\n\t\tif (!rawConfig.version || rawConfig.version.toLowerCase() === 'v1') return Config.from(rawConfig);\n\t\t// If version v2, transform to V1 and return that\n\t\telse if (rawConfig.version.toLowerCase() === 'v2') {\n\t\t\tconst config = ConfigFileV2.from(rawConfig);\n\t\t\tconst environments = Object.keys(config.environments ?? {}).reduce(\n\t\t\t\t(retval, envName) => ({\n\t\t\t\t\t...retval,\n\t\t\t\t\t[envName]: getEnvironmentConfig(envName),\n\t\t\t\t}),\n\t\t\t\t{},\n\t\t\t);\n\n\t\t\treturn Config.create(transform.transformConfigFileV2ToConfig({\n\t\t\t\tconfig,\n\t\t\t\tenvironments,\n\t\t\t}));\n\t\t}\n\n\t\t// Other version handlers go here\n\t\tthrow new TaqError(`The version of your configuration is not yet supported.`);\n\t} catch (err) {\n\t\tthrow isTaqError(err)\n\t\t\t? err\n\t\t\t: new TaqError(\n\t\t\t\t`Something went wrong trying to parse your configuration. Please report this to the Taqueria Developers: ${err}`,\n\t\t\t);\n\t}\n};\n\nexport function getConfigV2(\n\tenv: Record<string, string | undefined>,\n\tprefix = DEFAULT_ENV_VAR_PREFIX,\n): transform.ConfigFileSetV2 {\n\tconst { getRawConfig, getEnvironmentConfig } = withEnv(withFixedEnv(env), prefix);\n\n\tconst rawConfig = getRawConfig();\n\n\ttry {\n\t\t// If version v1, return the config object\n\t\tif (!rawConfig.version || rawConfig.version.toLowerCase() === 'v1') {\n\t\t\tconst configV1 = Config.from(rawConfig);\n\t\t\treturn transform.transformConfigToConfigFileV2(configV1);\n\t\t} else if (rawConfig.version.toLowerCase() === 'v2') {\n\t\t\tconst configV2 = ConfigFileV2.from(rawConfig);\n\t\t\tconst environments = Object.keys(configV2.environments ?? {}).reduce(\n\t\t\t\t(retval, envName) => ({ ...retval, [envName]: getEnvironmentConfig(envName) }),\n\t\t\t\t{},\n\t\t\t);\n\t\t\tconst retval: transform.ConfigFileSetV2 = {\n\t\t\t\tconfig: configV2,\n\t\t\t\tenvironments,\n\t\t\t};\n\n\t\t\treturn retval;\n\t\t}\n\t\t// Other version handlers go here\n\t\t// No other versions we're aware of.\n\t\tthrow new TaqError(`The version of your configuration is not yet supported.`);\n\t} catch (err) {\n\t\tthrow isTaqError(err)\n\t\t\t? err\n\t\t\t: new TaqError(\n\t\t\t\t`Something went wrong trying to parse your configuration. Please report this to the Taqueria Developers: ${err}`,\n\t\t\t);\n\t}\n}\n\n// Backwards compatibility\n// Before introducing V1, the toolkit just exported these two functions\nconst getAliasAddress = V1.getAliasAddress;\nconst getCurrentEnv = V1.getCurrentEnv;\nexport { Config, getAliasAddress, getCurrentEnv };\n\n// New exports as of V2\nexport type ConfigFileSetV2 = transform.ConfigFileSetV2;\n"],"mappings":";;;;;;;;;;;;AAAA,YAAY,YAAY;AACxB,YAAY,6BAA6B;AACzC,YAAY,kBAAkB;AAK9B,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AAiB,wCAA8B,QAAQ;AAAA,IACxD,WAAW,UAAU,QAAQ,YAAY,MAAM,MAAM;AACpD,YAAM,WAAwB,kBAAK,SAAS;AAC5C,YAAM,eAAe,OAAO,KAAK,SAAS,gBAAgB,CAAC,CAAC,EAAE;AAAA,QAC7D,CAACA,SAAQ,aAAa,EAAE,GAAGA,SAAQ,CAAC,OAAO,GAAG,qBAAqB,OAAO,EAAE;AAAA,QAC5E,CAAC;AAAA,MACF;AACA,YAAM,SAAoC;AAAA,QACzC,QAAQ;AAAA,QACR;AAAA,MACD;AAEA,aAAO;AAAA,IACR;AAGA,UAAM,IAAI,SAAS,yDAAyD;AAAA,EAC7E,SAAS,KAAK;AACb,UAAM,WAAW,GAAG,IACjB,MACA,IAAI;AAAA,MACL,2GAA2G,GAAG;AAAA,IAC/G;AAAA,EACF;AACD;AAIA,IAAMC,mBAAqB;AAC3B,IAAMC,iBAAmB;","names":["retval","getAliasAddress","getCurrentEnv"]}
|
package/lib/env.d.ts
CHANGED
|
@@ -14,6 +14,6 @@ export declare function getEncodedConfig(taqDir: string, prefix: string): Promis
|
|
|
14
14
|
}>;
|
|
15
15
|
export declare function getEnv(env: typeof process.env, taqDir: string, prefix?: string): Promise<{
|
|
16
16
|
[x: string]: string | undefined;
|
|
17
|
-
TZ?: string
|
|
17
|
+
TZ?: string;
|
|
18
18
|
}>;
|
|
19
19
|
export {};
|
package/package.json
CHANGED
|
@@ -1,88 +1,88 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
2
|
+
"name": "@taqueria/toolkit",
|
|
3
|
+
"version": "0.57.8",
|
|
4
|
+
"description": "A TypeScript library for NodeJS to work with Taqueria projects",
|
|
5
|
+
"source": "./index.ts",
|
|
6
|
+
"main": "./index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"withTaq": "./bin/run.js"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"types": "./index.d.ts",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"taqueria",
|
|
14
|
+
"tezos",
|
|
15
|
+
"pinnaclelabs",
|
|
16
|
+
"ecadlabs"
|
|
17
|
+
],
|
|
18
|
+
"author": "Taqueria",
|
|
19
|
+
"license": "Apache-2.0",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/tezostaqueria/taqueria.git",
|
|
23
|
+
"directory": "taqueria-toolkit"
|
|
24
|
+
},
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/tezostaqueria/taqueria/issues"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://github.com/tezostaqueria/taqueria#readme",
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/cross-spawn": "^6.0.6",
|
|
31
|
+
"@types/node": "^20.10.4",
|
|
32
|
+
"@types/yargs": "^17.0.32",
|
|
33
|
+
"tsup": "^8.3.0",
|
|
34
|
+
"typescript": "^5.6.2"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"buffer": "^6.0.3",
|
|
38
|
+
"cross-spawn": "^7.0.3",
|
|
39
|
+
"yargs": "^17.7.2",
|
|
40
|
+
"@taqueria/protocol": "0.57.8"
|
|
41
|
+
},
|
|
42
|
+
"tsup": [
|
|
43
|
+
{
|
|
44
|
+
"entry": [
|
|
45
|
+
"index.ts",
|
|
46
|
+
"v1.ts",
|
|
47
|
+
"v2.ts"
|
|
48
|
+
],
|
|
49
|
+
"sourcemap": true,
|
|
50
|
+
"target": [
|
|
51
|
+
"esnext"
|
|
52
|
+
],
|
|
53
|
+
"outDir": "./",
|
|
54
|
+
"dts": true,
|
|
55
|
+
"clean": false,
|
|
56
|
+
"shims": true,
|
|
57
|
+
"skipNodeModulesBundle": false,
|
|
58
|
+
"platform": "browser",
|
|
59
|
+
"format": [
|
|
60
|
+
"esm"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"entry": [
|
|
65
|
+
"bin/run.ts"
|
|
66
|
+
],
|
|
67
|
+
"sourcemap": true,
|
|
68
|
+
"target": "esnext",
|
|
69
|
+
"outDir": "./bin/",
|
|
70
|
+
"dts": false,
|
|
71
|
+
"clean": false,
|
|
72
|
+
"skipNodeModulesBundle": true,
|
|
73
|
+
"platform": "node",
|
|
74
|
+
"format": "esm"
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"exports": {
|
|
78
|
+
"./lib/*": "./lib/*",
|
|
79
|
+
".": "./index.js",
|
|
80
|
+
"./v1": "./v1.js",
|
|
81
|
+
"./v2": "./v2.js"
|
|
82
|
+
},
|
|
83
|
+
"gitHead": "ff58a2fc06ad233869ad6be574093c8b3b272e2e",
|
|
84
|
+
"scripts": {
|
|
85
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
86
|
+
"build": "npx tsc -p ./tsconfig.json && npx tsup"
|
|
87
|
+
}
|
|
88
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -27,7 +27,11 @@
|
|
|
27
27
|
"module": "ESNext", /* Specify what module code is generated. */
|
|
28
28
|
"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
29
29
|
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
30
|
-
|
|
30
|
+
"paths": {
|
|
31
|
+
"@taqueria/protocol/*": ["../taqueria-protocol/*"],
|
|
32
|
+
"@taqueria/toolkit/*": ["./*"],
|
|
33
|
+
"@taqueria/toolkit": ["./index.ts"]
|
|
34
|
+
}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
31
35
|
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
32
36
|
// "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
|
|
33
37
|
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
package/v1.js
CHANGED
package/v2.js
CHANGED
|
File without changes
|
|
File without changes
|