Commit Graph

42 Commits

Author SHA1 Message Date
Rohan Jacob-Rao
12c98a5c12
create-daml-app test: Move back to daml start (#5637)
Previously we changed to running the sandbox and JSON API separately to
have more control over port allocation. Now the same behaviour is
possible using `daml start`, which is preferable because it's what we
suggest users of the Getting Started Guide should use. This change
returns to using `daml start` in the end-to-end test. We use the default ports
for the sandbox and JSON API as we do in the guide.

changelog_begin
changelog_end
2020-04-20 16:30:51 -04:00
Rohan Jacob-Rao
631b5ddcd0
create-daml-app-test: Run sandbox and JSON API server separately and wait on port files (#5615)
changelog_begin
changelog_end

* Be a bit more generous with the login/logout test timeout
* Use fsPromises.stat and remove port files before starting to be safe
2020-04-18 18:54:53 -04:00
Rohan Jacob-Rao
37ca4af529
create-daml-app: Add end-to-end tests to integration tests (#5540)
This PR gets yarn test running the Puppeteer end-to-end tests in the GSG integration test.

The first step of the test is adding the extra dependencies (Jest, Puppeteer and more). The GSG recommends a yarn add command, but this does not work against HEAD. This is because yarn add does not use resolutions in the parent package.json, and then complains about unknown versions 0.0.0 of the daml TS libaries. The solution here is to hack in the extra dependencies into the ui/package.json and then yarn install. This works, but it hard codes version numbers which we would need to maintain. I would like to be able to say version "latest", which is what yarn add would install.

The next step of the test is to copy the index.test.ts file and run yarn test in CI mode.

I've moved the GSG test to a new create-daml-app-tests target. It's marked "exclusive" in Bazel until we figure out how to avoid hardcoding port numbers. This is a bit tricky since the HTTP port is hardcoded in a couple of places in ui/package.json.

Finally, this PR gets the GSG testing docs to reference the code in the new templates/create-daml-app-test-resources folder.

changelog_begin
changelog_end
2020-04-17 12:42:24 -04:00
Rohan Jacob-Rao
7fafe6a08a
GSG: test messaging feature and remove copied code snippets (#5507)
* Diff with messaging feature and some noise manually removed

* Bazel target to use patch file in other build targets

* Patch file as data dep for integration tests

* Attempt to patch and test messaging feature in create-daml-app test

changelog_begin
changelog_end

* Use exports_files instead of filegroup

* Remove file existence checks that don't make sense

* Add patch to dev_env and reference it from integration tests

* Include patch on windows for later

* Set up yarn env again after codegen

* Restore file check

* Fix typo in comment on util function

* Add Tasty steps to make process explicit

* Use messaging patch for code snippets in GSG

* Use messaging code from template instead of copy

* Remove copied message code

* Refactor script to copy template code with messaging patch

* No need to retry second yarn install (only local deps should be updated)
2020-04-11 19:53:44 +00:00
Moritz Kiefer
f050da78c9
Used daml codegen java instead of calling the codegen from maven (#5537)
* Used `daml codegen java` instead of calling the codegen from maven

This should hopefully fix the issues with mismatched versions of
slf4j.

changelog_begin
changelog_end

* Move config to daml.yaml

* Remove alternative invocation via maven from docs
2020-04-11 11:44:53 +00:00
Rohan Jacob-Rao
ce1d1de1a3
Ignore daml.js not daml-ts in create-daml-app template (#5533)
changelog_begin
changelog_end
2020-04-10 20:15:04 +00:00
Moritz Kiefer
8d56ed3a7e
Consistently avoid infix syntax in the GSG and reinstantiate dlint (#5483)
We avoided infix syntax here for `elem` but still used it for
`notElem` which doesn’t make much sense. Also we lost the config to
disable the lint when integrating the example in this repo. This
resulted in our own code producing a lint which is obviously a bad
idea.

side note: I think this lint does make sense once you
are familiar with the syntax and I feel slightly bad about disabling
more and more lints so for now I’m keeping it in the config.

changelog_begin
changelog_end
2020-04-08 09:40:50 +02:00
Gerolf Seitz
a2d785e3ee
Use com.daml as root package (#5343)
Packages com.digitalasset.daml and com.daml have been unified under com.daml

Ledger API and DAML-LF DEV protos have also been moved from `com/digitalasset`
to `com/daml` on the file system.
Protos for already released DAML LF versions (1.6, 1.7, 1.8) stay in the
package `com.digitalasset`.

CHANGELOG_BEGIN
[SDK] All Java and Scala packages starting with
``com.digitalasset.daml`` and ``com.digitalasset`` are now consolidated
under ``com.daml``. Simply changing imports should be enough to
migrate your code.
CHANGELOG_END
2020-04-05 19:49:57 +02:00
Rohan Jacob-Rao
0b63db4ac6
Make ledger id configurable in .env file (#5437)
This allows for easier deployment to non-sandbox ledgers.
Docs on deployment for create-daml-app are in the works.

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-04 16:24:14 -04:00
Martin Huschenbett
ccfb17c91b
Rename daml codegen ts to daml codegen js (#5409)
I've completely removed the possibility to call `daml codegen ts`. I'm
happy to add in back in a followup PR once I've seen that all our tests
pass without it existing.

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-03 14:54:46 +00:00
Martin Huschenbett
ba27ea9af4
create-daml-app: Import generated package without version (#5423)
Our plan for `daml2js` is to populate the `name` and `version` field
of the generated `package.json` files with the name and version of
the input DALF. Once this is done, you would expect to refer to the
package generated from `create-daml-app-0.1.0.dar` via
```typescript
import ... from '@daml.js/create-daml-app';`
```

Since we currently depend on the package by file paths anyway, we can
already pretend to have the right behavior in place.

In this style you can also depend on two different versions of the same
DAML package. This will happen during upgrades, a situation we're
already facing in DAVL. There it can be solved via the following two
lines in the `dependencies` field of the `package.json`:
```
  ...
  "davl-v4": "file:../daml.js/davl-0.0.4",
  "davl-v5": "file:../daml.js/davl-0.0.5",
  ...
```

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-03 15:58:16 +02:00
Martin Huschenbett
7cf5018c5b
Move puppeteer tests out of create-daml-app (#5420)
As expected, the `puppeteer` library used to demonstrate how to test
DAML apps end-to-end, causes issues in CI. It is not very unlikely
that users of the getting started guide would run into the same issues.
In addition, `puppeteer` is a _huge_ dependency, we should probably not
shove down everybody's throat who just wants to walk throught the GSG.

Thus, this PR moves everything related to testing out of
`create-daml-app` and exclusively into the docs. This is completly
lacking tests, but since it wasn't tested before either, I consider
this acceptable. My manual tests succeeded.

Since merging this might unblock quite a few other PRs, I defer test
into a followup PR.

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-03 14:59:18 +02:00
Martin Huschenbett
7431a96fc6
Getting Started Guide: Generate JS into daml.js (#5390)
Change the output directory given to `daml codegen ts` from `daml-ts`
to `daml.js`. This is naming is in line with the fact that `daml2ts`
puts all generated packages into the `@daml.js` scope. A renaming of
`daml2ts` into `daml2js` is immiment.

This PR also changes a few small documentation issues the
search-and-replace has surfaced.

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-02 21:02:27 +00:00
Rohan Jacob-Rao
0f5d93e0c3
Include create-daml-app as a template project for daml new (#5259)
* Initial commit with create-daml-app master

* Include create-daml-app in build rule

* Make daml.yaml a template in version and project name

* Remove git attributes

* Remove license and azure config

* Remove scripts

* Don't overwrite config files in build rule

* Template version numbers in package.json, to be replaced by the assistant

* Rename to package.json.template

changelog_begin
changelog_end

* Add copyright headers

* Do template substitutions in all .template files

And don't special case daml new create-daml-app (so it treats it as a
regular template).

* Add create-daml-app to integration tests

* Remove WIP warning

* Move towards setup that works on head

* Make local copies of the TS libs in the templates tarball

* Hardcode project name for now

* Use isExtensionOf

* Remove service worker

* remove robots.txt (don't even know what it is)

* Revert "Make local copies of the TS libs in the templates tarball"

This reverts commit 1289581fb4a82af3ab534baf978a2c6ed895d538.

* Retemplatize TS lib versions. For head builds these will be installed using npm

* Remove daml/ledger from resolutions for daml-ts

* Comment about test secret

* Remove special create-daml-app assistant command and test that won't work anymore

* Remove redundant imports and export

* Remove old create-daml-app tests

* Remove yarn.lock

* Clean up integration test (just daml new and build atm)

* Add daml/ledger as a resolution for daml-ts

* Remove top level package.json

* Update daml.js version

* Use new import scheme for generated TS

* Update readme with new codegen and build steps

* Use start-navigator in daml.yaml

* Increase a couple of timeouts in tests (either sandbox or TS lib is a bit slower?)

* Update GSG intro with new build steps

* Remove daml2ts -p flag and --start-navigator flag from GSG instructions

* Don't use start-navigator flag in ui tests

* Temporary readme describing how to manually test the create-daml-app template

* Update code samples in app arch section of GSG

* Update code samples in testing doc

* Remove copied create-daml-app code

* Indent docs markers to be more subtle

* Update visible code in Messages (after) section

This needs to be kept up to date properly somehow.

* Update text to useLedger

* Restore code/ui-before copies until the Bazel magic is figured out

We need to make the template code a dependency in the Bazel rule as
otherwise we can't find the files in the docs build.

* Update create-daml-app/readme and make templates/readme more detailed

* Use jsx comments for docs markers so they don't show up in the app
2020-04-02 00:30:07 +00:00
Moritz Kiefer
5a71bdbc71
Remove exposed-modules from daml init and quickstart-java template (#5360)
This cause issues in combination with data-dependencies see #5330 and
we started warning if you don’t expose everything. This resulted in
quickstart-java producing a warning on every `daml build`.

changelog_begin
changelog_end
2020-04-01 20:39:02 +00:00
Andreas Herrmann
89a9f5c7d2
tarball reproducibility (#5258)
* integration-tests reproducibility

* package-app reproducibility

* Make remaining tar czf reproducible

* package-app

CHANGELOG_BEGIN
CHANGELOG_END

* Reproducibility of remaing tar invocation

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-03-31 10:09:52 +02:00
Moritz Kiefer
19496482f6
Replace damlpatterns tarballs by a proper template (#5273)
There is no reason why patterns should be a tarball and the current
tarballs are broken anyway. Why do we even have 2 …

changelog_begin
changelog_end
2020-03-30 12:35:22 +00:00
Gary Verhaegen
1872c668a5
replace DAML Authors with DA in copyright headers (#5228)
Change requested by Manoj.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-27 01:26:10 +01:00
Samir Talwar
cbeeb5aafc
sandbox: Fail to start if a time mode is not explicitly specified. (#5033)
* sandbox: Fail to start if a time mode is not explicitly specified.

CHANGELOG_BEGIN
- [Sandbox] Sandbox is switching from Static Time mode to Wall Clock
  Time mode as the default. To ensure that our users know about this,
  for one version, there will be no default time mode. Instead, users
  will have to explicitly select their preferred time mode by means of
  the `--static-time` or `--wall-clock-time` switches. In the next
  release, Wall Clock Time will become the default, and users who are
  happy with the defaults will no longer need to specify the time mode.
CHANGELOG_END

* daml-script|triggers: Specify time mode when testing against Sandbox.

* daml-assistant: Default the Sandbox to wall clock time.

CHANGELOG_BEGIN
- [DAML Assistant] Initializing a new DAML project adds a switch to
  ``daml.yaml`` to ensure Sandbox can continue to start with ``daml
  start``::

      sandbox-options:
        - --wall-clock-time
CHANGELOG_END

* docs: Update the DAML Script and Triggers docs to use Wall Clock time.

It's now what Sandbox will use by default when using `daml init`.

* docs: Change the Quickstart to run Sandbox in wall clock time.

This explains why the contract IDs may vary.

It also updates the manual release testing script to match.
2020-03-18 08:25:03 +00:00
Gerolf Seitz
2b76d1962c
Deprecate ledger initialization with scenarios (#4864)
* Deprecate ledger initialization with scenarios

CHANGELOG_BEGIN
[Sandbox] Initializing the sandbox with scenarios is now deprecated in
favor of using DAML Script. The scenario parameter will be removed in
the near future. A warning is logged on startup.

The DAML SDK templates and quickstart guide are using DAML Script.

See the DAML Script migration guide for more information:
https://docs.daml.com/daml-script/index.html#using-daml-script-for-ledger-initialization
CHANGELOG_END
2020-03-09 09:30:18 +01:00
mergify[bot]
cb1395e923
Remove damlc migrate (#4816)
* Remove damlc migrate

``damlc migrate`` hasn’t worked for quite a while and we emitted a
warning for months so given that we don’t have plans to make it work
again in the near future, I think it does more harm than good to keep
it around.

changelog_begin

- [DAML Compiler] After being deprecated for a while the ``damlc
  migrate`` command has now been removed. See
  https://docs.daml.com/upgrade/ for up to date documentation
  on model upgrades.

changelog_end

fixes #3704 (by removing the tests 😇)

* yeah the windows cache is once again broken \o/

* Revert "yeah the windows cache is once again broken \o/"

This reverts commit 38d7877aa4.
2020-03-04 20:36:48 +00:00
Shayne Fletcher
66dd112960
Remove pragma 'daml 1.2' (#4702)
changelog_begin
- The pragma 'daml 1.2' is now optional.
changelog_end
2020-02-26 13:17:45 -05:00
Gary Verhaegen
878429e3bf
update copyright notices to 2020 (#3939)
copyright update 2020

* update template
* run script: `dade-copyright-headers update .`
* update script
* manual adjustments
* exclude frozen proto files from further header checks (by adding NO_AUTO_COPYRIGHT files)
2020-01-02 21:21:13 +01:00
Moritz Kiefer
7deca903bb Add documentation for DAML script and bundle it in the SDK (#3527) 2019-11-19 17:19:57 +00:00
Robin Krom
6cf3a5276f
language: introduce data-imports (#3399)
* language: introduce data-imports

Right now the user experience for importing dalfs and dars from
different sdks is quiet confusing. This PR tries to solve this. We add
an additional field `data-imports` to daml.yaml. These imports can come
from different SDK's and we will generate interface files containing the
data types and their Template instances.

This also simplifies the migration command, as it now always imports the
respective packages as `data-imports`.
2019-11-08 16:32:30 +01:00
Moritz Kiefer
dbddead461
Add a first draft of documentation for DAML triggers (#3181)
* Add a first draft of documentation for DAML triggers

The API will still change in a bunch of ways but I’d rather get some
docs in place now and update them as we change things than not have
any docs at all.

* Fix path to daml.yaml

* s/bot/trigger/

* fix source code markers

* Fix tests

* Update docs/source/triggers/index.rst

Co-Authored-By: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
2019-10-15 16:50:43 +02:00
Leonid Shlyapnikov
c982478c6e Fixing quickstart-scala example and doc (#2901)
* Fixing quickstart-scala example

* Updating docs

* Adding Scala codegen config

* Minor cleanup

* Apply suggestions from code review

Applying doc changes, thanks @bame-da!

Co-Authored-By: Bernhard Elsner <40762178+bame-da@users.noreply.github.com>
2019-09-16 12:44:04 +00:00
Gary Verhaegen
194af9bcf8
add default dlint.yaml (#2720) 2019-09-11 21:09:53 +02:00
Robin Krom
7fca591df0
replace main file with a pointer to the source root (#2687)
* language: compile everything in the source directory

This removes the need to specify a 'main'. Instead we 'source' in
daml.yaml should point to the source root directory.
2019-08-29 13:42:33 +02:00
Gary Verhaegen
99ea93168d
update copyright notices (#2499) 2019-08-13 17:23:03 +01:00
Robin Krom
8dd80cf112
language: add a 'main' option to the migration command (#2229)
We add an additional argument "main" to the migrate command to put the
right main filepath into the project config.
2019-07-19 16:32:53 +02:00
nickchapman-da
c0d6ac2a24
minimal quick fix for quickstart template, and test! (#2224) 2019-07-19 08:57:21 +01:00
Gary Verhaegen
1a9195d719
set initial version in templates to 0.0.1 (#2192) 2019-07-17 19:15:52 +01:00
Gary Verhaegen
295c36ad2a
add gitignores to templates (#2159) 2019-07-16 14:59:08 +01:00
Fran
ce03f6a514
Remove navigator configs (#1859) 2019-06-25 12:32:03 +01:00
Bernhard Elsner
d88b8b471e
Daml intro (#1717)
* DAML Intro Sections 1 - 7

* Apply suggestions from code review

Co-Authored-By: Beth Aitman <bethaitman@users.noreply.github.com>

* Address Beth's comments

* Rebase and fix release notes

* Add suggestions for Haskell reading
2019-06-18 11:56:06 +02:00
Robin Krom
ca163d708e
language: feature: initial implementation of a 'migrate' command (#1707)
* language: feature: initial implementation of a 'migrate' command

We add a 'migrate' command to daml assistant that generates a project
that allows to migrate contract instances from package1 to package2.
This first version reads both package1 and package2 from source. As a
next step we read only the dalfs from package1, because it might have
been created with a different compiler.
2019-06-17 16:40:08 +02:00
Bernhard Elsner
2c8c00ca4d Remove exposed-modules from skeleton project (#1701)
This leads to build errors if `Main` is changed to something else and appears to confuse users.
2019-06-17 11:51:53 +00:00
A. F. Mota
0c621c0dbe Add ui-backend.conf to skeleton template. (#1104) 2019-05-13 13:29:54 +00:00
Leonid Shlyapnikov
0ca414f09c
quickstart-scala daml assistant template cleanup (#614) (#1007) 2019-05-08 11:18:22 -04:00
Leonid Shlyapnikov
6cc9e685e5 Add quickstart-scala template to DAML Assistant (#991)
* Add quickstart-scala template to DAML Assistant , #614

Removing the rule to create a quickstart-scala.tar.gz, it is not needed

* Return non-zero error code if failures detected, #614

* Reading project name from `daml.yaml`, #614

Removing Versions.scala.template
2019-05-08 06:57:15 +00:00
A. F. Mota
12e8baa93f Simplify daml new template release process and add a simpler default template. (#850)
* Skeleton template.

* Add quickstart-java template.

* Update release rule

* Add Main.daml in skeleton template.

* Change default template for daml new.

* Update templates/BUILD.bazel

* Fix bazel rule formatting.

* Update integration test to use quickstart-java template.
2019-05-03 08:17:15 +00:00