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: 4 additions & 0 deletions cli/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# .estlintignore file
dist
build
node_modules/
93 changes: 93 additions & 0 deletions cli/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
module.exports = {
env: {
browser: false,
es2021: true,
node: true
},
extends: ['plugin:react/recommended', 'plugin:react/jsx-runtime'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true
},
ecmaVersion: 'latest',
sourceType: 'module'
},
plugins: [
'prettier',
'react',
'@typescript-eslint',
'unused-imports',
'import',
'react-hooks'
],
settings: {
react: {
version: 'detect'
}
},
rules: {
'no-unsafe-optional-chaining': [
'error',
{ disallowArithmeticOperators: true }
],
'react/jsx-filename-extension': [
'error',
{ extensions: ['.js', '.jsx', '.ts', '.tsx'] }
],
'prettier/prettier': 'warn',
'react/prop-types': 'off',
'react/display-name': 'off',
'react/no-unescaped-entities': 'off',
'react/jsx-max-props-per-line': [
1,
{
maximum: 2,
when: 'multiline'
}
],
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_'
}
],
'import/order': [
'error',
{
pathGroups: [
{
pattern: '@/**',
group: 'internal',
position: 'after'
}
],
distinctGroup: false,
groups: [
'external',
'builtin',
'internal',
'index',
'sibling',
'parent',
'object',
'type'
],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true
}
}
],
'react/jsx-no-target-blank': 'off',
'react/require-render-return': 'off',
'react/no-direct-mutation-state': 'off',
'react-hooks/exhaustive-deps': 'warn'
}
};
1 change: 1 addition & 0 deletions cli/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
3 changes: 3 additions & 0 deletions cli/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
*.log
1 change: 1 addition & 0 deletions cli/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
9 changes: 9 additions & 0 deletions cli/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"bracketSpacing": true,
"printWidth": 80,
"singleQuote": true,
"trailingComma": "none",
"tabWidth": 2,
"useTabs": false,
"bracketSameLine": false
}
6 changes: 6 additions & 0 deletions cli/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"gruntfuggly.todo-tree",
"stringham.copy-with-imports"
]
}
11 changes: 11 additions & 0 deletions cli/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "debug cli",
"type": "node-terminal",
"request": "launch",
"command": "yarn dev"
},
]
}
12 changes: 12 additions & 0 deletions cli/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"workbench.editor.labelFormat": "short",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"tsEssentialPlugins.autoImport.changeSorting": {
"createContext": ["react"]
},
"tsEssentialPlugins.patchOutline": true,
"editor.linkedEditing": true,
"tsEssentialPlugins.enableMethodSnippets": false,
}
7 changes: 7 additions & 0 deletions cli/libdefs/ink.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import 'ink-testing-library';

import {ReactNode} from 'react';

declare module 'ink-testing-library' {
export function render(tree: ReactNode): RenderResponse;
}
60 changes: 60 additions & 0 deletions cli/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"name": "cli",
"version": "0.0.0",
"license": "MIT",
"bin": "dist/cli.js",
"engines": {
"node": ">=16"
},
"type": "module",
"scripts": {
"build": "tsc",
"dev": "tsc --watch",
"test": "yarn link-fix && ava",
"lint": "eslint",
"lint-fix": "eslint --fix ./source/**/*",
"start": "node dist/cli.js"
},
"files": [
"dist"
],
"dependencies": {
"dockerode": "^4.0.2",
"dockerode-compose": "^1.4.0",
"ink": "^4.4.1",
"ink-spinner": "^5.0.0",
"meow": "^11.0.0",
"ramda": "^0.29.1",
"react": "^18.2.0"
},
"devDependencies": {
"@types/dockerode": "^3.3.28",
"@types/dockerode-compose": "^1.4.1",
"@types/ink-testing-library": "^1.0.4",
"@types/ramda": "^0.29.12",
"@types/react": "^18.0.32",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"ava": "^5.2.0",
"chalk": "^5.2.0",
"eslint": "^8.40.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-unused-imports": "^3.1.0",
"ink-testing-library": "^3.0.0",
"prettier": "^3.0.3",
"ts-node": "^10.9.1",
"typescript": "5.3.3"
},
"ava": {
"extensions": {
"ts": "module",
"tsx": "module"
},
"nodeArguments": [
"--loader=ts-node/esm"
]
}
}
25 changes: 25 additions & 0 deletions cli/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# cli

> This readme is automatically generated by [create-ink-app](https://github.com/vadimdemedes/create-ink-app)

## Install

```bash
$ npm install --global cli
```

## CLI

```
$ cli --help

Usage
$ cli

Options
--name Your name

Examples
$ cli --name=Jane
Hello, Jane
```
17 changes: 17 additions & 0 deletions cli/source/__tests__/test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import test from 'ava';
import chalk from 'chalk';
import { render } from 'ink-testing-library';

import { App } from '../app.js';

test('greet unknown user', (t) => {
const { lastFrame } = render(<App />);

t.is(lastFrame(), `Hello, ${chalk.green('Stranger')}`);
});

test('greet user with a name', (t) => {
const { lastFrame } = render(<App />);

t.is(lastFrame(), `Hello, ${chalk.green('Jane')}`);
});
Loading