UNPKG

1.78 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const path = require("path");
4class LocationProvider {
5 constructor() {
6 this.integrationRoot = process.cwd();
7 this.bearerDir = path.join(this.integrationRoot, '.bearer');
8 }
9 integrationRootResourcePath(filename) {
10 return path.join(this.integrationRoot, filename);
11 }
12 // ~/views
13 get srcViewsDir() {
14 return path.join(this.integrationRoot, 'views');
15 }
16 srcViewsDirResource(name) {
17 return path.join(this.srcViewsDir, name);
18 }
19 // ~/functions
20 get srcFunctionsDir() {
21 return path.join(this.integrationRoot, 'functions');
22 }
23 buildViewsResourcePath(resource) {
24 return path.join(this.buildViewsDir, resource);
25 }
26 // ~/.bearer/views
27 get buildViewsDir() {
28 return path.join(this.bearerDir, 'views');
29 }
30 // ~/.bearer/views/src
31 get buildViewsComponentsDir() {
32 return path.join(this.buildViewsDir, 'src');
33 }
34 // ~/.bearer/tmp
35 get buildTmpDir() {
36 return path.join(this.bearerDir, 'tmp');
37 }
38 // ~/.bearer/functions
39 get buildFunctionsDir() {
40 return path.join(this.bearerDir, 'functions');
41 }
42 buildFunctionsResourcePath(resource) {
43 return path.join(this.buildFunctionsDir, resource);
44 }
45 get buildArtifactDir() {
46 return path.join(this.bearerDir, 'artifacts');
47 }
48 buildArtifactResourcePath(resource) {
49 return path.join(this.buildArtifactDir, resource);
50 }
51 get authConfigPath() {
52 return this.integrationRootResourcePath('auth.config.json');
53 }
54 get localConfigPath() {
55 return this.integrationRootResourcePath('local.config.jsonc');
56 }
57}
58exports.default = LocationProvider;