Merge pull request #1533 from automatisch/remove-cli

chore: Remove cli package
This commit is contained in:
Ömer Faruk Aydın
2024-01-14 21:06:46 +01:00
committed by GitHub
14 changed files with 0 additions and 16298 deletions

View File

@@ -83,20 +83,3 @@ jobs:
env:
CI: false
- run: echo "🍏 This job's status is ${{ job.status }}."
build-cli:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '18'
cache: 'yarn'
cache-dependency-path: yarn.lock
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- run: yarn --frozen-lockfile && yarn lerna bootstrap
- run: cd packages/cli && yarn build
- run: echo "🍏 This job's status is ${{ job.status }}."

View File

@@ -1,11 +0,0 @@
root = true
[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

View File

@@ -1 +0,0 @@
/dist

View File

@@ -1,16 +0,0 @@
version: 2
updates:
- package-ecosystem: 'npm'
versioning-strategy: increase
directory: '/'
schedule:
interval: 'monthly'
labels:
- 'dependencies'
open-pull-requests-limit: 100
pull-request-branch-name:
separator: '-'
ignore:
- dependency-name: 'fs-extra'
- dependency-name: '*'
update-types: ['version-update:semver-major']

View File

@@ -1,9 +0,0 @@
*-debug.log
*-error.log
/.nyc_output
/dist
/lib
/package-lock.json
/tmp
node_modules
oclif.manifest.json

View File

@@ -1,4 +0,0 @@
# `@automatisch/cli`
The open source Zapier alternative. Build workflow automation without spending
time and money.

View File

@@ -1,5 +0,0 @@
#!/usr/bin/env node
const oclif = require('@oclif/core')
oclif.run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle'))

View File

@@ -1,3 +0,0 @@
@echo off
node "%~dp0\automatisch" %*

View File

@@ -1,73 +0,0 @@
{
"name": "@automatisch/cli",
"version": "0.10.0",
"license": "See LICENSE file",
"description": "The open source Zapier alternative. Build workflow automation without spending time and money.",
"contributors": [
{
"name": "automatisch contributors",
"url": "https://github.com/automatisch/automatisch/graphs/contributors"
}
],
"homepage": "https://github.com/automatisch/automatisch#readme",
"main": "dist/index.js",
"bin": {
"automatisch": "./bin/automatisch"
},
"files": [
"/bin",
"/dist",
"oclif.manifest.json"
],
"repository": {
"type": "git",
"url": "git+https://github.com/automatisch/automatisch.git"
},
"scripts": {
"build": "shx rm -rf dist && tsc -b",
"build:watch": "nodemon --watch 'src/**/*.ts' --exec 'shx rm -rf dist && tsc -b' --ext 'ts'",
"lint": "eslint . --ext .js --ignore-path ../../.eslintignore",
"postpack": "shx rm -f oclif.manifest.json",
"posttest": "yarn lint",
"prepack": "yarn build && oclif manifest && oclif readme",
"version": "oclif readme && git add README.md"
},
"dependencies": {
"@automatisch/backend": "^0.10.0",
"@oclif/core": "^1",
"@oclif/plugin-help": "^5",
"@oclif/plugin-plugins": "^2.0.1",
"dotenv": "^10.0.0"
},
"devDependencies": {
"@oclif/test": "^2",
"@types/node": "^16.9.4",
"eslint-config-oclif": "^4",
"eslint-config-oclif-typescript": "^1.0.2",
"globby": "^11",
"oclif": "^2",
"shx": "^0.3.3",
"ts-node": "^10.2.1",
"tslib": "^2.3.1",
"typescript": "^4.6.3"
},
"oclif": {
"bin": "automatisch",
"dirname": "automatisch",
"commands": "./dist/commands",
"plugins": [
"@oclif/plugin-help",
"@oclif/plugin-plugins"
]
},
"engines": {
"node": ">=12.0.0"
},
"bugs": {
"url": "https://github.com/automatisch/automatisch/issues"
},
"types": "dist/index.d.ts",
"publishConfig": {
"access": "public"
}
}

View File

@@ -1,50 +0,0 @@
import { readFileSync } from 'fs';
import { Command, Flags } from '@oclif/core';
import * as dotenv from 'dotenv';
import process from 'process';
export default class StartWorker extends Command {
static description = 'Run automatisch worker';
static flags = {
env: Flags.string({
multiple: true,
char: 'e',
}),
'env-file': Flags.string(),
};
async prepareEnvVars() {
const { flags } = await this.parse(StartWorker);
if (flags['env-file']) {
const envFile = readFileSync(flags['env-file'], 'utf8');
const envConfig = dotenv.parse(envFile);
for (const key in envConfig) {
const value = envConfig[key];
process.env[key] = value;
}
}
if (flags.env) {
for (const env of flags.env) {
const [key, value] = env.split('=');
process.env[key] = value;
}
}
// must serve until more customization is introduced
delete process.env.SERVE_WEB_APP_SEPARATELY;
}
async runWorker() {
await import('@automatisch/backend/worker');
}
async run() {
await this.prepareEnvVars();
await this.runWorker();
}
}

View File

@@ -1,96 +0,0 @@
import { readFileSync } from 'fs';
import { Command, Flags } from '@oclif/core';
import * as dotenv from 'dotenv';
import process from 'process';
export default class Start extends Command {
static description = 'Run automatisch';
static flags = {
env: Flags.string({
multiple: true,
char: 'e',
}),
'env-file': Flags.string(),
};
get isProduction() {
return process.env.APP_ENV === 'production';
}
async prepareEnvVars() {
const { flags } = await this.parse(Start);
if (flags['env-file']) {
const envFile = readFileSync(flags['env-file'], 'utf8');
const envConfig = dotenv.parse(envFile);
for (const key in envConfig) {
const value = envConfig[key];
process.env[key] = value;
}
}
if (flags.env) {
for (const env of flags.env) {
const [key, value] = env.split('=');
process.env[key] = value;
}
}
// must serve until more customization is introduced
delete process.env.SERVE_WEB_APP_SEPARATELY;
}
async createDatabaseAndUser() {
const utils = await import('@automatisch/backend/database-utils');
await utils.createDatabaseAndUser(
process.env.POSTGRES_DATABASE,
process.env.POSTGRES_USERNAME
);
}
async runMigrationsIfNeeded() {
const { logger } = await import('@automatisch/backend/logger');
const database = await import('@automatisch/backend/database');
const migrator = database.client.migrate;
const [, pendingMigrations] = await migrator.list();
const pendingMigrationsCount = pendingMigrations.length;
const needsToMigrate = pendingMigrationsCount > 0;
if (needsToMigrate) {
logger.info(`Processing ${pendingMigrationsCount} migrations.`);
await migrator.latest();
logger.info(`Completed ${pendingMigrationsCount} migrations.`);
} else {
logger.info('No migrations needed.');
}
}
async seedUser() {
const utils = await import('@automatisch/backend/database-utils');
await utils.createUser();
}
async runApp() {
await import('@automatisch/backend/server');
}
async run() {
await this.prepareEnvVars();
if (!this.isProduction) {
await this.createDatabaseAndUser();
}
await this.runMigrationsIfNeeded();
await this.seedUser();
await this.runApp();
}
}

View File

@@ -1 +0,0 @@
export { run } from '@oclif/core';

View File

@@ -1,19 +0,0 @@
{
"compilerOptions": {
"declaration": true,
"allowJs": true,
"esModuleInterop": true,
"importHelpers": true,
"lib": ["es2021"],
"module": "commonjs",
"moduleResolution": "node",
"noImplicitAny": false,
"outDir": "dist",
"rootDir": "src",
"skipLibCheck": true,
"strict": true,
"target": "es2021",
"typeRoots": ["node_modules/@types", "./src/types"]
},
"include": ["src/**/*"]
}

File diff suppressed because it is too large Load Diff