codexivo 0.2.0 → 1.0.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/CHANGELOG.md +37 -1
- package/README.md +26 -25
- package/dist/index.js +153 -9
- package/dist/index.js.map +22 -12
- package/dist/worker.js +155 -0
- package/dist/worker.js.map +25 -0
- package/docs/README.md +2 -0
- package/docs/arquitectura.md +86 -4
- package/docs/especificacion-v1.md +211 -100
- package/docs/guia-aprender-desde-el-codigo.md +5 -5
- package/docs/integracion.md +104 -0
- package/docs/lenguaje.md +449 -60
- package/docs/modo-mundo.md +128 -0
- package/docs/recetario.md +63 -63
- package/package.json +11 -20
- package/src/catalog.ts +257 -0
- package/src/challenge.ts +138 -0
- package/src/engine.ts +7 -0
- package/src/error-codes.ts +432 -0
- package/src/flow.ts +385 -0
- package/src/index.ts +53 -1
- package/src/printer.ts +133 -0
- package/src/runtime/builtins.ts +1402 -65
- package/src/runtime/compiler.ts +278 -31
- package/src/runtime/costs.ts +96 -0
- package/src/runtime/machine.ts +722 -48
- package/src/runtime/prelude.ts +230 -0
- package/src/runtime/values.ts +120 -18
- package/src/sandbox-host.ts +310 -0
- package/src/sandbox.ts +95 -0
- package/src/syntax/ast.ts +120 -6
- package/src/syntax/lexer.ts +39 -5
- package/src/syntax/parser.ts +496 -72
- package/src/syntax/token.ts +49 -1
- package/src/worker.ts +18 -0
- package/src/world.ts +518 -0
- package/bin/codexivo.exe +0 -1
- package/postinstall.mjs +0 -38
package/postinstall.mjs
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { chmodSync, copyFileSync, existsSync, linkSync, readFileSync, unlinkSync } from 'node:fs';
|
|
2
|
-
import { createRequire } from 'node:module';
|
|
3
|
-
import { dirname, join, resolve } from 'node:path';
|
|
4
|
-
import { fileURLToPath } from 'node:url';
|
|
5
|
-
|
|
6
|
-
const directory = dirname(fileURLToPath(import.meta.url));
|
|
7
|
-
const require = createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// Development checkouts build their executables after installing dependencies.
|
|
10
|
-
if (existsSync(join(directory, 'src/cli.ts')) && existsSync(join(directory, 'packages'))) process.exit(0);
|
|
11
|
-
|
|
12
|
-
const root = JSON.parse(readFileSync(join(directory, 'package.json'), 'utf8'));
|
|
13
|
-
const platform = process.platform === 'win32' ? 'windows' : process.platform;
|
|
14
|
-
const musl = platform === 'linux' && !process.report.getReport().header.glibcVersionRuntime;
|
|
15
|
-
const name = `codexivo-${platform}-${process.arch}${musl ? '-musl' : ''}`;
|
|
16
|
-
|
|
17
|
-
try {
|
|
18
|
-
if (!root.optionalDependencies[name]) throw new Error(`No hay un ejecutable para ${platform}/${process.arch}.`);
|
|
19
|
-
const manifest = require.resolve(`${name}/package.json`);
|
|
20
|
-
const native = JSON.parse(readFileSync(manifest, 'utf8'));
|
|
21
|
-
if (native.version !== root.version || native.version !== root.optionalDependencies[name]) {
|
|
22
|
-
throw new Error(`La versión de ${name} (${native.version}) debe ser ${root.version}.`);
|
|
23
|
-
}
|
|
24
|
-
const source = join(dirname(manifest), 'bin', platform === 'windows' ? 'codexivo.exe' : 'codexivo');
|
|
25
|
-
if (!existsSync(source)) throw new Error(`No se encontró el ejecutable de ${name}.`);
|
|
26
|
-
const destination = resolve(directory, root.bin.codexivo);
|
|
27
|
-
if (existsSync(destination)) unlinkSync(destination);
|
|
28
|
-
try {
|
|
29
|
-
linkSync(source, destination);
|
|
30
|
-
} catch {
|
|
31
|
-
copyFileSync(source, destination);
|
|
32
|
-
}
|
|
33
|
-
chmodSync(destination, 0o755);
|
|
34
|
-
} catch (error) {
|
|
35
|
-
console.error(`No se pudo instalar Codexivo: ${error.message}`);
|
|
36
|
-
console.error('Reinstala el paquete con las dependencias opcionales y los scripts de instalación habilitados.');
|
|
37
|
-
process.exit(1);
|
|
38
|
-
}
|