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
4 changes: 2 additions & 2 deletions .github/actions/inject-build-metadata/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ runs:
shell: bash
run: |
SHA=$(git rev-parse --short HEAD)
for f in package.json integration-test/package.json; do
for f in autify-cli/package.json integration-test/package.json; do
jq --arg sha "$SHA" '.version = .version + "-" + $sha' "$f" > "$f.tmp" && mv "$f.tmp" "$f"
done
echo "Version injected: $(jq -r .version package.json)"
echo "Version injected: $(jq -r .version autify-cli/package.json)"
1 change: 1 addition & 0 deletions .github/actions/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ runs:
shell: bash
- run: npm run release install ${{ inputs.target }}
shell: bash
working-directory: autify-cli
env:
HOMEBREW_AUTIFY_CLI_PR_BUILD: ${{ github.event_name == 'pull_request' && '1' || '' }}
1 change: 1 addition & 0 deletions .github/actions/upload/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ runs:
shell: bash
- run: npm run release upload ${{ inputs.target }}
shell: bash
working-directory: autify-cli
2 changes: 1 addition & 1 deletion .github/workflows/bump-mobilelink.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
VERSION: ${{ github.event.client_payload.version }}
SHA: ${{ github.event.client_payload.sha }}
run: |
FILE="src/autify/mobile/mobilelink/mobilelink.json"
FILE="autify-cli/src/autify/mobile/mobilelink/mobilelink.json"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nit but seems possible to use working-directory here

jq -n '{version: env.VERSION, hash: env.SHA}' > "$FILE"
cat "$FILE"
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,9 @@ jobs:
with:
title: "chore: release packages"
commit: "chore: release packages"
version: |
npx changeset version
npx oclif readme --repository-prefix='<%- repo %>/blob/@autifyhq/autify-cli@<%- version %>/<%- commandPath %>'
# Publish must be a single command (action splits on whitespace).
publish: bash scripts/changesets-detect-publish.sh
# version and publish must be single commands (action splits on whitespace).
version: bash autify-cli/scripts/changesets-version.sh
publish: bash autify-cli/scripts/changesets-detect-publish.sh
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also wonder if we can use working-directory here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure this one needs to run at the root where the .changesets dir is/workspace root

createGithubReleases: false
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
Expand Down Expand Up @@ -79,7 +77,7 @@ jobs:
uses: changesets/action@63a615b9cd06ba9a3e6d13796c7fbcb080a60a0b # v1.8.0
with:
# Only tag the CLI itself, not the integration-test workspace.
publish: bash scripts/changesets-tag.sh
publish: bash autify-cli/scripts/changesets-tag.sh
createGithubReleases: true
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
1 change: 1 addition & 0 deletions .github/workflows/github-actions-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- uses: ./.github/actions/inject-build-metadata
- id: run
run: npm run release get-installer-url
working-directory: autify-cli
outputs:
installer-url: ${{ steps.run.outputs.installer-url }}

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}
- uses: ./.github/actions/setup
- run: npx prettier -c .
working-directory: autify-cli
- run: npm run lint
3 changes: 2 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ jobs:
- uses: actions/checkout@v4
with:
repository: autifyhq/homebrew-tap
path: homebrew-tap
path: autify-cli/homebrew-tap
token: ${{ steps.generate-token.outputs.token }}
- uses: ./.github/actions/setup
with:
aws-credentials: publish
- run: git config --global user.name "${GITHUB_ACTOR}"
- run: git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- run: npm run release publish
working-directory: autify-cli
3 changes: 2 additions & 1 deletion .github/workflows/rollback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- uses: actions/checkout@v4
with:
repository: autifyhq/homebrew-tap
path: homebrew-tap
path: autify-cli/homebrew-tap
token: ${{ steps.generate-token.outputs.token }}

- uses: ./.github/actions/setup
Expand All @@ -36,3 +36,4 @@ jobs:
- run: git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"

- run: npm run release rollback
working-directory: autify-cli
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
*-debug.log
*-error.log
/.nyc_output
/dist
dist
/lib
/tmp
tmp
/yarn.lock
/autify-cli/package-lock.json
node_modules
oclif.manifest.json
*.tgz
Expand Down
3 changes: 0 additions & 3 deletions .prettierignore

This file was deleted.

File renamed without changes.
2 changes: 2 additions & 0 deletions autify-cli/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/dist
/tmp
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion autify-cli.rb → autify-cli/autify-cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def install
private

def taball_url
package = JSON.parse(File.read("./package.json"), symbolize_names: true)
package = JSON.parse(File.read("./autify-cli/package.json"), symbolize_names: true)
# In PR builds the workflow injects a SHA suffix into the formula's version
# without committing it to package.json, so allow the mismatch when an
# explicit env var marks the build as a PR test. Homebrew strips custom
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
170 changes: 170 additions & 0 deletions autify-cli/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
{
"name": "@autifyhq/autify-cli",
"version": "0.73.0-beta.0",
"description": "Autify Command Line Interface (CLI)",
"author": "Autify",
"bin": {
"autify": "./bin/run"
},
"homepage": "https://github.com/autifyhq/autify-cli",
"license": "MIT",
"main": "dist/index.js",
"repository": "autifyhq/autify-cli",
"files": [
"/bin",
"/dist",
"/npm-shrinkwrap.json",
"/oclif.manifest.json"
],
"dependencies": {
"@autifyhq/autify-sdk": "^0.28.3",
"@oclif/core": "^4.8.0",
"@oclif/plugin-help": "^6.2.36",
"@oclif/plugin-not-found": "^3.2.73",
"@oclif/plugin-update": "^4.7.16",
"@oclif/plugin-warn-if-update-available": "^2.1.1",
"abort-controller": "^3.0.0",
"archiver": "^7.0.1",
"axios": "^1.15.2",
"envfile": "^7.1.0",
"get-port": "^7.1.0",
"inquirer": "^12.11.1",
"listr": "^0.14.3",
"node-emoji": "^2.2.0",
"node-stream-zip": "^1.15.0",
"os-proxy-config": "^1.1.2",
"per-env": "^1.0.2",
"shell-quote": "^1.8.3",
"tar": "^7.5.2",
"undici": "^6.19.8",
"unzip-stream": "^0.3.4",
"uuid": "^11.1.0",
"which": "^5.0.0",
"winston": "^3.18.3",
"xstate": "^4.38.3"
},
"devDependencies": {
"@autifyhq/autify-cli-integration-test": "*",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.39.1",
"@oclif/prettier-config": "^0.2.1",
"@types/archiver": "^6.0.4",
"@types/chai": "^5.2.3",
"@types/listr": "^0.14.10",
"@types/node": "^22.19.1",
"@types/shell-quote": "^1.7.5",
"@types/unzip-stream": "^0.3.4",
"chai": "^5.3.3",
"cross-env": "^7.0.3",
"eslint": "^9.39.1",
"eslint-config-oclif": "^6.0.118",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-unicorn": "^59.0.1",
"execa": "^5.1.1",
"jest": "^29.7.0",
"oclif": "^4.22.47",
"prettier": "^3.6.2",
"shx": "^0.4.0",
"ts-jest": "^29.4.5",
"ts-morph": "^26.0.0",
"ts-node": "^10.9.2",
"tslib": "^2.8.1",
"typed-emitter": "^2.1.0",
"typescript": "^5.9.3",
"typescript-eslint": "^8.47.0"
},
"oclif": {
"bin": "autify",
"dirname": "autify",
"commands": "./dist/commands",
"hooks": {
"init": "./dist/hooks/init/proxy"
},
"plugins": [
"@oclif/plugin-help",
"@oclif/plugin-not-found",
"@oclif/plugin-update",
"@oclif/plugin-warn-if-update-available"
],
"topicSeparator": " ",
"topics": {
"web": {
"description": "Autify for Web"
},
"web:api": {
"description": "Low-level APIs on Autify for Web"
},
"web:auth": {
"description": "Authentication on Autify for Web"
},
"web:test": {
"description": "Test on Autify for Web"
},
"mobile": {
"description": "Autify for Mobile"
},
"mobile:api": {
"description": "Low-level APIs on Autify for Mobile"
},
"mobile:auth": {
"description": "Authentication on Autify for Mobile"
},
"mobile:build": {
"description": "Build on Autify for Mobile"
},
"mobile:test": {
"description": "Test on Autify for Mobile"
},
"connect": {
"description": "Autify Connect"
},
"connect:access-point": {
"description": "Autify Connect Access Point"
},
"connect:client": {
"description": "Autify Connect Client"
}
},
"update": {
"s3": {
"host": "https://autify-cli-assets.s3.us-west-2.amazonaws.com",
"bucket": "autify-cli-assets",
"folder": "autify-cli"
}
},
"macos": {
"identifier": "com.autify.cli"
}
},
"scripts": {
"generate:api-commands": "ts-node scripts/generate-api-commands.ts",
"generate": "npm run generate:api-commands web && npm run generate:api-commands mobile && npm run format-lint-api-commands && npm run build",
"build": "shx rm -rf dist && tsc -b",
"lint": "eslint .",
"format": "prettier . --write",
"format-api-commands": "prettier --write src/commands/web/api src/commands/mobile/api",
"lint-api-commands": "eslint --fix src/commands/web/api src/commands/mobile/api",
"format-lint-api-commands": "npm run format-api-commands && npm run lint-api-commands",
"postpack": "shx rm -f oclif.manifest.json",
"posttest": "npm run lint",
"prepack": "npm run build && oclif manifest && oclif readme",
"release": "ts-node ./scripts/release.ts",
"test:integration": "autify-cli-integration-test",
"test:integration:dev": "cross-env AUTIFY_CLI_PATH=../autify-cli/bin/dev autify-cli-integration-test",
"test:integration:record": "cross-env AUTIFY_CLI_INTEGRATION_TEST_RECORD=1 AUTIFY_CONNECT_CLIENT_MODE=real autify-cli-integration-test",
"test:integration:dev:record": "cross-env AUTIFY_CLI_PATH=../autify-cli/bin/dev AUTIFY_CLI_INTEGRATION_TEST_RECORD=1 AUTIFY_CONNECT_CLIENT_MODE=real autify-cli-integration-test",
"test:integration:connect": "AUTIFY_CONNECT_CLIENT_MODE=fake autify connect client install && npm run test:integration AutifyConnectClient",
"test:integration:connect:dev": "AUTIFY_CONNECT_CLIENT_MODE=fake ./bin/dev connect client install && npm run test:integration:dev AutifyConnectClient",
"test:integration:connect:record": "autify connect client install && npm run test:integration:record AutifyConnectClient",
"test:integration:connect:dev:record": "./bin/dev connect client install && npm run test:integration:dev:record AutifyConnectClient",
"test:e2e": "npx jest --config e2e-test/jest.config.js"
},
"engines": {
"node": ">=22.16.0"
},
"bugs": "https://github.com/autifyhq/autify-cli/issues",
"keywords": [
"oclif"
],
"types": "dist/index.d.ts"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# so subsequent pushes without a changeset are no-ops.
set -euo pipefail

VERSION=$(jq -r .version package.json)
VERSION=$(jq -r .version "$(dirname "$0")/../package.json")
TAG="@autifyhq/autify-cli@${VERSION}"

git fetch --tags --quiet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# Emits `New tag:` for changesets/action to create the GitHub release.
set -euo pipefail

VERSION=$(jq -r .version package.json)
VERSION=$(jq -r .version "$(dirname "$0")/../package.json")
echo "New tag: @autifyhq/autify-cli@${VERSION}"
8 changes: 8 additions & 0 deletions autify-cli/scripts/changesets-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
# Version step for changesets/action: bumps versions, builds, regenerates README.
# Build must run before `oclif readme` so it can enumerate commands from dist/.
set -euo pipefail

npx changeset version
npm run build
cd autify-cli && npx oclif readme --repository-prefix='<%- repo %>/blob/@autifyhq/autify-cli@<%- version %>/autify-cli/<%- commandPath %>'
10 changes: 9 additions & 1 deletion scripts/release.ts → autify-cli/scripts/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import assert from "node:assert";
import { execSync } from "node:child_process";
import {
appendFileSync,
copyFileSync,
existsSync,
readFileSync,
writeFileSync,
mkdtempSync,
Expand All @@ -10,6 +12,12 @@ import { homedir, tmpdir } from "node:os";
import { join } from "node:path";
import pkg from "../package.json";

// oclif pack reads the lockfile from the package root, but in this monorepo
// the canonical lockfile lives at the workspace root one directory up.
if (!existsSync("package-lock.json") && existsSync("../package-lock.json")) {
copyFileSync("../package-lock.json", "package-lock.json");
}

const { version, oclif: oclifConfig } = pkg;

const { bucket, folder } = oclifConfig.update.s3;
Expand Down Expand Up @@ -90,7 +98,7 @@ const uploadNpmPackage = (
) => {
if (npm === "autify-cli") run("npm pack");
else if (npm === "autify-cli-integration-test")
run("npm pack -w integration-test");
run("npm pack -w integration-test --pack-destination=autify-cli", "..");
const file = s3File({ target: "npm", npm });
run(
`aws s3 cp --acl public-read ${file} s3://${bucket}/${s3KeyPrefix}/${file}`
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading