Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g codify
$ codify COMMAND
running command...
$ codify (--version)
codify/0.7.0 darwin-arm64 node-v20.15.1
codify/0.7.1 darwin-arm64 node-v20.15.1
$ codify --help [COMMAND]
USAGE
$ codify COMMAND
Expand Down Expand Up @@ -74,7 +74,7 @@ EXAMPLES
$ codify apply -S <sudo password>
```

_See code: [src/commands/apply.ts](https://github.com/kevinwang5658/codify/blob/v0.7.0/src/commands/apply.ts)_
_See code: [src/commands/apply.ts](https://github.com/kevinwang5658/codify/blob/v0.7.1/src/commands/apply.ts)_

## `codify destroy`

Expand Down Expand Up @@ -113,7 +113,7 @@ EXAMPLES
$ codify destroy
```

_See code: [src/commands/destroy.ts](https://github.com/kevinwang5658/codify/blob/v0.7.0/src/commands/destroy.ts)_
_See code: [src/commands/destroy.ts](https://github.com/kevinwang5658/codify/blob/v0.7.1/src/commands/destroy.ts)_

## `codify help [COMMAND]`

Expand Down Expand Up @@ -189,7 +189,7 @@ EXAMPLES
$ codify import \*
```

_See code: [src/commands/import.ts](https://github.com/kevinwang5658/codify/blob/v0.7.0/src/commands/import.ts)_
_See code: [src/commands/import.ts](https://github.com/kevinwang5658/codify/blob/v0.7.1/src/commands/import.ts)_

## `codify init`

Expand Down Expand Up @@ -217,7 +217,7 @@ EXAMPLES
$ codify init
```

_See code: [src/commands/init.ts](https://github.com/kevinwang5658/codify/blob/v0.7.0/src/commands/init.ts)_
_See code: [src/commands/init.ts](https://github.com/kevinwang5658/codify/blob/v0.7.1/src/commands/init.ts)_

## `codify plan`

Expand Down Expand Up @@ -254,7 +254,7 @@ EXAMPLES
$ codify plan -p ../
```

_See code: [src/commands/plan.ts](https://github.com/kevinwang5658/codify/blob/v0.7.0/src/commands/plan.ts)_
_See code: [src/commands/plan.ts](https://github.com/kevinwang5658/codify/blob/v0.7.1/src/commands/plan.ts)_

## `codify update [CHANNEL]`

Expand Down
208 changes: 2 additions & 206 deletions codify.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,213 +5,9 @@
"default": "../codify-homebrew-plugin/src/index.ts"
}
},
{ "type": "virtualenv" },
{ "type": "virtualenv-project", "dest": ".venv12", "cwd": "~/Projects/python-temp2", "automaticallyInstallRequirementsTxt": true },
{ "type": "pnpm", "version": "9.15.5", "globalEnvNodeVersion": "20.15" },
{ "type": "path", "path": "$HOME/.bun/bin"},
{
"type": "path",
"paths": [
"$PYENV_ROOT/bin",
"$BUN_INSTALL/bin",
"$DENO_INSTALL/bin",
"~/.jenv/bin",
"~/a/random/path",
"$NVM_DIR/.bin/2",
"$NVM_DIR/.bin/3"
],
"declarationsOnly": true,
"name": "1"
},
{
"type": "homebrew",
"taps": [
"cirruslabs/cli",
"hashicorp/tap",
"homebrew/bundle",
"homebrew/services"
],
"casks": [
"android-commandlinetools",
"android-studio",
"mitmproxy"
],
"formulae": [
"ack",
"asciinema",
"cirrus",
"expect",
"git-lfs",
"groff",
"hyperfine",
"jenv",
"jq",
"mas",
"openjdk@11",
"openjdk@17",
"openjdk@21",
"packer",
"pgcli",
"postgresql@14",
"sshpass",
"tart",
"xz",
"zstd",
"f1bonacc1/tap/process-compose"
]
},
{ "version":"1.10.5","type":"terraform" },
{ "type": "alias", "alias": "gcdsdd", "value": "git clone" },
{
"type": "ssh-config",
"hosts": [
{
"Host": "192.168.64.94",
"HostName": "192.168.64.94",
"User": "admin"
},
{
"Host": "192.168.2.48",
"HostName": "192.168.2.48",
"User": "pi"
},
{
"Host": "*",
"AddKeysToAgent": true,
"IdentityFile": "~/.ssh/id_ed25519"
},
{
"Host": "ec2",
"HostName": "54.82.78.202",
"User": "ec2-user",
"IdentityFile": "~/.ssh/ed25519"
},
{
"Host": "ec2-2",
"HostName": "35.153.180.154",
"User": "ec2-user",
"IdentityFile": "~/.ssh/ed25519"
}
]
},
{
"type": "ssh-key",
"fileName": "id_ed25519",
"passphrase": "",
"keyType": "ed25519"
},
{
"type": "alias",
"alias": "gc",
"value": "git commit -v"
},
{
"type": "pgcli"
},
{
"type": "file",
"contents": "[\n\t{\n \"type\": \"homebrew\",\n \"taps\": [\n \"cirruslabs/cli\",\n \"hashicorp/tap\",\n \"homebrew/services\"\n ],\n \"formulae\": [\n \"asciinema\",\n \"cairo\",\n \"cirrus\",\n \"expect\",\n \"glib\",\n \"hyperfine\",\n \"icu4c\",\n \"jq\",\n \"mas\",\n \"packer\",\n \"sshpass\",\n \"tart\"\n ],\n \"casks\": [\n \t\"firefox\",\n \t\"notion\",\n \t\"sublime-text\",\n \t\"webstorm\",\n \t\"mac-mouse-fix\",\n \t\"wins\",\n \t\"warp\",\n \t\"hammerspoon\",\n \t\"rectangle\",\n \t\"alt-tab\",\n \t\"betterdisplay\",\n \t\"daisydisk\",\n \t\"visual-studio-code\"\n ]\n },\n\n\t{ \"type\": \"nvm\", \"nodeVersions\": [\"20\"], \"global\": \"20\" },\n\t{ \"type\": \"pyenv\", \"pythonVersions\": [\"3.12\", \"3.11\"], \"global\": \"3.11\" },\n\n\t{\n \"type\": \"ssh-key\",\n \"fileName\": \"id_ed25519\",\n \"passphrase\": \"\",\n \"folder\": \"/Users/kevinwang/.ssh\",\n \"keyType\": \"ed25519\"\n },\n { \"type\": \"terraform\" },\n { \"type\": \"git-clone\", \"directory\": \"~/projects/codify\", \"repository\": \"git@github.com:kevinwang5658/codify.git\" },\n { \"type\": \"git-clone\", \"directory\": \"~/projects/codify-web\", \"repository\": \"git@github.com:kevinwang5658/codify-web.git\" },\n\t{ \"type\": \"git-clone\", \"directory\": \"~/projects/codify-homebrew-plugin\", \"repository\": \"git@github.com:kevinwang5658/codify-homebrew-plugin.git\" },\n { \"type\": \"git-clone\", \"directory\": \"~/projects/codify-infrastructure\", \"repository\": \"git@github.com:kevinwang5658/codify-infrastructure.git\" },\n { \"type\": \"git-clone\", \"directory\": \"~/projects/codify-docs\", \"repository\": \"git@github.com:kevinwang5658/codify-docs.git\" },\n { \"type\": \"git-clone\", \"directory\": \"~/projects/codify-ink-form\", \"repository\": \"git@github.com:kevinwang5658/codify-ink-form.git\" },\n\n\n { \"type\": \"action\", \"condition\": \"[ -d node_modules ]\", \"action\": \"npm install\", \"cwd\": \"~/projects/codify\", \"dependsOn\": [\"git-clone.0\", \"nvm\"]},\n { \"type\": \"action\", \"condition\": \"[ -d node_modules ]\", \"action\": \"npm install\", \"cwd\": \"~/projects/codify-web\", \"dependsOn\": [\"git-clone.1\", \"nvm\"]},\n { \"type\": \"action\", \"condition\": \"[ -d node_modules ]\", \"action\": \"npm install\", \"cwd\": \"~/projects/codify-homebrew-plugin\", \"dependsOn\": [\"git-clone.2\", \"nvm\"]},\n { \"type\": \"action\", \"condition\": \"[ -d node_modules ]\", \"action\": \"npm install\", \"cwd\": \"~/projects/codify-docs\", \"dependsOn\": [\"git-clone.4\", \"nvm\"]},\n { \"type\": \"action\", \"condition\": \"[ -d node_modules ]\", \"action\": \"npm install\", \"cwd\": \"~/projects/codify-ink-form\", \"dependsOn\": [\"git-clone.5\", \"nvm\"]}\n]",
"path": "~/codify.json"
},
{
"type": "aws-cli"
},
{
"type": "git-repository",
"directory": "~/Projects/codify-homebrew-plugin",
"repository": "git@github.com:kevinwang5658/codify-homebrew-plugin.git"
},
{
"type": "vscode"
},
{
"type": "git-repository",
"directory": "~/Projects/codify-plugin-lib",
"repository": "git@github.com:kevinwang5658/codify-plugin-lib.git"
},
{
"type": "git-repository",
"directory": "~/Projects/codify",
"repository": "git@github.com:kevinwang5658/codify.git"
},
{
"type": "wait-github-ssh-key"
},
{
"type": "git-lfs"
},
{
"type": "pyenv",
"global": "3.11",
"pythonVersions": [
"3.9.19",
"3.10.14",
"3.11.8",
"3.12.2"
]
},
{
"type": "git",
"email": "kevinwang5658@gmail.com",
"username": "kevinwang"
},
{
"type": "android-studio",
"version": "2023.3.1.20"
},
{
"type": "ssh-add",
"path": "~/.ssh/id_ed25519"
},
{
"type": "jenv",
"add": [
"11",
"17",
"21"
],
"global": "17"
},
{
"type": "aws-profile",
"awsAccessKeyId": "AKIATCKATKL55TT5UZ7P",
"awsSecretAccessKey": "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",
"profile": "codify",
"region": "us-east-1"
},
{
"type": "git-repository",
"directory": "~/Projects/codify-homebrew-plugin",
"repository": "git@github.com:kevinwang5658/codify-homebrew-plugin.git"
},
{
"type": "git-repository",
"directory": "~/Projects/codify-homebrew-plugin",
"repository": "git@github.com:kevinwang5658/codify-homebrew-plugin.git"
},
{
"type": "git-repository",
"directory": "~/Projects/codify-homebrew-plugin",
"repository": "git@github.com:kevinwang5658/codify-homebrew-plugin.git"
},
{
"type": "git-repository",
"directory": "~/Projects/codify-homebrew-plugin",
"repository": "git@github.com:kevinwang5658/codify-homebrew-plugin.git"
},
{
"type": "git-repository",
"directory": "~/Projects/codify-homebrew-plugin",
"repository": "git@github.com:kevinwang5658/codify-homebrew-plugin.git"
},
{
"type": "git-repository",
"directory": "~/Projects/codify-homebrew-plugin",
"repository": "git@github.com:kevinwang5658/codify-homebrew-plugin.git"
},
{
"type": "git-repository",
"directory": "~/Projects/codify-homebrew-plugin",
"repository": "git@github.com:kevinwang5658/codify-homebrew-plugin.git"
"alias": "la",
"value": "ls"
}
]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
"start:dev": "./bin/dev.js",
"start:vm": "npm run build && npm run pack:macos && npm run start:vm"
},
"version": "0.7.0",
"version": "0.7.1",
"bugs": "https://github.com/kevinwang5658/codify/issues",
"keywords": [
"oclif"
Expand Down
1 change: 1 addition & 0 deletions src/commands/apply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ For more information, visit: https://docs.codifycli.com/commands/apply

await ApplyOrchestrator.run({
path: flags.path,
verbosityLevel: flags.debug ? 3 : 0,
// secure: flags.secure,
}, this.reporter);

Expand Down
1 change: 1 addition & 0 deletions src/commands/destroy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ For more information, visit: https://docs.codifycli.com/commands/destory`
}

await DestroyOrchestrator.run({
verbosityLevel: flags.debug ? 3 : 0,
typeIds: args,
path: flags.path,
}, this.reporter)
Expand Down
1 change: 1 addition & 0 deletions src/commands/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ For more information, visit: https://docs.codifycli.com/commands/import`
const cleanedArgs = await this.cleanupZshStarExpansion(args);

await ImportOrchestrator.run({
verbosityLevel: flags.debug ? 3 : 0,
typeIds: cleanedArgs,
path: resolvedPath,
secureMode: flags.secure,
Expand Down
6 changes: 5 additions & 1 deletion src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ For more information, visit: https://docs.codifycli.com/commands/init`
]

public async run(): Promise<void> {
await InitializeOrchestrator.run(this.reporter);
const { flags } = await this.parse(Init)

await InitializeOrchestrator.run({
verbosityLevel: flags.debug ? 3 : 0,
},this.reporter);
}
}
1 change: 1 addition & 0 deletions src/commands/plan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ For more information, visit: https://docs.codifycli.com/commands/plan`
const { flags } = await this.parse(Plan)

await PlanOrchestrator.run({
verbosityLevel: flags.debug ? 3 : 0,
path: flags.path,
secureMode: flags.secure,
}, this.reporter);
Expand Down
3 changes: 2 additions & 1 deletion src/common/initialize-plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Reporter } from '../ui/reporters/reporter.js';
export interface InitializeArgs {
path?: string;
secure?: boolean;
verbosityLevel?: number;
transformProject?: (project: Project) => Project | Promise<Project>;
allowEmptyProject?: boolean;
}
Expand All @@ -37,7 +38,7 @@ export class PluginInitOrchestrator {

ctx.subprocessStarted(SubProcessName.INITIALIZE_PLUGINS)
const pluginManager = new PluginManager();
const typeIdsToDependenciesMap = await pluginManager.initialize(project, args.secure);
const typeIdsToDependenciesMap = await pluginManager.initialize(project, args.secure, args.verbosityLevel);
ctx.subprocessFinished(SubProcessName.INITIALIZE_PLUGINS)

return { typeIdsToDependenciesMap, pluginManager, project };
Expand Down
1 change: 1 addition & 0 deletions src/orchestrators/apply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { PlanOrchestrator } from './plan.js';
export interface ApplyArgs {
path?: string;
secure?: boolean;
verbosityLevel?: number;
}

export const ApplyOrchestrator = {
Expand Down
1 change: 1 addition & 0 deletions src/orchestrators/destroy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface DestroyArgs {
typeIds: string[];
path?: string;
secureMode?: boolean;
verbosityLevel?: number;
}

export class DestroyOrchestrator {
Expand Down
1 change: 1 addition & 0 deletions src/orchestrators/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface ImportArgs {
typeIds?: string[];
path: string;
secureMode?: boolean;
verbosityLevel?: number;
}

export class ImportOrchestrator {
Expand Down
8 changes: 6 additions & 2 deletions src/orchestrators/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@ import { Reporter } from '../ui/reporters/reporter.js';
import { FileUtils } from '../utils/file.js';
import { resolvePathWithVariables, untildify } from '../utils/index.js';

export interface InitArgs {
verbosityLevel?: number;
}

export const InitializeOrchestrator = {

async run(reporter: Reporter) {
async run(args: InitArgs, reporter: Reporter) {
await reporter.displayInitBanner()

ctx.processStarted(ProcessName.INIT)
await reporter.displayProgress();


const { pluginManager, typeIdsToDependenciesMap } = await PluginInitOrchestrator.run({}, reporter);
const { pluginManager, typeIdsToDependenciesMap } = await PluginInitOrchestrator.run(args, reporter);

ctx.subprocessStarted(SubProcessName.IMPORT_RESOURCE)
const importResults = await Promise.all([...typeIdsToDependenciesMap.keys()].map(async (typeId) => {
Expand Down
1 change: 1 addition & 0 deletions src/orchestrators/plan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { ValidateOrchestrator } from './validate.js';
export interface PlanArgs {
path?: string;
secureMode?: boolean;
verbosityLevel?: number;
}

export interface PlanOrchestratorResponse {
Expand Down
Loading