@mayson-org/inject-script 1.0.28 → 1.0.29
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-handler.d.ts","sourceRoot":"","sources":["../../../src/plugins/metadata/api-handler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAC5D,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,IAAI,CAAC,eAAe,EAAE,eAAe,GAAG,aAAa,GAAG,cAAc,CAAC,CAAC;IAC9E,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"api-handler.d.ts","sourceRoot":"","sources":["../../../src/plugins/metadata/api-handler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAC5D,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,IAAI,CAAC,eAAe,EAAE,eAAe,GAAG,aAAa,GAAG,cAAc,CAAC,CAAC;IAC9E,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAkBF;;GAEG;AACH,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAsD5E;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,IAAI,MAAM,CAkIvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patch-next-config.d.ts","sourceRoot":"","sources":["../../../src/plugins/metadata/patch-next-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"patch-next-config.d.ts","sourceRoot":"","sources":["../../../src/plugins/metadata/patch-next-config.ts"],"names":[],"mappings":"AASA,wBAAgB,eAAe,CAAC,OAAO,EAAE;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CA0F3C"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
+
function readEnv(key) {
|
|
4
|
+
return process.env[key]?.trim() ?? '';
|
|
5
|
+
}
|
|
3
6
|
export function patchNextConfig(options) {
|
|
4
7
|
const { projectRoot, dryRun = false } = options;
|
|
5
8
|
const rawBase = (options.appBaseUrl || 'https://mayson.dev').replace(/\/$/, '');
|
|
@@ -13,7 +16,7 @@ export function patchNextConfig(options) {
|
|
|
13
16
|
},
|
|
14
17
|
{
|
|
15
18
|
source: '/~api/analytics',
|
|
16
|
-
destination: '${rawBase}/api/analytics',
|
|
19
|
+
destination: '${rawBase}/api/analytics?'${`workspace_id=${readEnv('MAYSON_WORKSPACE_ID')}&collection_id=${readEnv('MAYSON_COLLECTION_ID')}`},
|
|
17
20
|
},
|
|
18
21
|
];
|
|
19
22
|
},`;
|
package/package.json
CHANGED