@owdproject/cli 0.0.2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/README.md +50 -16
- package/bin/bridge.js +127 -0
- package/bin/cli.js +433 -0
- package/bin/cp.js +3523 -0
- package/bin/desktop.js +5 -0
- package/bin/lib/catalog.js +501 -0
- package/bin/lib/config.js +130 -0
- package/bin/lib/cpAscii.js +39 -0
- package/bin/lib/cpFormat.js +343 -0
- package/bin/lib/desktopConfig.js +8 -0
- package/bin/lib/generateTemplate.js +426 -0
- package/bin/lib/install.js +525 -0
- package/bin/lib/installWizardFlow.js +726 -0
- package/bin/lib/migrateModulePlayground.config.mjs +187 -0
- package/bin/lib/migrateModulePlayground.mjs +318 -0
- package/bin/lib/npmVersions.js +124 -0
- package/bin/lib/packageSources.js +365 -0
- package/bin/lib/playgroundContext.js +188 -0
- package/bin/lib/scaffold.js +205 -0
- package/bin/lib/status.js +317 -0
- package/bin/lib/validateModule.js +868 -0
- package/bin/lib/workspace.js +222 -0
- package/bin/owd.js +2 -118
- package/go/bridge/bridge.go +200 -0
- package/go/desktop-go +0 -0
- package/go/go.mod +26 -0
- package/go/go.sum +37 -0
- package/go/main.go +30 -0
- package/go/tui/tui.go +3014 -0
- package/package.json +33 -23
- package/src/commands/create.js +0 -11
- package/src/commands/generate.js +0 -12
- package/src/commands/installApp.js +0 -9
- package/src/commands/installTheme.js +0 -9
- package/src/commands/start.js +0 -13
- package/src/utils/cloneRepo.js +0 -25
- package/src/utils/installPackage.js +0 -15
- package/src/utils/logging.js +0 -15
package/package.json
CHANGED
|
@@ -1,36 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owdproject/cli",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Control Panel and Command Line Interface for Open Web Desktop",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"cli",
|
|
7
|
-
"open-web-desktop",
|
|
8
6
|
"owd",
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
7
|
+
"desktop",
|
|
8
|
+
"cli",
|
|
9
|
+
"tui",
|
|
10
|
+
"control-panel"
|
|
13
11
|
],
|
|
12
|
+
"homepage": "https://github.com/owdproject/cli#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/owdproject/cli/issues"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/owdproject/cli.git"
|
|
19
|
+
},
|
|
14
20
|
"license": "MIT",
|
|
15
21
|
"author": {
|
|
16
|
-
"name": "
|
|
17
|
-
"url": "https://github.com/
|
|
22
|
+
"name": "Open Web Desktop Team",
|
|
23
|
+
"url": "https://github.com/owdproject"
|
|
18
24
|
},
|
|
19
25
|
"type": "module",
|
|
20
|
-
"main": "index.js",
|
|
21
26
|
"bin": {
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
"scripts": {
|
|
25
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
27
|
+
"desktop": "bin/desktop.js",
|
|
28
|
+
"owd": "bin/owd.js"
|
|
26
29
|
},
|
|
30
|
+
"files": [
|
|
31
|
+
"bin",
|
|
32
|
+
"go"
|
|
33
|
+
],
|
|
27
34
|
"dependencies": {
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
+
"neo-blessed": "^0.2.0",
|
|
36
|
+
"cli-spinners": "^2.9.2",
|
|
37
|
+
"defu": "^6.1.4",
|
|
38
|
+
"getopts": "^2.3.0",
|
|
39
|
+
"log-symbols": "^4.1.0",
|
|
40
|
+
"mitt": "^3.0.1",
|
|
41
|
+
"nanoid": "^5.1.11",
|
|
42
|
+
"shellwords": "^1.1.1",
|
|
43
|
+
"ts-morph": "^25.0.1",
|
|
44
|
+
"@owdproject/core": "3.4.0"
|
|
35
45
|
}
|
|
36
|
-
}
|
|
46
|
+
}
|
package/src/commands/create.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { logTitle } from '../utils/logging'
|
|
2
|
-
import chalk from 'chalk'
|
|
3
|
-
|
|
4
|
-
export const createCommand = (program) => {
|
|
5
|
-
program.command('create')
|
|
6
|
-
.description('Create a new project')
|
|
7
|
-
.action(() => {
|
|
8
|
-
logTitle()
|
|
9
|
-
console.log(chalk.green('✨ Creating new project'))
|
|
10
|
-
})
|
|
11
|
-
}
|
package/src/commands/generate.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// src/commands/generate.js
|
|
2
|
-
import { logTitle } from '../utils/logging'
|
|
3
|
-
import chalk from 'chalk'
|
|
4
|
-
|
|
5
|
-
export const generateCommand = (program) => {
|
|
6
|
-
program.command('generate')
|
|
7
|
-
.description('Generate deployment files')
|
|
8
|
-
.action(() => {
|
|
9
|
-
logTitle()
|
|
10
|
-
console.log(chalk.yellow('⚡ Generating files'))
|
|
11
|
-
})
|
|
12
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// src/commands/installApp.js
|
|
2
|
-
import { installPackage } from '../utils/installPackage'
|
|
3
|
-
import chalk from 'chalk'
|
|
4
|
-
|
|
5
|
-
export const installAppCommand = (program) => {
|
|
6
|
-
program.command('install app <source>')
|
|
7
|
-
.description('Install a new application from a Git or NPM source')
|
|
8
|
-
.action((source) => installPackage('Application', source))
|
|
9
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// src/commands/installTheme.js
|
|
2
|
-
import { installPackage } from '../utils/installPackage'
|
|
3
|
-
import chalk from 'chalk'
|
|
4
|
-
|
|
5
|
-
export const installThemeCommand = (program) => {
|
|
6
|
-
program.command('install theme <source>')
|
|
7
|
-
.description('Install a new theme from a Git or NPM source')
|
|
8
|
-
.action((source) => installPackage('Theme', source))
|
|
9
|
-
}
|
package/src/commands/start.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// src/commands/start.js
|
|
2
|
-
import { logTitle, logServerInfo } from '../utils/logging'
|
|
3
|
-
import chalk from 'chalk'
|
|
4
|
-
|
|
5
|
-
export const startCommand = (program) => {
|
|
6
|
-
program.command('start')
|
|
7
|
-
.description('Start the project in development mode')
|
|
8
|
-
.action(() => {
|
|
9
|
-
logTitle()
|
|
10
|
-
console.log(chalk.blue('🚀 Starting development server'))
|
|
11
|
-
logServerInfo()
|
|
12
|
-
})
|
|
13
|
-
}
|
package/src/utils/cloneRepo.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import chalk from "chalk";
|
|
2
|
-
import fs from 'fs-extra';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
import simpleGit from 'simple-git'
|
|
5
|
-
|
|
6
|
-
export const cloneRepo = async (targetPath) => {
|
|
7
|
-
const git = simpleGit()
|
|
8
|
-
const tempDir = path.join(process.cwd(), 'owd-temp')
|
|
9
|
-
|
|
10
|
-
try {
|
|
11
|
-
await git.clone('https://github.com/owdproject/client', tempDir)
|
|
12
|
-
|
|
13
|
-
const templatePath = path.join(tempDir, 'template')
|
|
14
|
-
if (fs.existsSync(templatePath)) {
|
|
15
|
-
fs.copySync(templatePath, targetPath)
|
|
16
|
-
} else {
|
|
17
|
-
console.log(chalk.red('Template directory does not exist in the cloned repo!'))
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
fs.removeSync(tempDir)
|
|
21
|
-
} catch (error) {
|
|
22
|
-
console.error(error)
|
|
23
|
-
console.log(chalk.red('✖ Error cloning or copying the template'))
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// src/utils/installPackage.js
|
|
2
|
-
import { execSync } from 'child_process'
|
|
3
|
-
import chalk from 'chalk'
|
|
4
|
-
// import { logTitle } from './logging'
|
|
5
|
-
|
|
6
|
-
export const installPackage = (type, source) => {
|
|
7
|
-
//logTitle()
|
|
8
|
-
console.log(chalk.yellow(`📦 Installing ${type}: ${source}`))
|
|
9
|
-
try {
|
|
10
|
-
execSync(`npm install ${source}`, { stdio: 'inherit' })
|
|
11
|
-
console.log(chalk.green(`✔ ${type} installed successfully`))
|
|
12
|
-
} catch (error) {
|
|
13
|
-
console.log(chalk.red(`✖ Failed to install ${type}`))
|
|
14
|
-
}
|
|
15
|
-
}
|
package/src/utils/logging.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// src/utils/logging.js
|
|
2
|
-
import figlet from 'figlet'
|
|
3
|
-
import gradient from 'gradient-string'
|
|
4
|
-
import chalk from 'chalk'
|
|
5
|
-
|
|
6
|
-
export const logTitle = () => {
|
|
7
|
-
console.log(gradient.pastel.multiline(figlet.textSync('OWD', { horizontalLayout: 'full' })))
|
|
8
|
-
console.log(chalk.red.bold('\n ➜ Main Commands'))
|
|
9
|
-
console.log(chalk.red.bold(' ───────────────────────────────────'))
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const logServerInfo = () => {
|
|
13
|
-
console.log(`\n ${chalk.red.bold('➜ Local:')} ${chalk.white('http://localhost:3000/')}`)
|
|
14
|
-
console.log(` ${chalk.red.bold('➜ Network:')} ${chalk.white('http://localhost:3000/')} \n`)
|
|
15
|
-
}
|