@firestartr/cli 1.45.0-snapshot-7 → 1.45.0-snapshot-9
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/build/index.js +27 -16
- package/build/packages/catalog_common/src/features/tarballs.d.ts +4 -4
- package/build/packages/cdk8s_renderer/src/claims/base/schemas/index.d.ts +1 -0
- package/build/packages/cdk8s_renderer/src/claims/github/feature.schema.d.ts +1 -0
- package/build/packages/cdk8s_renderer/src/claims/github/index.d.ts +1 -0
- package/build/packages/features_preparer/src/renderer.d.ts +1 -1
- package/build/packages/github/src/branches.d.ts +4 -4
- package/package.json +1 -1
package/build/index.js
CHANGED
@@ -263047,26 +263047,26 @@ const fullMembersTeam = getFromEnvironmentWithDefault(envVars.fullOrgGroup, `${o
|
|
263047
263047
|
|
263048
263048
|
|
263049
263049
|
const tarballs_messageLog = src_default()('firestartr:catalog_common:features:tarballs');
|
263050
|
-
function getFeatureZipDownloadPath(featureName, version) {
|
263051
|
-
const featureDownloadPath = `/tmp/${featureName
|
263050
|
+
function getFeatureZipDownloadPath(featureName, version, owner, repo) {
|
263051
|
+
const featureDownloadPath = `/tmp/${basicFeaturePath(featureName, version, owner, repo)}-zipball.zip`;
|
263052
263052
|
tarballs_messageLog('Feature tarball download path %s', featureDownloadPath);
|
263053
263053
|
return featureDownloadPath;
|
263054
263054
|
}
|
263055
|
-
function removeFeatureTarball(featureName, version) {
|
263056
|
-
const featurePath = getFeatureZipDownloadPath(featureName, version);
|
263055
|
+
function removeFeatureTarball(featureName, version, owner, repo) {
|
263056
|
+
const featurePath = getFeatureZipDownloadPath(featureName, version, owner, repo);
|
263057
263057
|
tarballs_messageLog('Removing feature tarball %s', featurePath);
|
263058
263058
|
external_fs_.unlinkSync(featurePath);
|
263059
263059
|
tarballs_messageLog(`Removed tarball for feature ${featureName} and version ${version}: ${featurePath}`);
|
263060
263060
|
}
|
263061
|
-
function featureTarballExists(featureName, version) {
|
263062
|
-
const featurePath = getFeatureZipDownloadPath(featureName, version);
|
263061
|
+
function featureTarballExists(featureName, version, owner, repo) {
|
263062
|
+
const featurePath = getFeatureZipDownloadPath(featureName, version, owner, repo);
|
263063
263063
|
const exists = external_fs_.existsSync(featurePath);
|
263064
263064
|
tarballs_messageLog(`Tarball ${featurePath} exists? ${exists}`);
|
263065
263065
|
return exists;
|
263066
263066
|
}
|
263067
|
-
function getFeaturesExtractPath(featureName, version, options = {}) {
|
263067
|
+
function getFeaturesExtractPath(featureName, version, owner, repo, options = {}) {
|
263068
263068
|
const { createIfNotExists } = options;
|
263069
|
-
const extractPath = `/tmp/${featureName
|
263069
|
+
const extractPath = `/tmp/${basicFeaturePath(featureName, version, owner, repo)}-extract`;
|
263070
263070
|
tarballs_messageLog('Extract path %s', extractPath);
|
263071
263071
|
if (createIfNotExists && !external_fs_.existsSync(extractPath)) {
|
263072
263072
|
tarballs_messageLog('Extract path %s does not exist, creating', extractPath);
|
@@ -263074,6 +263074,13 @@ function getFeaturesExtractPath(featureName, version, options = {}) {
|
|
263074
263074
|
}
|
263075
263075
|
return extractPath;
|
263076
263076
|
}
|
263077
|
+
function basicFeaturePath(featureName, version, owner, repo) {
|
263078
|
+
const legs = [owner, repo, featureName, version].map((leg) => trasformLeg(leg));
|
263079
|
+
return legs.join('-');
|
263080
|
+
}
|
263081
|
+
function trasformLeg(leg) {
|
263082
|
+
return leg.replace(/\//g, '___');
|
263083
|
+
}
|
263077
263084
|
|
263078
263085
|
;// CONCATENATED MODULE: ../catalog_common/src/features/features_io.ts
|
263079
263086
|
|
@@ -263081,7 +263088,7 @@ function getFeaturesExtractPath(featureName, version, options = {}) {
|
|
263081
263088
|
|
263082
263089
|
const features_io_messageLog = src_default()('firestartr:catalog_common:features:features_io');
|
263083
263090
|
function getFeatureRenderedPathForEntity(entity, featureName, basePath = '/tmp') {
|
263084
|
-
const entityFolderName = `${entity.
|
263091
|
+
const entityFolderName = `${entity.metadata.name}`.toLowerCase();
|
263085
263092
|
return external_path_default().join(basePath, entityFolderName, featureName);
|
263086
263093
|
}
|
263087
263094
|
function getFeatureRenderedConfigForComponent(entity, featureName, basePath = '/tmp/features') {
|
@@ -272920,6 +272927,7 @@ class FirestartrAllClaim {
|
|
272920
272927
|
},
|
272921
272928
|
ref: {
|
272922
272929
|
type: 'string',
|
272930
|
+
pattern: '^[a-zA-Z0-9-._@/]+$',
|
272923
272931
|
description: 'A github reference (commit, tag, branch)',
|
272924
272932
|
},
|
272925
272933
|
args: {
|
@@ -275767,8 +275775,8 @@ function updateFileContent(featureRenderPath, filePath, content) {
|
|
275767
275775
|
|
275768
275776
|
|
275769
275777
|
const renderer_messageLog = src_default()('firestartr:features_preparer:renderer');
|
275770
|
-
function renderFeature(featureName, version, featureOwner, renderPath = '/tmp', featureArgs = {}) {
|
275771
|
-
const extractPath = external_path_default().join(catalog_common.features.tarballs.getFeaturesExtractPath(featureName, version), 'packages', featureName);
|
275778
|
+
function renderFeature(featureName, version, owner, repo, featureOwner, renderPath = '/tmp', featureArgs = {}) {
|
275779
|
+
const extractPath = external_path_default().join(catalog_common.features.tarballs.getFeaturesExtractPath(featureName, version, owner, repo), 'packages', featureName);
|
275772
275780
|
const renderedPath = catalog_common.features.features.getFeatureRenderedPathForEntity(featureOwner, featureName, renderPath);
|
275773
275781
|
renderer_messageLog(`Rendering feature ${featureName} to ${renderedPath} with component ${JSON.stringify(featureOwner)}`);
|
275774
275782
|
return features_renderer.render(extractPath, renderedPath, featureOwner, {}, featureArgs);
|
@@ -275808,6 +275816,8 @@ async function downloadZipBall(url, filePath) {
|
|
275808
275816
|
|
275809
275817
|
|
275810
275818
|
|
275819
|
+
|
275820
|
+
const installer_log = src_default()('firestartr:features_preparer:installer');
|
275811
275821
|
async function getFeatureConfigFromRef(featureName, featureRef, featureOwner, // -> cr
|
275812
275822
|
featureArgs = {}, repo = 'features', owner = 'prefapp') {
|
275813
275823
|
// reference is the featureRef directly
|
@@ -275830,20 +275840,21 @@ featureArgs = {}, repo = 'features', owner = 'prefapp') {
|
|
275830
275840
|
ref: reference,
|
275831
275841
|
url: `https://github.com/${owner}/${repo}/tree/${reference}/packages/${featureName}`,
|
275832
275842
|
};
|
275833
|
-
return renderFeature(featureName, reference, featureOwner, '/tmp', featureArgs);
|
275843
|
+
return renderFeature(featureName, reference, owner, repo, featureOwner, '/tmp', featureArgs);
|
275834
275844
|
}
|
275835
275845
|
async function prepareFeature(featureName, version, repo = 'features', owner = 'prefapp') {
|
275836
275846
|
await downloadFeatureZip(repo, featureName, version, owner);
|
275837
275847
|
}
|
275838
275848
|
async function downloadFeatureZip(repo, featureName, reference, owner = 'prefapp') {
|
275839
275849
|
try {
|
275840
|
-
const
|
275841
|
-
const zipballExtractPath = catalog_common.features.tarballs.getFeaturesExtractPath(featureName, reference, { createIfNotExists: true });
|
275850
|
+
const zipballExtractPath = catalog_common.features.tarballs.getFeaturesExtractPath(featureName, reference, owner, repo, { createIfNotExists: false });
|
275842
275851
|
console.log(`Zipball extract path: ${zipballExtractPath}`);
|
275843
275852
|
if (external_fs_.existsSync(zipballExtractPath)) {
|
275844
|
-
console.log(`Zipball extract path ${zipballExtractPath} already exists,
|
275845
|
-
|
275853
|
+
console.log(`Zipball extract path ${zipballExtractPath} already exists, reusing it.`);
|
275854
|
+
return zipballExtractPath;
|
275846
275855
|
}
|
275856
|
+
installer_log(`Feature ${[featureName, reference, owner, repo].join('-')} has not been downloaded yet, downloading`);
|
275857
|
+
const octokit = await github_0.getOctokitForOrg(owner);
|
275847
275858
|
const response = await octokit.request('GET /repos/{owner}/{repo}/zipball/{reference}', {
|
275848
275859
|
request: {
|
275849
275860
|
parseSuccessResponseBody: false,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export declare function getFeatureZipDownloadPath(featureName: string, version: string): string;
|
2
|
-
export declare function removeFeatureTarball(featureName: string, version: string): void;
|
3
|
-
export declare function featureTarballExists(featureName: string, version: string): boolean;
|
4
|
-
export declare function getFeaturesExtractPath(featureName: string, version: string, options?: any): string;
|
1
|
+
export declare function getFeatureZipDownloadPath(featureName: string, version: string, owner: string, repo: string): string;
|
2
|
+
export declare function removeFeatureTarball(featureName: string, version: string, owner: string, repo: string): void;
|
3
|
+
export declare function featureTarballExists(featureName: string, version: string, owner: string, repo: string): boolean;
|
4
|
+
export declare function getFeaturesExtractPath(featureName: string, version: string, owner: string, repo: string, options?: any): string;
|
@@ -1 +1 @@
|
|
1
|
-
export declare function renderFeature(featureName: string, version: string, featureOwner: any, renderPath?: string, featureArgs?: any): any;
|
1
|
+
export declare function renderFeature(featureName: string, version: string, owner: any, repo: any, featureOwner: any, renderPath?: string, featureArgs?: any): any;
|
@@ -428,7 +428,7 @@ export declare function getBranch(repo: string, branch: string, owner?: string):
|
|
428
428
|
verified_at: string;
|
429
429
|
};
|
430
430
|
};
|
431
|
-
author: {
|
431
|
+
author: Record<string, never> | {
|
432
432
|
name?: string;
|
433
433
|
email?: string;
|
434
434
|
login: string;
|
@@ -451,8 +451,8 @@ export declare function getBranch(repo: string, branch: string, owner?: string):
|
|
451
451
|
site_admin: boolean;
|
452
452
|
starred_at?: string;
|
453
453
|
user_view_type?: string;
|
454
|
-
}
|
455
|
-
committer: {
|
454
|
+
};
|
455
|
+
committer: Record<string, never> | {
|
456
456
|
name?: string;
|
457
457
|
email?: string;
|
458
458
|
login: string;
|
@@ -475,7 +475,7 @@ export declare function getBranch(repo: string, branch: string, owner?: string):
|
|
475
475
|
site_admin: boolean;
|
476
476
|
starred_at?: string;
|
477
477
|
user_view_type?: string;
|
478
|
-
}
|
478
|
+
};
|
479
479
|
parents: {
|
480
480
|
sha: string;
|
481
481
|
url: string;
|