Skip to content

Commit

Permalink
Merge pull request #925 from aml-org/r/v5.4.0
Browse files Browse the repository at this point in the history
R/v5.4.0
  • Loading branch information
emilianoascona authored Jun 2, 2023
2 parents 6f08028 + 594bda8 commit 927797e
Show file tree
Hide file tree
Showing 1,538 changed files with 84,215 additions and 28,330 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ USER root

ARG USER_HOME_DIR="/root"

ENV SCALA_VERSION 2.12.13
ENV SBT_VERSION 1.7.1
ENV SCALA_VERSION="2.12.13"
ENV SBT_VERSION="1.7.1"


# Update the repository sources list and install dependencies
Expand All @@ -28,7 +28,7 @@ RUN apt-get install unzip -y && \
## Piping curl directly in tar
RUN \
apt-get install curl --assume-yes && \
curl -fsL http://downloads.typesafe.com/scala/$SCALA_VERSION/scala-$SCALA_VERSION.tgz | tar xfz - -C /root/ && \
curl -fsL http://www.scala-lang.org/files/archive/scala-$SCALA_VERSION.tgz | tar xfz - -C /root/ && \
echo >> /root/.bashrc && \
echo 'export PATH=~/scala-$SCALA_VERSION/bin:$PATH' >> /root/.bashrc

Expand Down
8 changes: 4 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pipeline {
wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm']) {
script {
try {
sh 'sbt -mem 6000 -Dflaky.ignore=true -Dsbt.global.base=.sbt -Dsbt.boot.directory=.sbt -Dsbt.ivy.home=.ivy2 clean coverage test coverageAggregate'
sh 'sbt -mem 12000 -Dflaky.ignore=true -Dsbt.global.base=.sbt -Dsbt.boot.directory=.sbt -Dsbt.ivy.home=.ivy2 -Djava.io.tmpdir=$HOME clean coverage test coverageAggregate --warn'
} catch (e) {
failedStage = failedStage + " TEST "
unstable "Failed tests"
Expand Down Expand Up @@ -154,7 +154,7 @@ pipeline {
script {
try {
if (failedStage.isEmpty()) {
sh 'sbt publish'
sh 'sbt --mem 10000 publish -Djava.io.tmpdir=$HOME'
}
} catch (e) {
failedStage = failedStage + " PUBLISH "
Expand All @@ -177,7 +177,7 @@ pipeline {
if (failedStage.isEmpty()) {
publish_version_node_client = "${publish_version}".replace("\n", "")
echo "$publish_version_node_client"
sh 'sbt -mem 6000 -Dsbt.global.base=.sbt -Dsbt.boot.directory=.sbt -Dsbt.ivy.home=.ivy2 buildNodeJsClient'
sh 'sbt -mem 10000 -Dsbt.global.base=.sbt -Dsbt.boot.directory=.sbt -Dsbt.ivy.home=.ivy2 buildNodeJsClient -Djava.io.tmpdir=$HOME'
def statusCode = 1
dir("als-node-client/node-package") {
echo "Publishing NPM package: ${publish_version_node_client}"
Expand Down Expand Up @@ -205,7 +205,7 @@ pipeline {
script {
if (failedStage.isEmpty()) {
def statusCode = 1
statusCode = sh script:'sbt -mem 6000 -Dsbt.global.base=.sbt -Dsbt.boot.directory=.sbt -Dsbt.ivy.home=.ivy2 buildJsServerLibrary', returnStatus: true
statusCode = sh script:'sbt -mem 12000 -Dsbt.global.base=.sbt -Dsbt.boot.directory=.sbt -Dsbt.ivy.home=.ivy2 -Djava.io.tmpdir=$HOME buildJsServerLibrary', returnStatus: true
if(statusCode != 0) {
failedStage = failedStage + " PUBLISH-SERVER-JS "
unstable "Failed als-server JS publication"
Expand Down
47 changes: 47 additions & 0 deletions adrs/bumps/0001-scalaJS-1.1.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 1. Bump ScalaJS from 0.6 to 1.1

Date: 2023-03-10

## Status
In Progress

## Context
Bump ScalaJS from 0.6 to 1.1 had a lot of compatibility issues with some plugins and dependencies, like:

- sbt-scalajs: 1.6.0
- scalatest
- upickle
- node v16.19.0


## Decision
1. We follow AMF suggestion to use `sbt-scalaJS:1.6.0` instead of `1.7.0+` beacuse of _RegEx adaption_
2. We found a `scalatest` version that has compatibility with `scalaJS 1`
3. `upickle` use `scalaJS 1` since `0.9.x`. [See more details](https://mvnrepository.com/artifact/com.lihaoyi/upickle_sjs1_2.12)
4. For node 16 we decide to use `scala-js-nodejs-v14` from `net-exoego`. We had to downgrade to _Node 14_ because this is used only for **Test mode** and for _Node 16_ there was just one version and this unique version requires `sbt-scalajs 1.8.0+`

## Issues
- Changing to latest `Upickle` version fix compatibility with `sbt-scalaJS` but fail all `als-suggestion` tests because the write function of an empty array change from:
`[]` to
`[ \n ]`
- Some code had to been changed because of deprecated packages
- Some `@JSExport` annotations were changed to `@JSExportTopLevel`
- Workspaces name were removed from exported annotations
- `ScalaJSModuleKind` was replaced with `scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.CommonJSModule)
.withESFeatures(_.withESVersion(ESVersion.ES2016))
}`
- Other replacements (depends of scala version):
- `fastOptJS` -> `fastLinkJS`
- `fullOptJS` -> `fullLinkJS`
- `artifactPath` -> `scalaJSLinkerOutputDirectory`

** NOTE: This modifications in the linkerJS config change the way that the autogenerated JS file is created. It creates a folder with main.js files instead of .js files. Keep in mind that for some commands (i.e. buildServerJsLibrary) need to run an script that move those file to another dir. If this config is updated the script file need to be fixed.
- Some commons dependencies do not on JS, so we need to add those using `libraryDependencies` in _JS Settings_ section.



### Internal Work Items
- [W-12658516](https://gus.lightning.force.com/a07EE00001MkxRJYAZ)
- [W-12601018](https://gus.lightning.force.com/a07EE00001LqaxfYAB)


46 changes: 15 additions & 31 deletions als-actions/js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion als-actions/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"@aml-org/amf-antlr-parsers": "0.6.23",
"@aml-org/amf-antlr-parsers": "0.7.24",
"ajv": "6.12.6"
},
"author": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import org.mulesoft.amfintegration.amfconfiguration.{
EditorConfiguration,
EmptyProjectConfigurationState
}
import org.scalatest.{Assertion, AsyncFunSuite}
import org.scalatest.Assertion
import org.scalatest.funsuite.AsyncFunSuite
import org.yaml.model._

import scala.concurrent.{ExecutionContext, Future}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import org.mulesoft.als.common.diff.FileAssertionTest
import org.mulesoft.als.common.dtoTypes.PositionRange
import org.mulesoft.als.common.{PlatformDirectoryResolver, WorkspaceEditSerializer}
import org.mulesoft.als.configuration.AlsConfiguration
import org.mulesoft.amfintegration.AmfImplicits.AmfAnnotationsImp
import org.mulesoft.amfintegration.amfconfiguration.{
ALSConfigurationState,
AmfParseResult,
Expand All @@ -21,7 +20,9 @@ import org.mulesoft.lsp.edit.WorkspaceEdit
import org.mulesoft.lsp.feature.codeactions.CodeAction
import org.mulesoft.lsp.feature.telemetry.MessageTypes.MessageTypes
import org.mulesoft.lsp.feature.telemetry.TelemetryProvider
import org.scalatest.{Assertion, AsyncFlatSpec, Matchers}
import org.scalatest.Assertion
import org.scalatest.flatspec.AsyncFlatSpec
import org.scalatest.matchers.should.Matchers

import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.{ExecutionContext, Future}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import org.mulesoft.amfintegration.amfconfiguration.{
EditorConfiguration,
EmptyProjectConfigurationState
}
import org.scalatest.Assertion
import org.scalatest.compatible.Assertion
import org.yaml.model.YDocument
import org.yaml.model.YDocument.{EntryBuilder, PartBuilder}
import org.yaml.render.YamlRender
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package org.mulesoft.als.actions.definition

import amf.core.internal.unsafe.PlatformSecrets
import org.scalatest.{AsyncFlatSpec, Matchers}
import org.scalatest.flatspec.AsyncFlatSpec
import org.scalatest.matchers.should.Matchers

import scala.concurrent.ExecutionContext

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import org.mulesoft.amfintegration.amfconfiguration.{
EmptyProjectConfigurationState
}
import org.mulesoft.lsp.feature.folding.FoldingRange
import org.scalatest.{AsyncFlatSpec, Matchers}
import org.scalatest.flatspec.AsyncFlatSpec
import org.scalatest.matchers.should.Matchers

import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.{ExecutionContext, Future}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package org.mulesoft.als.actions.links

import amf.core.internal.unsafe.PlatformSecrets
import org.scalatest.{FlatSpec, Matchers}
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

class FindLinksTests extends FlatSpec with Matchers with PlatformSecrets {
class FindLinksTests extends AnyFlatSpec with Matchers with PlatformSecrets {
behavior of "Find Links"

// todo: find a way to test this in a simple way (currently tested in server module)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import amf.core.internal.unsafe.PlatformSecrets
import org.mulesoft.als.actions.formatting.RangeFormatting
import org.mulesoft.amfintegration.ErrorsCollected
import org.mulesoft.lsp.configuration.FormattingOptions
import org.scalatest.{FlatSpec, Matchers}
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import org.yaml.model.YMap

class FormattingOptionsTest extends FlatSpec with Matchers with PlatformSecrets {
class FormattingOptionsTest extends AnyFlatSpec with Matchers with PlatformSecrets {
behavior of "Formatting Options"

private val baseTest = "my: \n test: lorem ipsum \n\n\n\n\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import org.mulesoft.amfintegration.amfconfiguration.{
}
import org.mulesoft.lsp.feature.common.{Range, Position => LspPosition}
import org.mulesoft.lsp.feature.selectionRange.SelectionRange
import org.scalatest.{AsyncFlatSpec, Matchers}
import org.scalatest.flatspec.AsyncFlatSpec
import org.scalatest.matchers.should.Matchers

import scala.concurrent.{ExecutionContext, Future}

Expand Down
46 changes: 15 additions & 31 deletions als-common/js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion als-common/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"@aml-org/amf-antlr-parsers": "0.6.23",
"@aml-org/amf-antlr-parsers": "0.7.24",
"ajv": "6.12.6"
},
"author": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ package org.mulesoft.als.configuration

import org.mulesoft.als.common.{DirectoryResolver => InternalResolver}

import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined
import scala.concurrent.ExecutionContext.Implicits.global

@ScalaJSDefined
trait ClientDirectoryResolver extends js.Object {

def exists(path: String): js.Promise[Boolean]
Expand Down
Loading

0 comments on commit 927797e

Please sign in to comment.