@aliens-syndicate/cli 0.1.9 → 0.1.10
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/README.es-ES.md +1 -1
- package/README.md +1 -1
- package/README.pt-BR.md +1 -1
- package/README.zh-CN.md +1 -1
- package/package.json +1 -1
- package/tools/doctor.mjs +10 -5
- package/tools/update.mjs +3 -3
package/README.es-ES.md
CHANGED
|
@@ -39,7 +39,7 @@ El comentario al inicio de `.config` lista los mismos comandos, y la página **I
|
|
|
39
39
|
```text
|
|
40
40
|
dependencies:
|
|
41
41
|
framework:
|
|
42
|
-
@aliens-syndicate/framework: 0.
|
|
42
|
+
@aliens-syndicate/framework: 0.1.10
|
|
43
43
|
icons:
|
|
44
44
|
@aliens-syndicate/icons/stroke-rounded: 0.1.0
|
|
45
45
|
elements:
|
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ The comment at the top of `.config` lists the same commands, and the **Installat
|
|
|
39
39
|
```text
|
|
40
40
|
dependencies:
|
|
41
41
|
framework:
|
|
42
|
-
@aliens-syndicate/framework: 0.
|
|
42
|
+
@aliens-syndicate/framework: 0.1.10
|
|
43
43
|
icons:
|
|
44
44
|
@aliens-syndicate/icons/stroke-rounded: 0.1.0
|
|
45
45
|
elements:
|
package/README.pt-BR.md
CHANGED
|
@@ -39,7 +39,7 @@ O `.config` lista o framework e cada pacote com a sua versão, agrupados como no
|
|
|
39
39
|
```text
|
|
40
40
|
dependencies:
|
|
41
41
|
framework:
|
|
42
|
-
@aliens-syndicate/framework: 0.
|
|
42
|
+
@aliens-syndicate/framework: 0.1.10
|
|
43
43
|
icons:
|
|
44
44
|
@aliens-syndicate/icons/stroke-rounded: 0.1.0
|
|
45
45
|
elements:
|
package/README.zh-CN.md
CHANGED
package/package.json
CHANGED
package/tools/doctor.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { join } from 'node:path';
|
|
|
5
5
|
import { toolsDifferences } from './update.mjs';
|
|
6
6
|
import {
|
|
7
7
|
bold, captureCommand, installedVersion, cliPackage, cliRoot, cliVersion, compareVersions, cyan, defaultPort, dim, findProject, green,
|
|
8
|
-
configExtensions, latestVersion, minimumNode, parseFlags, pick, readConfig, red, runBuild, yellow
|
|
8
|
+
configExtensions, configFramework, latestVersion, minimumNode, parseFlags, pick, readConfig, red, runBuild, yellow
|
|
9
9
|
} from './cli-shared.mjs';
|
|
10
10
|
|
|
11
11
|
const text = {
|
|
@@ -16,7 +16,7 @@ const text = {
|
|
|
16
16
|
noProjectFix: 'Create one with aliens new <name>, or open a project folder', project: 'Project {name} in {path}',
|
|
17
17
|
config: '.config is valid', configBad: '.config: {problem}', entryMissing: 'files: entry: {file} does not exist', tools: 'tools/ matches the CLI {version}',
|
|
18
18
|
toolsOld: 'tools/ differs from the CLI {version} in {files}', toolsFix: 'aliens update', toolsSelf: 'tools/ is the CLI itself (framework repository)',
|
|
19
|
-
extension: '{name} {version}', extensionMissing: '{name} is declared in .config ({section}:) but is not installed', extensionFix: 'npm install {name}', extensionVersion: '{name}: .config declares {declared}, but {version} is installed', extensionLegacy: '{name}: .config still uses from:, without the version', updateFix: 'aliens update',
|
|
19
|
+
extension: '{name} {version}', extensionMissing: '{name} is declared in .config ({section}:) but is not installed', extensionFix: 'npm install {name}', extensionVersion: '{name}: .config declares {declared}, but {version} is installed', extensionLegacy: '{name}: .config still uses from:, without the version', updateFix: 'aliens update', framework: 'framework {version} in .config', frameworkOld: '.config lists framework {declared}, but the CLI is {version}',
|
|
20
20
|
port: 'Port {port} is free for aliens run', portUsed: 'Port {port} is in use', portDenied: 'Port {port} needs administrator rights on this system',
|
|
21
21
|
portFix: 'aliens run --port <number>, or set serve: port: in .config', build: 'aliens build passes', buildBad: 'aliens build fails: {error}',
|
|
22
22
|
buildFix: 'Fix the file and line in the message, then run aliens build', fine: 'No issues found.', issues: '{count} issue(s) found.', warnings: '{count} warning(s).' },
|
|
@@ -27,7 +27,7 @@ const text = {
|
|
|
27
27
|
noProjectFix: 'Crie um com aliens new <nome> ou abra a pasta de um projeto', project: 'Projeto {name} em {path}',
|
|
28
28
|
config: '.config válido', configBad: '.config: {problem}', entryMissing: 'files: entry: {file} não existe', tools: 'tools/ igual ao da CLI {version}',
|
|
29
29
|
toolsOld: 'tools/ diferente da CLI {version} em {files}', toolsFix: 'aliens update', toolsSelf: 'tools/ é a própria CLI (repositório do framework)',
|
|
30
|
-
extension: '{name} {version}', extensionMissing: '{name} está declarado no .config ({section}:) mas não está instalado', extensionFix: 'npm install {name}', extensionVersion: '{name}: o .config declara {declared}, mas a {version} está instalada', extensionLegacy: '{name}: o .config ainda usa from:, sem a versão', updateFix: 'aliens update',
|
|
30
|
+
extension: '{name} {version}', extensionMissing: '{name} está declarado no .config ({section}:) mas não está instalado', extensionFix: 'npm install {name}', extensionVersion: '{name}: o .config declara {declared}, mas a {version} está instalada', extensionLegacy: '{name}: o .config ainda usa from:, sem a versão', updateFix: 'aliens update', framework: 'framework {version} no .config', frameworkOld: 'O .config lista o framework {declared}, mas a CLI é a {version}',
|
|
31
31
|
port: 'Porta {port} livre para o aliens run', portUsed: 'A porta {port} está em uso', portDenied: 'A porta {port} exige permissão de administrador neste sistema',
|
|
32
32
|
portFix: 'aliens run --port <número> ou defina serve: port: no .config', build: 'aliens build passa', buildBad: 'aliens build falha: {error}',
|
|
33
33
|
buildFix: 'Corrija o arquivo e a linha da mensagem e rode aliens build', fine: 'Nenhum problema encontrado.', issues: '{count} problema(s) encontrado(s).', warnings: '{count} aviso(s).' },
|
|
@@ -38,7 +38,7 @@ const text = {
|
|
|
38
38
|
noProjectFix: 'Crea uno con aliens new <nombre> o abre la carpeta de un proyecto', project: 'Proyecto {name} en {path}',
|
|
39
39
|
config: '.config es válido', configBad: '.config: {problem}', entryMissing: 'files: entry: {file} no existe', tools: 'tools/ coincide con la CLI {version}',
|
|
40
40
|
toolsOld: 'tools/ difiere de la CLI {version} en {files}', toolsFix: 'aliens update', toolsSelf: 'tools/ es la propia CLI (repositorio del framework)',
|
|
41
|
-
extension: '{name} {version}', extensionMissing: '{name} está declarado en .config ({section}:) pero no está instalado', extensionFix: 'npm install {name}', extensionVersion: '{name}: .config declara {declared}, pero está instalada la {version}', extensionLegacy: '{name}: .config todavía usa from:, sin la versión', updateFix: 'aliens update',
|
|
41
|
+
extension: '{name} {version}', extensionMissing: '{name} está declarado en .config ({section}:) pero no está instalado', extensionFix: 'npm install {name}', extensionVersion: '{name}: .config declara {declared}, pero está instalada la {version}', extensionLegacy: '{name}: .config todavía usa from:, sin la versión', updateFix: 'aliens update', framework: 'framework {version} en .config', frameworkOld: '.config indica framework {declared}, pero la CLI es la {version}',
|
|
42
42
|
port: 'Puerto {port} libre para aliens run', portUsed: 'El puerto {port} está en uso', portDenied: 'El puerto {port} requiere permisos de administrador en este sistema',
|
|
43
43
|
portFix: 'aliens run --port <número> o define serve: port: en .config', build: 'aliens build pasa', buildBad: 'aliens build falla: {error}',
|
|
44
44
|
buildFix: 'Corrige el archivo y la línea del mensaje y ejecuta aliens build', fine: 'No se encontraron problemas.', issues: '{count} problema(s) encontrado(s).', warnings: '{count} aviso(s).' },
|
|
@@ -49,7 +49,7 @@ const text = {
|
|
|
49
49
|
noProjectFix: '用 aliens new <名称> 创建一个,或打开项目文件夹', project: '项目 {name},位于 {path}',
|
|
50
50
|
config: '.config 有效', configBad: '.config:{problem}', entryMissing: 'files: entry: {file} 不存在', tools: 'tools/ 与 CLI {version} 一致',
|
|
51
51
|
toolsOld: 'tools/ 与 CLI {version} 不同:{files}', toolsFix: 'aliens update', toolsSelf: 'tools/ 就是 CLI 本身(框架仓库)',
|
|
52
|
-
extension: '{name} {version}', extensionMissing: '{name} 已在 .config({section}:)中声明,但尚未安装', extensionFix: 'npm install {name}', extensionVersion: '{name}:.config 声明的是 {declared},但安装的是 {version}', extensionLegacy: '{name}:.config 仍在使用 from:,没有写版本', updateFix: 'aliens update',
|
|
52
|
+
extension: '{name} {version}', extensionMissing: '{name} 已在 .config({section}:)中声明,但尚未安装', extensionFix: 'npm install {name}', extensionVersion: '{name}:.config 声明的是 {declared},但安装的是 {version}', extensionLegacy: '{name}:.config 仍在使用 from:,没有写版本', updateFix: 'aliens update', framework: '.config 中的 framework {version}', frameworkOld: '.config 中的 framework 是 {declared},但 CLI 是 {version}',
|
|
53
53
|
port: '端口 {port} 可供 aliens run 使用', portUsed: '端口 {port} 已被占用', portDenied: '在此系统上,端口 {port} 需要管理员权限',
|
|
54
54
|
portFix: 'aliens run --port <端口>,或在 .config 中设置 serve: port:', build: 'aliens build 通过', buildBad: 'aliens build 失败:{error}',
|
|
55
55
|
buildFix: '按消息中的文件和行号修复后,运行 aliens build', fine: '未发现问题。', issues: '发现 {count} 个问题。', warnings: '{count} 个警告。' }
|
|
@@ -114,6 +114,11 @@ export async function doctor(args) {
|
|
|
114
114
|
else report('warn', t('toolsOld', { version: cliVersion, files: changed.slice(0, 3).join(', ') + (changed.length > 3 ? '…' : '') }), t('toolsFix'));
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
// framework: follows the CLI whose tools/ the project carries; aliens update writes it.
|
|
118
|
+
const framework = configFramework(config);
|
|
119
|
+
if (framework?.version === cliVersion) report('ok', t('framework', { version: framework.version }));
|
|
120
|
+
else if (framework) report('warn', t('frameworkOld', { declared: framework.version, version: cliVersion }), t('updateFix'));
|
|
121
|
+
|
|
117
122
|
// Each package of .config must be installed in the version .config declares; the build stops otherwise.
|
|
118
123
|
for (const { name: section, group, from, version: declared, legacy } of configExtensions(config)) {
|
|
119
124
|
const version = installedVersion(root, from);
|
package/tools/update.mjs
CHANGED
|
@@ -55,7 +55,7 @@ export async function toolsDifferences(root) {
|
|
|
55
55
|
|
|
56
56
|
// .config keeps one "<package>: <version>" line in each section of dependencies: and devDependencies:. This rewrites
|
|
57
57
|
// the older from: and style: lines into that form and writes the installed version of every package. framework: takes
|
|
58
|
-
// the version of the CLI, whose tools/ the project now carries
|
|
58
|
+
// the version of the CLI, whose tools/ the project now carries; in the framework repository, tools/ is that CLI.
|
|
59
59
|
async function syncConfig(root, dryRun) {
|
|
60
60
|
const path = join(root, '.config');
|
|
61
61
|
const lines = (await readFile(path, 'utf8')).split(/\r?\n/);
|
|
@@ -87,7 +87,7 @@ async function syncConfig(root, dryRun) {
|
|
|
87
87
|
const legacy = Object.fromEntries(children.map(child => /^(from|style):\s*(.+)$/.exec(child)?.slice(1) ?? []).filter(([key]) => key));
|
|
88
88
|
const current = legacy.from ? { name: legacy.from, variant: legacy.style ?? null, version: null } : parseDependency(children[0] ?? '');
|
|
89
89
|
const version = !current ? null
|
|
90
|
-
: section === 'framework' ?
|
|
90
|
+
: section === 'framework' ? cliVersion
|
|
91
91
|
: /^\.{1,2}\//.test(current.name) ? current.version : installedVersion(root, current.name) ?? current.version;
|
|
92
92
|
output.push(line);
|
|
93
93
|
if (!current || !version) {
|
|
@@ -99,7 +99,7 @@ async function syncConfig(root, dryRun) {
|
|
|
99
99
|
if (legacy.from || children.length !== 1 || children[0] !== next) changes.push({ section, line: next });
|
|
100
100
|
}
|
|
101
101
|
// A project created before framework: existed gets it at the top of dependencies:.
|
|
102
|
-
if (!hasFramework
|
|
102
|
+
if (!hasFramework) {
|
|
103
103
|
const line = dependencyLine({ name: '@aliens-syndicate/framework', version: cliVersion });
|
|
104
104
|
const at = output.indexOf('dependencies:');
|
|
105
105
|
if (at >= 0) output.splice(at + 1, 0, ' framework:', ` ${line}`);
|