Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
e836872
feat: WIP refactored default reporter to use a new statement manageme…
kevinwang5658 Jan 23, 2025
84dbe86
feat: WIP transitioned apply and prompts to the new model
kevinwang5658 Jan 24, 2025
e186f8c
feat: Updated all flows to use the new atom system for the default re…
kevinwang5658 Jan 24, 2025
724ae07
feat: Updated imports
kevinwang5658 Jan 26, 2025
8448c66
feat: Added unit test for default component
kevinwang5658 Jan 26, 2025
0286c73
fix: Fixed the progress output for destroy
kevinwang5658 Jan 26, 2025
7c06de2
fix: Additional prompt fixes for destroy
kevinwang5658 Jan 26, 2025
7c9fb5e
feat: WIP refactored variable names and moved getRequiredParameters t…
kevinwang5658 Jan 27, 2025
63bda2b
fix: Fix tests
kevinwang5658 Jan 27, 2025
15aa83d
feat: Added resource-info entity
kevinwang5658 Jan 27, 2025
6df1759
feat: Renamed reporter method to promptUserForParameterValues
kevinwang5658 Jan 27, 2025
6dcf6fa
feat: Switched to using the custom codify-ink-form library to render …
kevinwang5658 Jan 30, 2025
e0727de
feat: Added interface for new generic getValue call in reporters
kevinwang5658 Jan 31, 2025
bc21f23
feat: Refactored the import orchestrator and default renderer to use …
kevinwang5658 Jan 31, 2025
4ef30c0
feat: Parallelized imports
kevinwang5658 Feb 1, 2025
e3b3a08
feat: Added prompt for users to select results to save
kevinwang5658 Feb 1, 2025
a18b107
feat: Added new isSameOnSystem method on resource entity + tests
kevinwang5658 Feb 1, 2025
0b919e7
feat: Added new flow for saving import to file
kevinwang5658 Feb 1, 2025
f1cbda2
feat: WIP added a file modification calculator to calculate imports
kevinwang5658 Feb 4, 2025
834e39f
feat: WIP added ability to delete a resource from an existing file
kevinwang5658 Feb 5, 2025
131b918
feat: WIP switched to a new calculation for deletes that removes addi…
kevinwang5658 Feb 5, 2025
c7a4712
feat: WIP delete improvements and bug fixes
kevinwang5658 Feb 5, 2025
a0c319a
feat: WIP added updates (supports both single line and multi-line con…
kevinwang5658 Feb 5, 2025
7abf569
feat: Added ability to insert new configs
kevinwang5658 Feb 5, 2025
6587cd5
feat: Removed writing to new files from file modification calculator
kevinwang5658 Feb 5, 2025
5924bbf
feat: Added rendering for imports and added custom diff implementatio…
kevinwang5658 Feb 6, 2025
c29f24d
feat: Split printing logic for file diff another file + fixed bugs wi…
kevinwang5658 Feb 7, 2025
51aa606
feat: Added parameter key sorting so that the order of parameters rem…
kevinwang5658 Feb 7, 2025
60bd1fe
feat: Added generic display message method to the reporter. Added mes…
kevinwang5658 Feb 8, 2025
f6adbcd
feat: Added messaging for all paths in import. Added back resource co…
kevinwang5658 Feb 8, 2025
6717f38
feat: Added wild card matching for import
kevinwang5658 Feb 9, 2025
7e4db19
feat: Added default values for resources that already exist in the pr…
kevinwang5658 Feb 11, 2025
6f652df
feat: Added ability to import into an existing codify file without an…
kevinwang5658 Feb 12, 2025
98c581c
fix: Fixed most tests
kevinwang5658 Feb 12, 2025
996a95d
feat: Added integration tests for import command and fixed bugs
kevinwang5658 Feb 13, 2025
77d6397
fix: Fixed bug with memfs volume not resetting between tests
kevinwang5658 Feb 13, 2025
0dab34d
feat: Added support for new import prompts in debug and plain reporte…
kevinwang5658 Feb 13, 2025
e419d73
fix: CI not being able to pull private packages
kevinwang5658 Feb 13, 2025
2d55467
fix: CI not being able to pull private packages 2
kevinwang5658 Feb 13, 2025
750f9d4
fix: Removed some bad tests (wasn't useful)
kevinwang5658 Feb 13, 2025
267413d
feat: Updated to importAndDestroy and added filtering for preventImport
kevinwang5658 Feb 16, 2025
8171646
feat: Added kill listeners so process gets killed properly
kevinwang5658 Feb 17, 2025
c5c3e30
feat: Added handler for * expansion in zsh and updated the help for t…
kevinwang5658 Feb 18, 2025
2337888
feat: Switched to using identifying parameters
kevinwang5658 Feb 19, 2025
95f23e9
feat: Moved resource matching to the plugin for more accurate matching
kevinwang5658 Feb 21, 2025
a28068d
feat: Moved validation to a separate orchestrator and added validatio…
kevinwang5658 Feb 21, 2025
df76193
fix: Fixed tests and bug fixes
kevinwang5658 Feb 21, 2025
71eca83
fix: Fixed import params
kevinwang5658 Feb 23, 2025
b8357d5
fix: Added back removed elements and fixed memory bug
kevinwang5658 Feb 24, 2025
3b1b632
feat: Added helpful comment
kevinwang5658 Feb 24, 2025
240c210
feat: Added import prompt to help improve ux of imports and updated t…
kevinwang5658 Feb 26, 2025
10ef23f
fix: Finally found a fix to the memory issues. It was because of back…
kevinwang5658 Feb 26, 2025
01b119b
fix: Removed validate from import
kevinwang5658 Mar 1, 2025
7805c1c
fix: Fixed test and plain reporter
kevinwang5658 Mar 1, 2025
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
4 changes: 2 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"unicorn/no-array-for-each": "off",
"unicorn/prefer-object-from-entries": "off",
"unicorn/prefer-type-error": "off",
"no-await-in-loop": "off",
"quotes": [
"error",
"single"
]
],
"no-await-in-loop": "off"
},
"ignorePatterns": [
"*.test.ts"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run-unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- run: echo -e "\n//npm.pkg.github.com/:_authToken=${{ secrets.PACKAGES_PAT_GITHUB }}" >> ./.npmrc
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@codifycli:registry=https://npm.pkg.github.com
43 changes: 35 additions & 8 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.5.1 darwin-arm64 node-v20.15.1
codify/0.6.0 darwin-arm64 node-v20.15.1
$ codify --help [COMMAND]
USAGE
$ codify COMMAND
Expand Down Expand Up @@ -62,7 +62,7 @@ EXAMPLES
$ codify apply --path ~
```

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

## `codify destroy`

Expand All @@ -89,7 +89,7 @@ EXAMPLES
$ codify destroy homebrew nvm
```

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

## `codify help [COMMAND]`

Expand All @@ -113,7 +113,7 @@ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.1

## `codify import`

Generate codify configs from existing installations
Generate codify configs from already installed packages. Use a list of space separated arguments to specify the resource types to import. Leave blank to import all resource in an existing *.codify.json file.

```
USAGE
Expand All @@ -130,13 +130,40 @@ GLOBAL FLAGS
--json Format output as json.

DESCRIPTION
Generate codify configs from existing installations
Generate codify configs from already installed packages. Use a list of space separated arguments to specify the
resource types to import. Leave blank to import all resource in an existing *.codify.json file.

Modes:
1. No args: if no args are specified and an *.codify.json already exists. Then codify will update the existing file
with any new changes to the resources specified in the file/files.

Command: codify import

2. With args: specify specific resources to import using arguments. Wild card matching is supported using '*' and ?
(Note: in zsh * expands to the current dir and needs to be escaped using \* or '*'). A prompt will be shown if more
information is required to complete the import.

Example: codify import nvm asdf\*, codify import \* (for importing all supported resources)

The results can then be saved:
a. To an existing *.codify.json file
b. To a new file
c. Or only printed to console

Codify will try to smartly insert new configs by following existing spacing and formatting.


EXAMPLES
$ codify import homebrew nvm
$ codify import homebrew nvm asdf\*

$ codify import

$ codify import git-clone --path ../my/other/folder

$ codify import \*
```

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

## `codify plan`

Expand Down Expand Up @@ -164,7 +191,7 @@ EXAMPLES
$ codify plan
```

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

## `codify update [CHANNEL]`

Expand Down
200 changes: 195 additions & 5 deletions codify.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,209 @@
"default": "../codify-homebrew-plugin/src/index.ts"
}
},
{ "type": "path", "path": "$HOME/.bun/bin"},
{
"type": "path",
"paths": [
"$PYENV_ROOT/bin",
"$BUN_INSTALL/bin",
"$DENO_INSTALL/bin",
"$NVM_DIR/.bin/3"
],
"declarationsOnly": true
},
{
"type": "homebrew",
"taps": [
"cirruslabs/cli",
"hashicorp/tap",
"homebrew/bundle",
"homebrew/services"
],
"formulae": [
"asciinema"
],
"casks": [
"firefox"
"android-commandlinetools",
"android-studio",
"mitmproxy"
],
"formulae": [
"ack",
"asciinema",
"cirrus",
"expect",
"git-lfs",
"openjdk@11",
"openjdk@17",
"openjdk@21",
"packer",
"pgcli",
"postgresql@14",
"sshpass",
"tart",
"xz",
"zstd"
]
},
{"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-clone",
"directory": "~/Projects/codify-homebrew-plugin",
"repository": "git@github.com:kevinwang5658/codify-homebrew-plugin.git"
},
{
"type": "vscode"
},
{
"type": "git-clone",
"directory": "~/Projects/codify-plugin-lib",
"repository": "git@github.com:kevinwang5658/codify-plugin-lib.git"
},
{
"type": "git-clone",
"directory": "~/Projects/codify",
"repository": "git@github.com:kevinwang5658/codify.git"
},
{
"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": "nvm",
"global": "20.15.1",
"nodeVersions": [
"iojs-2.5.0",
"18.20.3",
"20.15.0",
"20.15.1",
"22.4.1",
"23.3.0"
]
},
{ "type": "alias", "alias": "gcdsdd", "value": "git clone" }
{
"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-clone",
"directory": "~/Projects/codify-homebrew-plugin",
"repository": "git@github.com:kevinwang5658/codify-homebrew-plugin.git"
},
{
"type": "git-clone",
"directory": "~/Projects/codify-homebrew-plugin",
"repository": "git@github.com:kevinwang5658/codify-homebrew-plugin.git"
},
{
"type": "git-clone",
"directory": "~/Projects/codify-homebrew-plugin",
"repository": "git@github.com:kevinwang5658/codify-homebrew-plugin.git"
},
{
"type": "git-clone",
"directory": "~/Projects/codify-homebrew-plugin",
"repository": "git@github.com:kevinwang5658/codify-homebrew-plugin.git"
},
{
"type": "git-clone",
"directory": "~/Projects/codify-homebrew-plugin",
"repository": "git@github.com:kevinwang5658/codify-homebrew-plugin.git"
},
{
"type": "git-clone",
"directory": "~/Projects/codify-homebrew-plugin",
"repository": "git@github.com:kevinwang5658/codify-homebrew-plugin.git"
},
{
"type": "git-clone",
"directory": "~/Projects/codify-homebrew-plugin",
"repository": "git@github.com:kevinwang5658/codify-homebrew-plugin.git"
}
]
1 change: 1 addition & 0 deletions new.codify.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Loading
Loading