Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wollok-ts API revamp #129

Merged
merged 9 commits into from
Mar 20, 2024
Merged

wollok-ts API revamp #129

merged 9 commits into from
Mar 20, 2024

Conversation

fdodino
Copy link
Contributor

@fdodino fdodino commented Mar 6, 2024

El CI no pasa porque necesitamos mergear primero wollok-ts y actualizar el package.json

Qué incluye

  • se migraron varias funciones
  • reificación de constantes
  • todos los imports de wollok-ts usan la nueva exportación del módulo wollok-ts sin tener que usar las carpetas dist
  • actualizamos la configuración de VSC para que el import use comillas simples y nada de puntos y coma
  • y cosas que el linter reclama como definirle tipos a ciertos parámetros

Qué hay que mergear antes

@fdodino fdodino changed the title Wollok ts api revamp wollok-ts Api revamp Mar 13, 2024
@fdodino fdodino marked this pull request as ready for review March 13, 2024 01:49
@fdodino fdodino mentioned this pull request Mar 13, 2024
@fdodino fdodino changed the title wollok-ts Api revamp wollok-ts API revamp Mar 13, 2024
@fdodino fdodino requested review from PalumboN and ivojawer March 13, 2024 02:51
Copy link
Contributor

@PalumboN PalumboN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Esto es BUENÏSIMO !

image

import { RuntimeObject } from 'wollok-ts'
import { Interpreter } from 'wollok-ts/dist/interpreter/interpreter'
import { Interpreter, RuntimeObject } from 'wollok-ts'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

Comment on lines +305 to 309
// TODO WOLLOK-TS: migrate it? Maybe it could be part of Environment
// Environment.newImportFor(baseNode, importNode)
function newImport(importNode: Import, environment: Environment) {
const node = replNode(environment)
const imported = node.scope.resolve<Package | Entity>(importNode.entity.name)!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 💯

Comment on lines -9 to -29
const LIST_MODULE = 'List'
const STRING_MODULE = 'wollok.lang.String'
const WOLLOK_BASE_MODULES = 'wollok.'

const SELF = 'self'

function getImportedDefinitions(interpreter: Interpreter, rootFQN?: Package): Entity[] {
const environment = interpreter.evaluation.environment
const importedPackage = rootFQN ?? replNode(environment)
return [
...importedPackage.members,
...importedPackage.imports.flatMap(resolveImport),
]
}

function resolveImport(imp: Import): Entity[] {
const importedEntity = imp.entity.target!
return imp.isGeneric
? [...(importedEntity as Package).members]
: [importedEntity]
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏟️

Copy link

codecov bot commented Mar 20, 2024

Codecov Report

Attention: Patch coverage is 97.43590% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 84.91%. Comparing base (bcf4129) to head (794569b).

Files Patch % Lines
src/commands/run.ts 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #129      +/-   ##
==========================================
- Coverage   85.63%   84.91%   -0.72%     
==========================================
  Files           9        9              
  Lines         696      663      -33     
  Branches      161      155       -6     
==========================================
- Hits          596      563      -33     
  Misses        100      100              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@PalumboN PalumboN merged commit 25a6bda into master Mar 20, 2024
3 checks passed
@PalumboN PalumboN deleted the wollok-ts-api-revamp branch March 20, 2024 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants