Commit Graph

84 Commits

Author SHA1 Message Date
Moisés Ackerman
1bee52e40c
Remove compiler support for controller..can choice syntax (#17362)
* Update GHC_REV

* Remove 'controller..can' syntax in java codegen StakeholdersTest

* Remove 'controller..can' syntax in ChoiceSyntaxes daml-test-file

* Remove daml-test-files {,No}WarnControllerCan

* Remove 'controller..can' syntax in SemanticsEvalOrder{,RightToLeft} daml-test-files

* Update {Structure,Reference}.daml code snippets for docs.daml.com

* Remove 'controller..can' syntax in TestGrammar.daml

* changelog entry for 'controller..can' removal

* Update UNRELEASED.md

Co-authored-by: carrielaben-da <91496516+carrielaben-da@users.noreply.github.com>
2023-09-08 10:30:21 +00:00
Gary Verhaegen
0e9cb10f7d
optionally get canton EE (#17039) 2023-06-27 11:00:24 +02:00
dylant-da
6058070637
Remove daml visualize / damlc visual (#16901)
* Remove daml visualize / damlc visual

* fix redundant imports

* remove visual-web subtest
2023-05-30 10:50:36 +01:00
dylant-da
6771135dd7
Automatically run scenarios in Studio with "Autorun All Tests" setting for Daml Extension (#16398)
* Add `daml ide` flag --studio-auto-run-all-scenarios to automatically run scenarios in studio

* Control via dedicated Daml extension settings attribute, `Autorun All Tests`
2023-03-01 09:38:01 +00:00
dylant-da
adb01a7b68
Table and transaction view in daml test (#16353)
* Initial outputTables work

* refactor outputTables

* Fix duplicate ShowCoverage opt

* Export TableOutputPath & TransactionsOutputPath constructors

* Implement outputTransactions

* Fix redundant imports, unused fields

* Embed extension's CSS style into generated tables / traces

* lint

* Extract webview css without locateResource

* Check stylesheet exists before reading it, emit warning if necessary

* Refactor tryWithPath
2023-02-22 17:56:50 +00:00
dylant-da
a90865d370
Show time elapsed on running scenarios in IDE (#16324)
* PoC: Add live script runner with intermediate live messages

* Unify live and non-live scenario service script runners

* Add live scenarios

* Clean up runLiveScenario

* dedupe runLiveScenario/runLiveScript

* return to onComplete mode

* Send status update every second

* Send progress events with milliseconds passed instead

* Fix runLiveScript -> runLiveScenario

* Show milliseconds passed in scenarios

* Sleep a random amount 300;600 ms

* Try to prevent older status updates from overwriting newer ones

* lint

* wrap errors appropriately

* Remove wrong secondary webview update

* Define variants inside companion object

* use abstract class instead of trait

* lint
2023-02-20 17:19:42 +00:00
dylant-da
c7ae5f1c93
Allow run tests manually (#16211)
* Add rules for running single scenarios, redefine RunScenario using them

* Turn runScenario into an action, not IO

* Add FormattingStarted custom message type

* Redefine OfInterest rule in terms of RunSingleScript

* lint

* fix broken renamed var

* Use getFilesOfInterest for diagnostics & uncompilable check

* explicitly run tests that need to be run

* Amend test

* Remove commented out code

* Remove vr formatting message
2023-02-02 17:59:11 +00:00
Gary Verhaegen
151e12b81a
bump copyright (#16002)
This is the result of:

- Updating `./COPY` to say `2023`.
- Running `./dev-env/bin/dade-copyright-headers update .`
2023-01-04 18:21:15 +01:00
Stephen Compall
1ac4199538
update qs, express for security (#15874)
- fixes for CVE-2022-24999

* upgrade qs, express in root

* upgrade qs in daml-extension

* upgrade qs, express in navigator
2022-12-12 15:52:19 -05:00
Stephen Compall
c24c17d595
Javascript library security updates (#15798)
Incorporates fixes for

- CVE-2022-3517
- CVE-2022-37599
- CVE-2022-37601

* update minimatch in root
* update minimatch in daml-extension
* update minimatch in typescript libraries
* update minimatch and loader-utils in navigator
2022-12-05 12:40:46 -05:00
fayi-da
69f11311df
npm resolutions for daml extension (#15203)
* npm resolutions for daml extension

* Remove unnecessary dependencies

* No changelog

CHANGELOG_BEGIN
CHANGELOG_END
2022-10-11 11:42:36 +00:00
Moisés Ackerman
0d364f5547
update interface keywords in daml studio syntax file (#14759)
changelog_begin
changelog_end
2022-08-19 11:02:15 +02:00
Moisés Ackerman
9fb7f11316
Replace more instances of 'scenario' with 'script' (#13651)
* Replace more instances of 'scenario' with 'script'

changelog_begin
* Remove Daml Studio 'scenario' snippet
* Add Daml Studio 'script' snippet
* Update documentation for 'daml test' command
changelog_end

* remove 'test' snippet

changelog_begin
* Remove Daml Studio 'test' snippet
changelog_end
2022-04-27 17:49:32 +02:00
Stefano Baghino
50fd93c250
Address remaining issues about CVE-2021-44906 (#13382)
Addresses https://github.com/digital-asset/daml/security/dependabot/28
Addresses https://github.com/digital-asset/daml/security/dependabot/24

changelog_begin
changelog_end
2022-03-23 11:06:31 +00:00
Moritz Kiefer
a8057a5741
Handle absence of table view in Daml Studio (#13245)
We encounter that when there are no transactions which can happen
legitimately if you’re testing pure functions.

fixes #11244

changelog_begin

- [Daml Studio] Fix an issue where script views failed to display if
  there were no transactions. Now you can see trace messages even in
  those cases.

changelog_end
2022-03-10 11:56:06 +01:00
Gary Verhaegen
961ca80b77
hunt down DAML (#13191)
Process:

- `git ls-files | xargs sed -i 's/DAML/Daml/g'`
- `git add -p`

To review:

- Check for false positives by carefully reviewing the diff in this PR.
- Check for false negatives with `git grep DAML`.

CHANGELOG_BEGIN
- Removed all traces of DAML. This may affect error messages and debug
  outputs.
CHANGELOG_END
2022-03-08 14:25:25 +01:00
Victor Peter Rouven Müller
c0c40bd10f
Add autoformatting to ts bindings & navigator frontend (#12693)
* Add autoformatting for the ts&tsx files (typescript effectively)

changelog_begin
changelog_end

* Format ts files

* Fix ts linter warnings
2022-02-11 11:44:52 +00:00
Stefano Baghino
20836b1622
Address CVE-2022-0355 alert, resolve simple-get to 4.0.1 (#12655)
changelog_begin
changelog_end
2022-01-30 23:17:04 +01:00
Moritz Kiefer
4038d0a7e3
Fix VSCode extension (#12611)
The upgrade to node-fetch 3.x broke our vscode extension because it
can only be loaded from proper ES modules. I tried changing our
tsconfig to emit that but I couldn’t figure out how to make vscode be
happy with an es module extension. So in the end I gave up and stuck
with commonjs and downgraded to node-fetch 2.x which is still in
maintenance mode and gets bugfixes for now.

However that resulted in me finding a bunch of other issues: The
upgrade to new LSP versions resulted in our LSP server crashing on
messages sent by the vscode extension. So I had to upgrade the client
libraries as well to fix that which required upgrading typescript
as well as @types/vscode which forces a bump of the minimum vscode
version. 1.52.0 is from November 2020 so not that concerned but I’ll
let product know in case theyre worried.

With this change things now work correctly and the extension is
backwards compatible with SDK 1.18.0 which matches our usual approach
of trying to get users to install the latest version of the extension.

changelog_begin

- [Daml Studio] The minimum supported vscode version is now 1.52.0.

changelog_end
2022-01-27 08:48:36 +01:00
Moritz Kiefer
24b2325d19
Bump node-fetch to address dependabot alerts (#12553)
changelog_begin
changelog_end
2022-01-24 13:23:52 +00:00
Moritz Kiefer
bf39f4890c
Upgrade vsce and markdown-it (#12431)
This upgrades vsce to the latest version and also markdown-it which is
unfortunately still pinned to an older version with a vulnerability.

There are some minor changes required to our invocations of vsce. I
tried to test this locally up to the point where it fails due to me
not having a token. We’ll only fully see it working after the next
stable release unfortunately.

changelog_begin
changelog_end
2022-01-17 13:40:42 +00:00
Gary Verhaegen
d2e2c21684
update copyright headers (#12240)
New year, new copyright, new expected unknown issues with various files
that won't be covered by the script and/or will be but shouldn't change.

I'll do the details on Jan 1, but would appreciate this being
preapproved so I can actually get it merged by then.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-03 16:36:51 +00:00
Moritz Kiefer
506eee16f5
Extend VSCode extension troubleshooting section (#12154)
I’ve had to look this up for the second time today so documenting it
seems very sensible.

changelog_begin
changelog_end
2021-12-15 13:56:30 +00:00
Sofia Faro
798137964b
Add requires keyword for syntax highlighting (#12113)
Part of #11978

changelog_begin
changelog_end
2021-12-14 12:20:41 +00:00
Moisés Ackerman
0b79d8ae7c
Deprecate 'controller ... can' syntax (#11363)
Closes #11317

* Add warning for uses of 'controller ... can' syntax

* Remove uses of 'controller ... can' syntax

* Add test cases for -W{,no-}controller-can

* Update docs to reflect 'controller ... can' syntax deprecation

changelog_begin
* Deprecate 'controller ... can' syntax.
  * It will be removed in a future version of Daml.
  * Instead, use 'choice ... with ... controller' syntax. Note that this does not implictly add the controller as an observer, so it must be added explictly as one (or as a signatory).
changelog_end
2021-12-01 13:36:04 +01:00
Moritz Kiefer
b7daa5f7d8
Address remaining dependabot alerts (#11045)
* Address remaining dependabot alerts

changelog_begin
changelog_end

* downgrade string-width

5.0.0 is too new for our setup

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2021-09-28 11:12:14 +02:00
Sofia Faro
3f4dbf6f8e
interfaces: Syntax highlighting for interfaces (#10987)
* interfaces: Syntax highlighting for 'interface'

To make daml studio look pretty.

changelog_begin
changelog_end

* Add 'implements' as well
2021-09-22 16:40:14 +00:00
Robin Krom
1affbd23d2
feature: persist script view config in worspace (#10521)
* feature: persist script view config in worspace

This fixes #9188. We remember the config for the script view in the
workspace state. This way script results can be closed and reopened with
the same view config. This also works across restarts of Daml studio.

CHANGELOG_BEGIN
[Daml studio] The script view configuration is remembered for each
script in a workspace and does not need to be reconfigured upon
closing/reopening or restarting of Daml studio.
CHANGELOG_END

* removal of unused imports
2021-08-09 18:24:14 +02:00
Robin Krom
e5514bc863
feature: remember checkboxes in script view (#10469)
* feature: remember checkboxes in script view

Fixes #9177. This makes the script view remember the choices for
'show_archive', 'show detailed disclosure' and 'table/transaction' view
accross changes to the script.

CHANGELOG_BEGIN
[daml studio] The script view now remembers checkboxes for detailed
disclosure view and archived contracts across script changes.
CHANGELOG_END

* factor out hide/show class code

* more factoring
2021-08-04 16:12:39 +02:00
Victor Peter Rouven Müller
d1aa256d0d
Force css-what resolution in compiler/daml-extension & fully regenera… (#10025)
* Force css-what resolution in compiler/daml-extension & fully regenerate the lock file

changelog_begin
changelog_end

* Don't force resolution as it's unecessary
2021-06-16 10:27:48 +00:00
Moritz Kiefer
89e46bf90b
Address security vulnerabilities in //compiler/daml-extension (#9615)
changelog_begin
changelog_end
2021-05-07 14:54:54 +02:00
Sofia Faro
14b062ce40
Syntax highlighting for exceptions. (#9318)
* Syntax highlighting for exceptions.

* Add `exception`, `try`, and `catch` as keywords.
* Add `throw` as function name.

changelog_begin
changelog_end

* Updated wrong language definition.

* Add 'message'
2021-04-06 09:45:12 +01:00
Bernhard Elsner
cda93db944
Daml case and logo (#8433)
* Replace many occurrences of DAML with Daml

* Update docs logo

* A few more CLI occurrences

CHANGELOG_BEGIN
- Change DAML capitalization and docs logo
CHANGELOG_END

* Fix some over-eager replacements

* A few mor occurrences in md files

* Address comments in *.proto files

* Change case in comments and strings in .ts files

* Revert changes to frozen proto files

* Also revert LF 1.11

* Update get-daml.sh

* Update windows installer

* Include .py files

* Include comments in .daml files

* More instances in the assistant CLI

* some more help texts
2021-01-08 12:50:15 +00:00
Gary Verhaegen
a925f0174c
update copyright notices for 2021 (#8257)
* update copyright notices for 2021

To be merged on 2021-01-01.

CHANGELOG_BEGIN
CHANGELOG_END

* patch-bazel-windows & da-ghc-lib
2021-01-01 19:49:51 +01:00
Gary Verhaegen
93f449d245
rename master to main (#8245)
As we strive for more inclusiveness, we are becoming less comfortable
with historically-charged terms being used in our everyday work.

This is targeted for merge on Dec 26, _after_ the necessary
corresponding changes at both the GitHub and Azure Pipelines levels.

CHANGELOG_BEGIN

- DAML Connect development is now conducted from the `main` branch,
  rather than the `master` one. If you had any dependency on the
  digital-asset/daml repository, you will need to update this parameter.

CHANGELOG_END
2020-12-27 14:19:07 +01:00
Moritz Kiefer
566d3a21d1
Remove version header from vscode snippet (#7452)
changelog_begin
changelog_end
2020-09-21 16:59:47 +02:00
dependabot[bot]
166c799618
Bump node-fetch from 2.6.0 to 2.6.1 in /compiler/daml-extension (#7389)
Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1.
- [Release notes](https://github.com/bitinn/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1)

changelog_begin
changelog_end

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-14 11:44:15 +00:00
Andreas Herrmann
15395b31a2
Document non-reproducible outputs (#7115)
* Explain why vsix is non-reproducible

* Explain why frontend bundle is non-reproducible

changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-08-13 09:19:46 +00:00
Andreas Herrmann
cf24597e70
Factor out reproducibility flags for tar and gzip (#6884)
* Factor out tar/gzip reproducibility flags

* use mktgz in package-app

* Bazel managed tar/gzip

* Remove quiet = True

As stated in the comment this is no longer required with Bazel >= 3.0.

* Build package-app as a sh_binary

This way Bazel will manage the runtime dependencies tar, gzip, mktgz,
and patchelf.

package-app.sh changes directory so it needs to make sure that all paths
are absolute and that the runfiles tree/manifest location is forwarded
to programs called by package-app.sh.

* Avoid file path too long errors

* Fix readlink -f on MacOS

* Document abspath

changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-08-05 14:27:14 +00:00
Moritz Kiefer
5668576b78
Upgrade rules-nodejs to the latest release (#6870)
changelog_begin
changelog_end
2020-07-27 16:50:23 +00:00
Moritz Kiefer
589c240d39
Fix syntax-highlighting of type signatures (#6792)
fixes #6791

This is based on
https://github.com/JustusAdam/language-haskell/blob/master/syntaxes/haskell.YAML-tmLanguage#L1326.

It roughly boils down to the following:

1. Negative look-behind to check that this is not part of something
   else.

2. Match on \\,<-|= (I’ve left out the unicode characters, I don’t want
   to encourage their use in DAML and I’ve also left out ArrowSyntax).

3. Check that the next character doesn’t make this something that is
   part of something else.

As for tests, I’ll refer to https://twitter.com/hillelogram/status/1284189687628824576

changelog_begin
changelog_end
2020-07-20 16:08:23 +02:00
dependabot[bot]
68f46db36e
Bump lodash from 4.17.15 to 4.17.19 in /compiler/daml-extension (#6778)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>

changelog_begin
changelog_end

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-17 19:16:20 +00:00
Samir Talwar
28873913d9
Bazel: Upgrade Buildifier. (#6625)
Buildifier now comes with a handy attachment to catch single `\`
characters inside strings and replace them with `\\` if the escape
sequence is invalid. Skylark/Python will do this at runtime anyway; this
just makes it clearer what the actual behavior is.

I needed to change `\` characters at the end of lines to `\\` manually
in order to stop Buildifier from simply concatenating the lines
together. Everything else was automatic.

CHANGELOG_BEGIN
CHANGELOG_END
2020-07-06 16:07:47 +00:00
Gary Verhaegen
2cbd4989f2
hide detailed disclosure information by default (#6587)
As requested by @shaul-da, this PR hides the information added by
@hurryabit in #6571 behind a checkbox, and reverts to plain "X"s by
default (checkbox unchecked).

CHANGELOG_BEGIN
- [DAML Studio] The new S/O/W/D information is hidden behind a top-level
  checkbox (next to Show archived). When that checkbox is not checked
  (which is the default), we display X's as before.
CHANGELOG_END
2020-07-03 12:16:34 +02:00
Martin Huschenbett
c4cd51389e
Display why a party knows about a contract in table view (#6475)
* Display why a party knows about a contract in table view

When displaying scenario results in table view in DAML Studio, we now
indicate _why_ a party knows about the existence of a contract:
- `S` means the party is a signatory.
- `O` means the party is an observer.
- `D` means the party has learned about the contract via disclosure or
  divulgence.

With the information we get from the scenario service there is no
straightforward way of distinguishing between disclosed (you
witnessed the `create`) and divulged (you witnessed a `fetch`)
contracts. Fortunately, both words start with a "D" and we're fine. :)

This addresses the first point of
https://github.com/digital-asset/daml/issues/6412 for the table view.

CHANGELOG_BEGIN
* [DAML Studio]
  When displaying scenario results in table view in DAML Studio, we now
  indicate _why_ a party knows about the existence of a contract:
  - `S` means the party is a signatory.
  - `O` means the party is an observer.
  - `D` means the party has learned about the contract via disclosure or
    divulgence.
CHANGELOG_END

* Add tooltips

CHANGELOG_BEGIN
CHANGELOG_END

* Add test

CHANGELOG_BEGIN
CHANGELOG_END

* Remove tooltip for invisible contracts

CHANGELOG_BEGIN
CHANGELOG_END

* Move parties to then end

CHANGELOG_BEGIN
CHANGELOG_END
2020-06-24 14:55:26 +00:00
Moritz Kiefer
816d99f151
Fix vscode extension (#6379)
The upgrade to various nodejs libraries in
b03cf7b598
seems to have gotten in an inconsistent state (what even are version
boundaries). This PR updates vscode-languageclient to the latest
version which fixes the issue. Apparently that requires a newer
version of @types/vsode as well (even 6.0.x requires that) so I had to
bump that and the engine. This does mean that we now require vscode
1.39.0. Given that this version was released in September 2019 that
seems very reasonable.

changelog_begin

- [DAML Studio] DAML Studio now requires VSCode 1.39 or newer.

changelog_end
2020-06-17 13:17:48 +00:00
Brian Healey
b03cf7b598
update various yarn lock and package json files to resolve security vulnerabilities (#6319)
* update various lock files

CHANGELOG_BEGIN
CHANGELOG_END

Signed-off-by: Brian Healey <brian.healey@digitalasset.com>

* further version upticks from yarn upgrade
2020-06-12 11:35:37 -04:00
Moritz Kiefer
884d4d8fc4
Simplify exercise snippet (#6232)
This is just not general enough to be useful. In particular, it
completely falls apart for somethin like submit x (exercise …) in
scenarios.

changelog_begin
changelog_end
2020-06-04 22:17:10 +02:00
Moritz Kiefer
c94f7e16bd
Remove deprecated vscode-resource scheme (#6008)
fixes #6005

Take a look at #6005 for details. I verified manually that things
still work as expected. It does require bumping the vscode version to
1.38 which was released almost a year ago so hopefully that should be
safe.

changelog_begin
changelog_end
2020-05-18 18:28:17 +02:00
Moritz Kiefer
7c031f25f7
Upgrade rules_nodejs to version 1.6.0 (#5539)
* Upgrade rules_nodejs to version 1.6.0

closes #5367

This includes the fixes for the issues in jest that we’ve been seeing.

changelog_begin
changelog_end

* Fix eslint rules

* A bit of progress

* Try to add LinkablePackageInfo (doesn’t seem to work yet)

* Add rootDirs

* revert da_ts_library

* da_ts_library: add LinkablePackageInfo info

* Remove react hook workaround

Since rules_nodejs 1.6.0 this fails with the following error:
```
  ● Test suite failed to run

    Configuration error:

    Could not locate module react mapped as:
    /.../execroot/com_github_digital_asset_daml/bazel-out/k8-opt/bin/language-support/ts/daml-react/test.sh.runfiles/com_github_digital_asset_daml/node_modules/react/umd/react.development.js.

    Please check your configuration for these entries:
    {
      "moduleNameMapper": {
        "/^react$/": "/.../execroot/com_github_digital_asset_daml/bazel-out/k8-opt/bin/language-support/ts/daml-react/test.sh.runfiles/com_github_digital_asset_daml/node_modules/react/umd/react.development.js"
      },
      "resolver": null
    }

      49 | // like a promis without being one.
      50 | /* eslint-disable @typescript-eslint/no-floating-promises */
    > 51 | var react_1 = __importStar(require("react"));
         |                            ^
      52 | var react_hooks_1 = require("@testing-library/react-hooks");
      53 | var index_1 = __importStar(require("./index"));
      54 | var events_1 = require("events");

      at createNoMappedModuleFoundError (../../../../../../../../../../../node_modules/jest-resolve/build/index.js:501:17)
      at Object.<anonymous> (index.test.js:51:28)

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        1.88s
Ran all test suites within paths "language-support/ts/daml-react/DamlLedger.d.ts", "language-support/ts/daml-react/DamlLedger.js", "language-support/ts/daml-react/context.d.ts", "language-support/ts/daml-react/context.js", "language-support/ts/daml-react/hooks.d.ts", "language-support/ts/daml-react/hooks.js", "language-support/ts/daml-react/index.d.ts", "language-support/ts/daml-react/index.js", "language-support/ts/daml-react/index.test.d.ts", "language-support/ts/daml-react/index.test.js".
=
```

* rootDirs is not needed for tsc

This is only required for ts_project

* Update yarn Bazel packages

* docs/theme add missing dependencies

* Remove unused attribute module_root

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-04-17 12:03:33 +00:00