@stamhoofd/build-development-env 2.86.0
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/LICENSE +665 -0
- package/README.md +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/src/Service.d.ts +6 -0
- package/dist/src/Service.d.ts.map +1 -0
- package/dist/src/Service.js +3 -0
- package/dist/src/Service.js.map +1 -0
- package/dist/src/build.d.ts +9 -0
- package/dist/src/build.d.ts.map +1 -0
- package/dist/src/build.js +128 -0
- package/dist/src/build.js.map +1 -0
- package/dist/src/buildPresets.d.ts +8 -0
- package/dist/src/buildPresets.d.ts.map +1 -0
- package/dist/src/buildPresets.js +100 -0
- package/dist/src/buildPresets.js.map +1 -0
- package/dist/src/helpers/1password.d.ts +8 -0
- package/dist/src/helpers/1password.d.ts.map +1 -0
- package/dist/src/helpers/1password.js +33 -0
- package/dist/src/helpers/1password.js.map +1 -0
- package/dist/src/helpers/cache.d.ts +9 -0
- package/dist/src/helpers/cache.d.ts.map +1 -0
- package/dist/src/helpers/cache.js +144 -0
- package/dist/src/helpers/cache.js.map +1 -0
- package/dist/src/helpers/project-path.d.ts +5 -0
- package/dist/src/helpers/project-path.d.ts.map +1 -0
- package/dist/src/helpers/project-path.js +35 -0
- package/dist/src/helpers/project-path.js.map +1 -0
- package/dist/src/init.d.ts +2 -0
- package/dist/src/init.d.ts.map +1 -0
- package/dist/src/init.js +41 -0
- package/dist/src/init.js.map +1 -0
- package/dist/src/presets/internal.d.ts +5 -0
- package/dist/src/presets/internal.d.ts.map +1 -0
- package/dist/src/presets/internal.js +38 -0
- package/dist/src/presets/internal.js.map +1 -0
- package/dist/src/presets/keeo.d.ts +3 -0
- package/dist/src/presets/keeo.d.ts.map +1 -0
- package/dist/src/presets/keeo.js +36 -0
- package/dist/src/presets/keeo.js.map +1 -0
- package/dist/src/presets/platform.d.ts +2 -0
- package/dist/src/presets/platform.d.ts.map +1 -0
- package/dist/src/presets/platform.js +10 -0
- package/dist/src/presets/platform.js.map +1 -0
- package/dist/src/presets/ports-primary.d.ts +3 -0
- package/dist/src/presets/ports-primary.d.ts.map +1 -0
- package/dist/src/presets/ports-primary.js +53 -0
- package/dist/src/presets/ports-primary.js.map +1 -0
- package/dist/src/presets/ports-secundary.d.ts +3 -0
- package/dist/src/presets/ports-secundary.d.ts.map +1 -0
- package/dist/src/presets/ports-secundary.js +16 -0
- package/dist/src/presets/ports-secundary.js.map +1 -0
- package/dist/src/presets/ravot.d.ts +3 -0
- package/dist/src/presets/ravot.d.ts.map +1 -0
- package/dist/src/presets/ravot.js +35 -0
- package/dist/src/presets/ravot.js.map +1 -0
- package/dist/src/presets/services/caddy.d.ts +3 -0
- package/dist/src/presets/services/caddy.d.ts.map +1 -0
- package/dist/src/presets/services/caddy.js +253 -0
- package/dist/src/presets/services/caddy.js.map +1 -0
- package/dist/src/presets/services/coredns.d.ts +3 -0
- package/dist/src/presets/services/coredns.d.ts.map +1 -0
- package/dist/src/presets/services/coredns.js +13 -0
- package/dist/src/presets/services/coredns.js.map +1 -0
- package/dist/src/presets/services/frontend-type-checking.d.ts +3 -0
- package/dist/src/presets/services/frontend-type-checking.d.ts.map +1 -0
- package/dist/src/presets/services/frontend-type-checking.js +13 -0
- package/dist/src/presets/services/frontend-type-checking.js.map +1 -0
- package/dist/src/presets/services/maildev.d.ts +5 -0
- package/dist/src/presets/services/maildev.d.ts.map +1 -0
- package/dist/src/presets/services/maildev.js +28 -0
- package/dist/src/presets/services/maildev.js.map +1 -0
- package/dist/src/presets/services/stripe.d.ts +11 -0
- package/dist/src/presets/services/stripe.d.ts.map +1 -0
- package/dist/src/presets/services/stripe.js +51 -0
- package/dist/src/presets/services/stripe.js.map +1 -0
- package/dist/src/presets/stamhoofd.d.ts +3 -0
- package/dist/src/presets/stamhoofd.d.ts.map +1 -0
- package/dist/src/presets/stamhoofd.js +43 -0
- package/dist/src/presets/stamhoofd.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/esm/dist/index.d.ts +2 -0
- package/esm/dist/index.d.ts.map +1 -0
- package/esm/dist/index.js +2 -0
- package/esm/dist/index.js.map +1 -0
- package/esm/dist/src/Service.d.ts +6 -0
- package/esm/dist/src/Service.d.ts.map +1 -0
- package/esm/dist/src/Service.js +2 -0
- package/esm/dist/src/Service.js.map +1 -0
- package/esm/dist/src/build.d.ts +9 -0
- package/esm/dist/src/build.d.ts.map +1 -0
- package/esm/dist/src/build.js +122 -0
- package/esm/dist/src/build.js.map +1 -0
- package/esm/dist/src/buildPresets.d.ts +8 -0
- package/esm/dist/src/buildPresets.d.ts.map +1 -0
- package/esm/dist/src/buildPresets.js +74 -0
- package/esm/dist/src/buildPresets.js.map +1 -0
- package/esm/dist/src/helpers/1password.d.ts +8 -0
- package/esm/dist/src/helpers/1password.d.ts.map +1 -0
- package/esm/dist/src/helpers/1password.js +28 -0
- package/esm/dist/src/helpers/1password.js.map +1 -0
- package/esm/dist/src/helpers/cache.d.ts +9 -0
- package/esm/dist/src/helpers/cache.d.ts.map +1 -0
- package/esm/dist/src/helpers/cache.js +139 -0
- package/esm/dist/src/helpers/cache.js.map +1 -0
- package/esm/dist/src/helpers/project-path.d.ts +5 -0
- package/esm/dist/src/helpers/project-path.d.ts.map +1 -0
- package/esm/dist/src/helpers/project-path.js +31 -0
- package/esm/dist/src/helpers/project-path.js.map +1 -0
- package/esm/dist/src/init.d.ts +2 -0
- package/esm/dist/src/init.d.ts.map +1 -0
- package/esm/dist/src/init.js +38 -0
- package/esm/dist/src/init.js.map +1 -0
- package/esm/dist/src/presets/internal.d.ts +5 -0
- package/esm/dist/src/presets/internal.d.ts.map +1 -0
- package/esm/dist/src/presets/internal.js +34 -0
- package/esm/dist/src/presets/internal.js.map +1 -0
- package/esm/dist/src/presets/keeo.d.ts +3 -0
- package/esm/dist/src/presets/keeo.d.ts.map +1 -0
- package/esm/dist/src/presets/keeo.js +33 -0
- package/esm/dist/src/presets/keeo.js.map +1 -0
- package/esm/dist/src/presets/platform.d.ts +2 -0
- package/esm/dist/src/presets/platform.d.ts.map +1 -0
- package/esm/dist/src/presets/platform.js +7 -0
- package/esm/dist/src/presets/platform.js.map +1 -0
- package/esm/dist/src/presets/ports-primary.d.ts +3 -0
- package/esm/dist/src/presets/ports-primary.d.ts.map +1 -0
- package/esm/dist/src/presets/ports-primary.js +50 -0
- package/esm/dist/src/presets/ports-primary.js.map +1 -0
- package/esm/dist/src/presets/ports-secundary.d.ts +3 -0
- package/esm/dist/src/presets/ports-secundary.d.ts.map +1 -0
- package/esm/dist/src/presets/ports-secundary.js +13 -0
- package/esm/dist/src/presets/ports-secundary.js.map +1 -0
- package/esm/dist/src/presets/ravot.d.ts +3 -0
- package/esm/dist/src/presets/ravot.d.ts.map +1 -0
- package/esm/dist/src/presets/ravot.js +32 -0
- package/esm/dist/src/presets/ravot.js.map +1 -0
- package/esm/dist/src/presets/services/caddy.d.ts +3 -0
- package/esm/dist/src/presets/services/caddy.d.ts.map +1 -0
- package/esm/dist/src/presets/services/caddy.js +249 -0
- package/esm/dist/src/presets/services/caddy.js.map +1 -0
- package/esm/dist/src/presets/services/coredns.d.ts +3 -0
- package/esm/dist/src/presets/services/coredns.d.ts.map +1 -0
- package/esm/dist/src/presets/services/coredns.js +10 -0
- package/esm/dist/src/presets/services/coredns.js.map +1 -0
- package/esm/dist/src/presets/services/frontend-type-checking.d.ts +3 -0
- package/esm/dist/src/presets/services/frontend-type-checking.d.ts.map +1 -0
- package/esm/dist/src/presets/services/frontend-type-checking.js +10 -0
- package/esm/dist/src/presets/services/frontend-type-checking.js.map +1 -0
- package/esm/dist/src/presets/services/maildev.d.ts +5 -0
- package/esm/dist/src/presets/services/maildev.d.ts.map +1 -0
- package/esm/dist/src/presets/services/maildev.js +24 -0
- package/esm/dist/src/presets/services/maildev.js.map +1 -0
- package/esm/dist/src/presets/services/stripe.d.ts +11 -0
- package/esm/dist/src/presets/services/stripe.d.ts.map +1 -0
- package/esm/dist/src/presets/services/stripe.js +46 -0
- package/esm/dist/src/presets/services/stripe.js.map +1 -0
- package/esm/dist/src/presets/stamhoofd.d.ts +3 -0
- package/esm/dist/src/presets/stamhoofd.d.ts.map +1 -0
- package/esm/dist/src/presets/stamhoofd.js +40 -0
- package/esm/dist/src/presets/stamhoofd.js.map +1 -0
- package/esm/dist/tsconfig.tsbuildinfo +1 -0
- package/esm/package.json +3 -0
- package/package.json +24 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.inject = inject;
|
|
4
|
+
exports.init = init;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const util_1 = tslib_1.__importDefault(require("util"));
|
|
7
|
+
const child_process_1 = require("child_process");
|
|
8
|
+
const cache_1 = require("../../helpers/cache");
|
|
9
|
+
const execPromise = util_1.default.promisify(child_process_1.exec);
|
|
10
|
+
async function inject(config, service) {
|
|
11
|
+
if (!('backend' in service) || !service.backend) {
|
|
12
|
+
return {};
|
|
13
|
+
}
|
|
14
|
+
const secret = await (0, cache_1.cache)('stripe-webhook-secret', async () => {
|
|
15
|
+
console.log('Fetching Stripe webhook secret...');
|
|
16
|
+
let stripeSecret;
|
|
17
|
+
const stripeSecretKey = config.STRIPE_SECRET_KEY;
|
|
18
|
+
const apiKeyFlag = stripeSecretKey ? ` --api-key ${stripeSecretKey}` : '';
|
|
19
|
+
try {
|
|
20
|
+
const stripeListenCommand = `stripe listen --print-secret${apiKeyFlag}`;
|
|
21
|
+
stripeSecret = await Promise.race([
|
|
22
|
+
execPromise(stripeListenCommand),
|
|
23
|
+
new Promise((_, reject) => setTimeout(() => reject(new Error('Stripe listen command timed out after 5 seconds')), 5000)),
|
|
24
|
+
]);
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
console.error('Failed to fetch Stripe webhook secret:');
|
|
28
|
+
console.error(err);
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
const webhookSecret = stripeSecret.stdout.trim();
|
|
32
|
+
console.log('Stripe webhook secret:', webhookSecret);
|
|
33
|
+
return webhookSecret;
|
|
34
|
+
});
|
|
35
|
+
return {
|
|
36
|
+
STRIPE_ENDPOINT_SECRET: secret,
|
|
37
|
+
STRIPE_CONNECT_ENDPOINT_SECRET: secret,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
async function init(config) {
|
|
41
|
+
const stripeSecretKey = config.STRIPE_SECRET_KEY;
|
|
42
|
+
const apiKeyFlag = stripeSecretKey ? ` --api-key ${stripeSecretKey}` : '';
|
|
43
|
+
return [
|
|
44
|
+
{
|
|
45
|
+
name: 'stripe',
|
|
46
|
+
command: 'stripe listen --forward-to http://' + config.domains.api + '/stripe/webhooks' + apiKeyFlag,
|
|
47
|
+
prefixColor: 'red',
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=stripe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stripe.js","sourceRoot":"","sources":["../../../../src/presets/services/stripe.ts"],"names":[],"mappings":";;AAOA,wBAiCC;AAED,oBAUC;;AAnDD,wDAAwB;AACxB,iDAAqC;AACrC,+CAA4C;AAE5C,MAAM,WAAW,GAAG,cAAI,CAAC,SAAS,CAAC,oBAAI,CAAC,CAAC;AAElC,KAAK,UAAU,MAAM,CAAC,MAA0B,EAAE,OAAgB;IACrE,IAAI,CAAC,CAAC,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QAC9C,OAAO,EAAE,CAAC;IACd,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,IAAA,aAAK,EAAC,uBAAuB,EAAE,KAAK,IAAI,EAAE;QAC3D,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;QAEjD,IAAI,YAAY,CA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CAAC,GAAG,GAAG,kBAAkB,GAAG,UAAU;YACpG,WAAW,EAAE,KAAK;SACrB;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stamhoofd.d.ts","sourceRoot":"","sources":["../../../src/presets/stamhoofd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,wBAAgB,KAAK,CAAC,OAAO,EAAE,OAAO,GAAG,GAAG,CA0C3C"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.build = build;
|
|
4
|
+
function build(service) {
|
|
5
|
+
const config = {
|
|
6
|
+
domains: {
|
|
7
|
+
dashboard: 'dashboard.stamhoofd',
|
|
8
|
+
registration: {
|
|
9
|
+
'': 'be.registration.stamhoofd',
|
|
10
|
+
'BE': 'be.registration.stamhoofd',
|
|
11
|
+
'NL': 'nl.registration.stamhoofd',
|
|
12
|
+
},
|
|
13
|
+
marketing: {
|
|
14
|
+
'': 'www.be.stamhoofd',
|
|
15
|
+
'BE': 'www.be.stamhoofd',
|
|
16
|
+
'NL': 'www.nl.stamhoofd',
|
|
17
|
+
},
|
|
18
|
+
webshop: {
|
|
19
|
+
'': 'be.shop.stamhoofd',
|
|
20
|
+
'BE': 'be.shop.stamhoofd',
|
|
21
|
+
'NL': 'nl.shop.stamhoofd',
|
|
22
|
+
},
|
|
23
|
+
api: 'api.stamhoofd',
|
|
24
|
+
rendererApi: 'renderer.stamhoofd',
|
|
25
|
+
defaultTransactionalEmail: {
|
|
26
|
+
'': 'stamhoofd.be',
|
|
27
|
+
'NL': 'stamhoofd.nl',
|
|
28
|
+
},
|
|
29
|
+
defaultBroadcastEmail: {
|
|
30
|
+
'': 'stamhoofd.email',
|
|
31
|
+
},
|
|
32
|
+
webshopCname: 'shop.stamhoofd',
|
|
33
|
+
registrationCname: 'registration.stamhoofd',
|
|
34
|
+
},
|
|
35
|
+
userMode: 'organization',
|
|
36
|
+
translationNamespace: 'stamhoofd',
|
|
37
|
+
platformName: 'stamhoofd',
|
|
38
|
+
DB_DATABASE: 'stamhoofd-development',
|
|
39
|
+
STRIPE_CONNECT_METHOD: 'express',
|
|
40
|
+
};
|
|
41
|
+
return config;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=stamhoofd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stamhoofd.js","sourceRoot":"","sources":["../../../src/presets/stamhoofd.ts"],"names":[],"mappings":";;AAEA,sBA0CC;AA1CD,SAAgB,KAAK,CAAC,OAAgB;IAClC,MAAM,MAAM,GAAG;QACX,OAAO,EAAE;YACL,SAAS,EAAE,qBAAqB;YAChC,YAAY,EAAE;gBACV,EAAE,EAAE,2BAA2B;gBAC/B,IAAI,EAAE,2BAA2B;gBACjC,IAAI,EAAE,2BAA2B;aACpC;YACD,SAAS,EAAE;gBACP,EAAE,EAAE,kBAAkB;gBACtB,IAAI,EAAE,kBAAkB;gBACxB,IAAI,EAAE,kBAAkB;aAC3B;YACD,OAAO,EAAE;gBACL,EAAE,EAAE,mBAAmB;gBACvB,IAAI,EAAE,mBAAmB;gBACzB,IAAI,EAAE,mBAAmB;aAC5B;YACD,GAAG,EAAE,eAAe;YACpB,WAAW,EAAE,oBAAoB;YAEjC,yBAAyB,EAAE;gBACvB,EAAE,EAAE,cAAc;gBAClB,IAAI,EAAE,cAAc;aACvB;YAED,qBAAqB,EAAE;gBACnB,EAAE,EAAE,iBAAiB;aACxB;YACD,YAAY,EAAE,gBAAgB;YAC9B,iBAAiB,EAAE,wBAAwB;SAC9C;QACD,QAAQ,EAAE,cAAc;QACxB,oBAAoB,EAAE,WAAW;QACjC,YAAY,EAAE,WAAW;QAEzB,WAAW,EAAE,uBAAuB;QACpC,qBAAqB,EAAE,SAAS;KACnC,CAAC;IAEF,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["../index.ts","../src/service.ts","../src/build.ts","../src/buildpresets.ts","../src/init.ts","../src/helpers/1password.ts","../src/helpers/cache.ts","../src/helpers/project-path.ts","../src/presets/internal.ts","../src/presets/keeo.ts","../src/presets/platform.ts","../src/presets/ports-primary.ts","../src/presets/ports-secundary.ts","../src/presets/ravot.ts","../src/presets/stamhoofd.ts","../src/presets/services/caddy.ts","../src/presets/services/coredns.ts","../src/presets/services/frontend-type-checking.ts","../src/presets/services/maildev.ts","../src/presets/services/stripe.ts","../../../environment.d.ts","../../../jest-extended.d.ts","../../stamhoofd.d.ts"],"version":"5.6.2"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Service.d.ts","sourceRoot":"","sources":["../../../src/Service.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG;IAClB,OAAO,EAAE,YAAY,GAAG,KAAK,GAAG,UAAU,GAAG,QAAQ,CAAC;CACzD,GAAG;IACA,QAAQ,EAAE,WAAW,GAAG,cAAc,GAAG,SAAS,CAAC;CACtD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Service.js","sourceRoot":"","sources":["../../../src/Service.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { InitFunction } from './buildPresets';
|
|
2
|
+
import { Service } from './Service';
|
|
3
|
+
export declare function loadEnvironmentFile(name: string): Promise<any>;
|
|
4
|
+
export declare function buildConfig(name: string, service: Service): Promise<{
|
|
5
|
+
config: any;
|
|
6
|
+
initFunctions: InitFunction[];
|
|
7
|
+
}>;
|
|
8
|
+
export declare function build(name: string, service: Service): Promise<any>;
|
|
9
|
+
//# sourceMappingURL=build.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAapC,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,MAAM,gBAgCrD;AAED,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC;IAAE,MAAM,EAAE,GAAG,CAAC;IAAC,aAAa,EAAE,YAAY,EAAE,CAAA;CAAE,CAAC,CAgGzH;AAED,wBAAsB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,CAExE"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { buildPresets } from './buildPresets';
|
|
2
|
+
import { getProjectPath } from './helpers/project-path';
|
|
3
|
+
import fs from 'node:fs/promises';
|
|
4
|
+
async function fileExists(path) {
|
|
5
|
+
try {
|
|
6
|
+
await fs.access(path);
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export async function loadEnvironmentFile(name) {
|
|
14
|
+
var _a;
|
|
15
|
+
const rootPath = await getProjectPath();
|
|
16
|
+
const envFileName = name ? `env.${name}` : 'env';
|
|
17
|
+
if (!(await fileExists(rootPath + envFileName + '.js'))) {
|
|
18
|
+
throw new Error(`Environment file "${envFileName}.js" not found in the root directory`);
|
|
19
|
+
}
|
|
20
|
+
const isInternalContributor = await fileExists(rootPath + '.internal-contributor');
|
|
21
|
+
// Load names
|
|
22
|
+
const globalEnvFile = await import(rootPath + envFileName + '.js');
|
|
23
|
+
let localEnvFile = undefined;
|
|
24
|
+
try {
|
|
25
|
+
localEnvFile = await import(rootPath + envFileName + '.local.js');
|
|
26
|
+
}
|
|
27
|
+
catch (e) {
|
|
28
|
+
// If the local env file doesn't exist, we can ignore it
|
|
29
|
+
}
|
|
30
|
+
let environment = localEnvFile !== null && localEnvFile !== void 0 ? localEnvFile : globalEnvFile;
|
|
31
|
+
if (isInternalContributor) {
|
|
32
|
+
environment = {
|
|
33
|
+
...environment,
|
|
34
|
+
presets: [...((_a = environment.presets) !== null && _a !== void 0 ? _a : []), 'internal'],
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return environment;
|
|
38
|
+
}
|
|
39
|
+
export async function buildConfig(name, service) {
|
|
40
|
+
var _a;
|
|
41
|
+
const projectPath = await getProjectPath();
|
|
42
|
+
const environment = await loadEnvironmentFile(name);
|
|
43
|
+
// Only return these env variables in backend services, to not expose development credentials in the browser
|
|
44
|
+
const backendSpecific = {
|
|
45
|
+
// By default use local MySQL server
|
|
46
|
+
DB_HOST: '127.0.0.1',
|
|
47
|
+
DB_USER: 'root',
|
|
48
|
+
DB_PASS: 'root',
|
|
49
|
+
DB_DATABASE: 'stamhoofd',
|
|
50
|
+
// We don't need AWS in development, so set it to empty values
|
|
51
|
+
AWS_ACCESS_KEY_ID: '',
|
|
52
|
+
AWS_SECRET_ACCESS_KEY: '',
|
|
53
|
+
AWS_REGION: 'eu-west-1',
|
|
54
|
+
// We do need an AWS S3 compatible storage in development.
|
|
55
|
+
// Set it to empty for now...
|
|
56
|
+
SPACES_ENDPOINT: 'ams3.digitaloceanspaces.com',
|
|
57
|
+
SPACES_BUCKET: 'stamhoofd',
|
|
58
|
+
SPACES_KEY: '',
|
|
59
|
+
SPACES_SECRET: '',
|
|
60
|
+
SPACES_PREFIX: 'simon', // todo: use username
|
|
61
|
+
// Mollie client id is shared with the frontend
|
|
62
|
+
MOLLIE_SECRET: '',
|
|
63
|
+
MOLLIE_API_KEY: '',
|
|
64
|
+
// Stripe secret key - required to test Stripe locally
|
|
65
|
+
STRIPE_SECRET_KEY: '',
|
|
66
|
+
STRIPE_ENDPOINT_SECRET: '',
|
|
67
|
+
STRIPE_CONNECT_ENDPOINT_SECRET: '',
|
|
68
|
+
// An internal secret, used for verifying infomration passed between services
|
|
69
|
+
// This one is public and committed to the repository because it is only used in development
|
|
70
|
+
INTERNAL_SECRET_KEY: 'vklRsSAOd0hqb4sx42kcTpFK6f3rCePi3HK/pJw5vz8=',
|
|
71
|
+
// Disable crons in certain development environments
|
|
72
|
+
CRONS_DISABLED: false,
|
|
73
|
+
// Change this if the SMTP server can't send from all domains
|
|
74
|
+
WHITELISTED_EMAIL_DESTINATIONS: ['*'],
|
|
75
|
+
// Whether to store cache files: todo
|
|
76
|
+
CACHE_PATH: 'backend' in service ? (projectPath + 'backend/app/' + service.backend + '/.cache') : undefined,
|
|
77
|
+
// These are used in development, and are not used in production so safe to use.
|
|
78
|
+
FILE_SIGNING_PUBLIC_KEY: { kty: 'EC', x: 'LZPou8JKNPoxgc1FXqLW_dqAYrv3_3ZoFHACwCiiunw', y: 'kBSKvtDVpa29J2mh5pICQD12dKO25fU3Bz-JItNAgEE', crv: 'P-256' },
|
|
79
|
+
FILE_SIGNING_PRIVATE_KEY: { kty: 'EC', x: 'LZPou8JKNPoxgc1FXqLW_dqAYrv3_3ZoFHACwCiiunw', y: 'kBSKvtDVpa29J2mh5pICQD12dKO25fU3Bz-JItNAgEE', crv: 'P-256', d: 'C0xuuMOMKeIDP6YPOz2dO1ccMYYrnpDpzz-_oRoq4io' },
|
|
80
|
+
FILE_SIGNING_ALG: 'ES256',
|
|
81
|
+
// Doesn't matter in development, unless you want to test the upgrade toasts and flows
|
|
82
|
+
LATEST_IOS_VERSION: 109,
|
|
83
|
+
LATEST_ANDROID_VERSION: 109,
|
|
84
|
+
// To test Mollie, we'll need the keys in both the frontend and backend
|
|
85
|
+
MOLLIE_CLIENT_ID: '',
|
|
86
|
+
MOLLIE_ORGANIZATION_TOKEN: '',
|
|
87
|
+
};
|
|
88
|
+
const frontendSpecific = {
|
|
89
|
+
// To test Mollie, we'll need the keys in both the frontend and backend
|
|
90
|
+
MOLLIE_CLIENT_ID: '',
|
|
91
|
+
// The version is visible in the footer of the frontend
|
|
92
|
+
VERSION: '',
|
|
93
|
+
};
|
|
94
|
+
const base = {
|
|
95
|
+
environment: 'development',
|
|
96
|
+
};
|
|
97
|
+
const { config: presetConfig, initFunctions } = await buildPresets(((_a = environment.presets) !== null && _a !== void 0 ? _a : []), service);
|
|
98
|
+
if ('backend' in service) {
|
|
99
|
+
return {
|
|
100
|
+
config: {
|
|
101
|
+
...backendSpecific,
|
|
102
|
+
...base,
|
|
103
|
+
...presetConfig,
|
|
104
|
+
...environment,
|
|
105
|
+
},
|
|
106
|
+
initFunctions,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
config: {
|
|
111
|
+
...frontendSpecific,
|
|
112
|
+
...base,
|
|
113
|
+
...presetConfig,
|
|
114
|
+
...environment,
|
|
115
|
+
},
|
|
116
|
+
initFunctions,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
export async function build(name, service) {
|
|
120
|
+
return (await buildConfig(name, service)).config;
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../src/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAgB,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAElC,KAAK,UAAU,UAAU,CAAC,IAAY;IAClC,IAAI,CAAC;QACD,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACtB,OAAO,IAAI,CAAC;IA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AA6C,EAAE;QAC3M,gBAAgB,EAAE,OAAO;QAEzB,sFAAsF;QACtF,kBAAkB,EAAE,GAAG;QACvB,sBAAsB,EAAE,GAAG;QAE3B,uEAAuE;QACvE,gBAAgB,EAAE,EAAE;QACpB,yBAAyB,EAAE,EAAE;KAChC,CAAC;IAEF,MAAM,gBAAgB,GAAgC;QAClD,uEAAuE;QACvE,gBAAgB,EAAE,EAAE;QAEpB,uDAAuD;QACvD,OAAO,EAAE,EAAE;KACd,CAAC;IAEF,MAAM,IAAI,GAA+B;QACrC,WAAW,EAAE,aAAa;KAC7B,CAAC;IAEF,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,MAAM,YAAY,CAAC,CAAC,MAAA,WAAW,CAAC,OAAO,mCAAI,EAAE,CAAa,EAAE,OAAO,CAAC,CAAC;IAErH,IAAI,SAAS,IAAI,OAAO,EAAE,CAAC;QACvB,OAAO;YACH,MAAM,EAAE;gBACJ,GAAG,eAAe;gBAClB,GAAG,IAAI;gBACP,GAAG,YAAY;gBACf,GAAG,WAAW;aACjB;YACD,aAAa;SAChB,CAAC;IACN,CAAC;IAED,OAAO;QACH,MAAM,EAAE;YACJ,GAAG,gBAAgB;YACnB,GAAG,IAAI;YACP,GAAG,YAAY;YACf,GAAG,WAAW;SACjB;QACD,aAAa;KAChB,CAAC;AACN,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,IAAY,EAAE,OAAgB;IACtD,OAAO,CAAC,MAAM,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ConcurrentlyCommandInput } from 'concurrently';
|
|
2
|
+
import { Service } from './Service';
|
|
3
|
+
export type InitFunction = (config: SharedEnvironment) => Promise<undefined | ConcurrentlyCommandInput[]>;
|
|
4
|
+
export declare function buildPresets(presets: string[], service: Service): Promise<{
|
|
5
|
+
config: any;
|
|
6
|
+
initFunctions: InitFunction[];
|
|
7
|
+
}>;
|
|
8
|
+
//# sourceMappingURL=buildPresets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildPresets.d.ts","sourceRoot":"","sources":["../../../src/buildPresets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,iBAAiB,KAAK,OAAO,CAAC,SAAS,GAAG,wBAAwB,EAAE,CAAC,CAAC;AAC1G,wBAAsB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC;IAAE,MAAM,EAAE,GAAG,CAAC;IAAC,aAAa,EAAE,YAAY,EAAE,CAAA;CAAE,CAAC,CAkF/H"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export async function buildPresets(presets, service) {
|
|
2
|
+
const defaultPrests = [];
|
|
3
|
+
const todo = [...presets];
|
|
4
|
+
for (const defaultPreset of defaultPrests) {
|
|
5
|
+
if (!todo.includes(defaultPreset)) {
|
|
6
|
+
todo.unshift(defaultPreset);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
const result = {};
|
|
10
|
+
const presetsSet = new Set(todo);
|
|
11
|
+
const initFunctions = [];
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/prefer-for-of
|
|
13
|
+
for (let index = 0; index < todo.length; index++) {
|
|
14
|
+
const preset = todo[index];
|
|
15
|
+
// Loop
|
|
16
|
+
const fileLocation = `./presets/${preset}.js`;
|
|
17
|
+
try {
|
|
18
|
+
const presetBuilder = await import(fileLocation);
|
|
19
|
+
let config;
|
|
20
|
+
if ('config' in presetBuilder) {
|
|
21
|
+
config = presetBuilder.config;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
if ('init' in presetBuilder) {
|
|
25
|
+
initFunctions.push(presetBuilder.init);
|
|
26
|
+
}
|
|
27
|
+
if ('build' in presetBuilder) {
|
|
28
|
+
config = await presetBuilder.build(service);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (config && 'presets' in config) {
|
|
32
|
+
// Append to current loop if not yet in the loop
|
|
33
|
+
for (const key of config.presets) {
|
|
34
|
+
if (!presetsSet.has(key)) {
|
|
35
|
+
presetsSet.add(key);
|
|
36
|
+
todo.push(key);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (config) {
|
|
41
|
+
Object.assign(result, config);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
if (error.message.includes('Cannot find module') && !error.message.includes('package.json')) {
|
|
46
|
+
console.error(error);
|
|
47
|
+
throw new Error(`Preset ${preset} does not exist. Please check the presets directory.`);
|
|
48
|
+
}
|
|
49
|
+
throw new Error(`Failed to load preset ${preset}: ${error.message}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
// Some presets still need to inject things, because they depend on the total configuration of the service
|
|
53
|
+
for (const preset of presetsSet) {
|
|
54
|
+
const fileLocation = `./presets/${preset}.js`;
|
|
55
|
+
try {
|
|
56
|
+
const presetBuilder = await import(fileLocation);
|
|
57
|
+
if ('inject' in presetBuilder) {
|
|
58
|
+
const injectedConfig = await presetBuilder.inject(result, service);
|
|
59
|
+
Object.assign(result, injectedConfig);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
if (error.message.includes('Cannot find module')) {
|
|
64
|
+
throw new Error(`Preset ${preset} does not exist. Please check the presets directory.`);
|
|
65
|
+
}
|
|
66
|
+
throw new Error(`Failed to inject preset ${preset}: ${error.message}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
config: result,
|
|
71
|
+
initFunctions,
|
|
72
|
+
};
|
|
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AAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBACnE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;YAC1C,CAAC;QACL,CAAC;QACD,OAAO,KAAK,EAAE,CAAC;YACX,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAAC;gBAC/C,MAAM,IAAI,KAAK,CAAC,UAAU,MAAM,sDAAsD,CAAC,CAAC;YAC5F,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,2BAA2B,MAAM,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC3E,CAAC;IACL,CAAC;IAED,OAAO;QACH,MAAM,EAAE,MAAM;QACd,aAAa;KAChB,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function escapeShellArg(arg: any): string;
|
|
2
|
+
/**
|
|
3
|
+
* A bit slower - uses local 1Password CLI
|
|
4
|
+
*/
|
|
5
|
+
export declare function read1PasswordCli(key: string, options?: {
|
|
6
|
+
optional: boolean;
|
|
7
|
+
}): Promise<string>;
|
|
8
|
+
//# sourceMappingURL=1password.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1password.d.ts","sourceRoot":"","sources":["../../../../src/helpers/1password.ts"],"names":[],"mappings":"AAMA,wBAAgB,cAAc,CAAC,GAAG,KAAA,UAEjC;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAkBpG"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { exec } from 'child_process';
|
|
2
|
+
import util from 'util';
|
|
3
|
+
import { cache } from './cache';
|
|
4
|
+
import { Formatter } from '@stamhoofd/utility';
|
|
5
|
+
const execPromise = util.promisify(exec);
|
|
6
|
+
export function escapeShellArg(arg) {
|
|
7
|
+
return `'${arg.replace(/'/g, `'\\''`)}'`;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A bit slower - uses local 1Password CLI
|
|
11
|
+
*/
|
|
12
|
+
export async function read1PasswordCli(key, options) {
|
|
13
|
+
return await cache(Formatter.slug('1password-cli-' + key), async () => {
|
|
14
|
+
// Read key from 1Password
|
|
15
|
+
const result = await execPromise(`op read ${escapeShellArg(key)}`);
|
|
16
|
+
const value = result.stdout;
|
|
17
|
+
// Remove trailing newline (only 1)
|
|
18
|
+
const val = value.substring(0, value.length - 1);
|
|
19
|
+
if (val === '') {
|
|
20
|
+
if (options === null || options === void 0 ? void 0 : options.optional) {
|
|
21
|
+
return '';
|
|
22
|
+
}
|
|
23
|
+
throw new Error('Key not found in 1Password: ' + key);
|
|
24
|
+
}
|
|
25
|
+
return val;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=1password.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1password.js","sourceRoot":"","sources":["../../../../src/helpers/1password.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAEzC,MAAM,UAAU,cAAc,CAAC,GAAG;IAC9B,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC;AAC7C,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,GAAW,EAAE,OAA+B;IAC/E,OAAO,MAAM,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,gBAAgB,GAAG,GAAG,CAAC,EAAE,KAAK,IAAI,EAAE;QAClE,0BAA0B;QAC1B,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,WAAW,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACnE,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;QAE5B,mCAAmC;QACnC,MAAM,GAAG,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAEjD,IAAI,GAAG,KAAK,EAAE,EAAE,CAAC;YACb,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,EAAE,CAAC;gBACpB,OAAO,EAAE,CAAC;YACd,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,8BAA8B,GAAG,GAAG,CAAC,CAAC;QAC1D,CAAC;QAED,OAAO,GAAG,CAAC;IACf,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Since we need to build the environment for every running app, we want to cache some results
|
|
3
|
+
* to prevent for example, prompting for 1Password credentials every time.
|
|
4
|
+
*
|
|
5
|
+
* On top of that, we want to pass data from the 'init' step to the 'build' step, such as the stripe webhook secret.
|
|
6
|
+
*/
|
|
7
|
+
export declare function withFileLock<T>(filePath: string, action: () => Promise<T>): Promise<T>;
|
|
8
|
+
export declare function cache(key: string, getValue?: () => Promise<string>): Promise<any>;
|
|
9
|
+
//# sourceMappingURL=cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../../src/helpers/cache.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA8BH,wBAAsB,YAAY,CAAC,CAAC,EAChC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACzB,OAAO,CAAC,CAAC,CAAC,CA0DZ;AAOD,wBAAsB,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,gBAsDxE"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Since we need to build the environment for every running app, we want to cache some results
|
|
3
|
+
* to prevent for example, prompting for 1Password credentials every time.
|
|
4
|
+
*
|
|
5
|
+
* On top of that, we want to pass data from the 'init' step to the 'build' step, such as the stripe webhook secret.
|
|
6
|
+
*/
|
|
7
|
+
import fs from 'node:fs/promises';
|
|
8
|
+
import { getProjectPath } from './project-path';
|
|
9
|
+
// Wait max 60 seconds to acquire the lock
|
|
10
|
+
const LOCK_RETRY_INTERVAL = 100; // ms
|
|
11
|
+
const MAX_RETRIES = 600;
|
|
12
|
+
function withTemporarySignalHandler(cleanup) {
|
|
13
|
+
const handleShutdown = () => {
|
|
14
|
+
cleanup().then(() => {
|
|
15
|
+
// Cleanup completed, exit the process
|
|
16
|
+
process.exit(0); // Exit gracefully
|
|
17
|
+
}).catch((err) => {
|
|
18
|
+
console.error('Error during cleanup:', err);
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
// Attach listeners
|
|
22
|
+
process.on('SIGINT', handleShutdown);
|
|
23
|
+
process.on('SIGTERM', handleShutdown);
|
|
24
|
+
return () => {
|
|
25
|
+
// Detach listeners
|
|
26
|
+
process.off('SIGINT', handleShutdown);
|
|
27
|
+
process.off('SIGTERM', handleShutdown);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export async function withFileLock(filePath, action) {
|
|
31
|
+
const lockPath = `${filePath}.lock`;
|
|
32
|
+
let didLock = false;
|
|
33
|
+
;
|
|
34
|
+
const cleanup = withTemporarySignalHandler(async () => {
|
|
35
|
+
if (!didLock)
|
|
36
|
+
return; // No need to clean up if we never acquired the lock
|
|
37
|
+
try {
|
|
38
|
+
await fs.unlink(lockPath);
|
|
39
|
+
didLock = false; // Reset the lock state
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
// ignore
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
try {
|
|
46
|
+
for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
|
|
47
|
+
try {
|
|
48
|
+
if (attempt > 0 && attempt * LOCK_RETRY_INTERVAL % 1000 === 0) {
|
|
49
|
+
console.log('Waiting for lock...');
|
|
50
|
+
}
|
|
51
|
+
const fd = await fs.open(lockPath, 'wx'); // 'wx' fails if exists
|
|
52
|
+
await fd.close();
|
|
53
|
+
didLock = true;
|
|
54
|
+
try {
|
|
55
|
+
const result = await action(); // Do the actual file operation
|
|
56
|
+
try {
|
|
57
|
+
await fs.unlink(lockPath); // Release the lock
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
// ignore
|
|
61
|
+
}
|
|
62
|
+
didLock = false;
|
|
63
|
+
return result;
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
try {
|
|
67
|
+
await fs.unlink(lockPath); // Release the lock
|
|
68
|
+
}
|
|
69
|
+
catch (err) {
|
|
70
|
+
// ignore
|
|
71
|
+
}
|
|
72
|
+
didLock = false;
|
|
73
|
+
throw err;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
if (err.code !== 'EEXIST')
|
|
78
|
+
throw err; // Unexpected error
|
|
79
|
+
await sleep(LOCK_RETRY_INTERVAL);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
throw new Error(`Could not acquire lock for ${filePath} after ${MAX_RETRIES} attempts`);
|
|
83
|
+
}
|
|
84
|
+
finally {
|
|
85
|
+
cleanup(); // Ensure cleanup is called on exit
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function sleep(ms) {
|
|
89
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
90
|
+
}
|
|
91
|
+
// Store the cache in the project root folder (yarn workspace root)
|
|
92
|
+
export async function cache(key, getValue) {
|
|
93
|
+
const rootPath = await getProjectPath();
|
|
94
|
+
// Create cache folder if it doesn't exist
|
|
95
|
+
const cacheFolder = rootPath + '.cache';
|
|
96
|
+
try {
|
|
97
|
+
await fs.mkdir(cacheFolder, { recursive: true });
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
console.error('Failed to create cache folder:', error);
|
|
101
|
+
throw error;
|
|
102
|
+
}
|
|
103
|
+
const filePath = `${cacheFolder}/${key}`;
|
|
104
|
+
return await withFileLock(filePath, async () => {
|
|
105
|
+
// First read to check if it is cached
|
|
106
|
+
let cachedValue = null;
|
|
107
|
+
try {
|
|
108
|
+
cachedValue = await fs.readFile(filePath, 'utf-8');
|
|
109
|
+
const decoded = JSON.parse(cachedValue);
|
|
110
|
+
if (decoded && typeof decoded.date === 'number' && typeof decoded.value === 'string') {
|
|
111
|
+
const now = new Date().getTime();
|
|
112
|
+
const age = now - decoded.date;
|
|
113
|
+
// If the cache is older than 1 day, we consider it stale
|
|
114
|
+
if (age < 60 * 60 * 1000 * 24) {
|
|
115
|
+
return decoded.value; // Return cached value if it's still fresh
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
if (error.code !== 'ENOENT') {
|
|
121
|
+
console.error('Failed to read cache file:', error);
|
|
122
|
+
throw error;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
// Write file
|
|
126
|
+
if (!getValue) {
|
|
127
|
+
throw new Error(key + ' is not cached, and cannot get fresh value');
|
|
128
|
+
}
|
|
129
|
+
const value = await getValue();
|
|
130
|
+
const data = {
|
|
131
|
+
date: new Date().getTime(),
|
|
132
|
+
value,
|
|
133
|
+
};
|
|
134
|
+
// Write the value to the cache file
|
|
135
|
+
await fs.writeFile(filePath, JSON.stringify(data), 'utf-8');
|
|
136
|
+
return value;
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":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