Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: poc add cloud commands #655

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
39 changes: 39 additions & 0 deletions src/commands/cloud/download-typings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import type * as Config from '@oclif/config';

import { flags } from '@oclif/command';
import chalk from 'chalk';

import AbstractAuthenticatedCommand from '../../abstract-authenticated-command';

export default class DownloadTypingsCommand extends AbstractAuthenticatedCommand {
private env: { FOREST_SERVER_URL: string; FOREST_ENV_SECRET: string };

static override flags = {
format: flags.string({
char: 'o',
description: 'Output path',
default: './typings.d.ts',
}),
};

static override description = 'Download typings from your cloud project';

constructor(argv: string[], config: Config.IConfig, plan?) {
super(argv, config, plan);

const { assertPresent, env, projectRenderer } = this.context;
assertPresent({
env,
projectRenderer,
});

this.env = env;
}

async runAuthenticated() {
const parsed = this.parse(DownloadTypingsCommand);

Check warning on line 34 in src/commands/cloud/download-typings.ts

View workflow job for this annotation

GitHub Actions / Lint

'parsed' is assigned a value but never used

// const config = { ...this.env, ...parsed.flags, ...(parsed.args as { projectId: string }) };
this.logger.info(chalk.bgGreenBright(`Downloading typings`));
}
}
30 changes: 30 additions & 0 deletions src/commands/cloud/publish.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import type * as Config from '@oclif/config';

import { flags } from '@oclif/command';

Check warning on line 3 in src/commands/cloud/publish.ts

View workflow job for this annotation

GitHub Actions / Lint

'flags' is defined but never used
import chalk from 'chalk';

import AbstractAuthenticatedCommand from '../../abstract-authenticated-command';

export default class PublishCommand extends AbstractAuthenticatedCommand {
private env: { FOREST_SERVER_URL: string; FOREST_ENV_SECRET: string };

static override description = 'Publish your code';

constructor(argv: string[], config: Config.IConfig, plan?) {
super(argv, config, plan);

const { assertPresent, env, projectRenderer } = this.context;
assertPresent({
env,
projectRenderer,
});

this.env = env;
}

async runAuthenticated() {
const parsed = this.parse(PublishCommand);

Check warning on line 26 in src/commands/cloud/publish.ts

View workflow job for this annotation

GitHub Actions / Lint

'parsed' is assigned a value but never used
// const config = { ...this.env, ...parsed.flags, ...(parsed.args as { projectId: string }) };
this.logger.info(chalk.bgGreenBright('publishing code to lambda'));
}
}
Loading