Skip to content

Commit

Permalink
reverse unrelated changes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexforsyth committed Jan 4, 2024
1 parent 67855cd commit f1b8ad3
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 54 deletions.
20 changes: 1 addition & 19 deletions packages/blueprints/blueprint/src/blueprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as fs from 'fs';
import * as path from 'path';

import { Project } from 'projen';
import { BlueprintInstantiation, Context, ResynthesisPhase } from './context/context';
import { Context, ResynthesisPhase } from './context/context';
import { TraversalOptions, traverse } from './context/traverse';
import { createLifecyclePullRequest } from './pull-requests/create-lifecycle-pull-request';
import { ContextFile, createContextFile, destructurePath } from './resynthesis/context-file';
Expand Down Expand Up @@ -59,9 +59,6 @@ export class Blueprint extends Project {
name: process.env.CONTEXT_PROJECTNAME,
bundlepath: process.env.EXISTING_BUNDLE_ABS,
options: getOptions(path.join(process.env.EXISTING_BUNDLE_ABS || '', OPTIONS_FILE)),
blueprint: {
instantiations: structureExistingBlueprints(process.env.INSTANTIATIONS_ABS),
},
src: {
listRepositoryNames: (): string[] => {
const repoBundlePath = path.join(this.context.project.bundlepath || '', 'src');
Expand Down Expand Up @@ -252,18 +249,3 @@ function getOptions(location: string): any {
return {};
}
}

function structureExistingBlueprints(location: string | undefined): BlueprintInstantiation[] {
if (!fs.existsSync(location || '')) {
console.warn('Could not find instantiations at ' + location);
return [];
}
try {
const result = JSON.parse(fs.readFileSync(location!).toString());
return result as BlueprintInstantiation[];
} catch (error) {
console.error(error);
console.error('Could not read instantiations at ' + location);
}
return [];
}
25 changes: 0 additions & 25 deletions packages/blueprints/blueprint/src/context/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,6 @@ export interface PackageConfiguration {
readonly name?: string;
readonly version?: string;
}

/**
* This represents an instantiation of a blueprint
*/
export interface BlueprintInstantiation {
/**
* This is a unique;
*/
id: string;
}

/**
* context about the existing project bundle (if it exists)
*/
Expand All @@ -32,20 +21,6 @@ export interface Project {
* The options used on the previous run of this blueprint.
*/
options?: any;

/**
* Information about Blueprints the existing project
*/
blueprint: {
/**
* A list of all blueprint instantiations already present in your project
*/
instantiations: BlueprintInstantiation[];
};

/**
* The source code from the existing project. Note, this can be across multiple repositories
*/
src: {
/**
* This can be used to list the repositories in the exisiting codebase.
Expand Down
2 changes: 1 addition & 1 deletion packages/blueprints/test-blueprint/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions packages/blueprints/test-blueprint/src/blueprint.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { spawnSync } from 'child_process';
import * as fs from 'fs';
import * as path from 'path';
import { Environment, EnvironmentDefinition, AccountConnection, Role } from '@amazon-codecatalyst/blueprint-component.environments';
import { SourceRepository, SourceFile } from '@amazon-codecatalyst/blueprint-component.source-repositories';
import { Workflow, NodeWorkflowDefinitionSamples } from '@amazon-codecatalyst/blueprint-component.workflows';
Expand Down Expand Up @@ -206,12 +204,5 @@ export class Blueprint extends ParentBlueprint {
new SourceFile(internalRepo, 'blueprint.d.ts', blueprintInterface);
new SourceFile(internalRepo, 'defaults.json', blueprintDefaults);
new SourceFile(internalRepo, 'internal/ast.json', blueprintAST);

if (process.env.INSTANTIATIONS_ABS) {
const instanpath = path.join(process.env.INSTANTIATIONS_ABS);
const instantiations = JSON.parse(fs.readFileSync(instanpath).toString());
new SourceFile(internalRepo, 'internal/INSTANTIATIONS_ABS.json', JSON.stringify(instantiations, null, 2));
}
new SourceFile(internalRepo, 'internal/env.json', JSON.stringify(process.env, null, 2));
}
}

0 comments on commit f1b8ad3

Please sign in to comment.