daml/templates
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
..
create-daml-app Make ledger id configurable in .env file (#5437) 2020-04-04 16:24:14 -04:00
quickstart-java Remove exposed-modules from daml init and quickstart-java template (#5360) 2020-04-01 20:39:02 +00:00
quickstart-scala Use com.daml as root package (#5343) 2020-04-05 19:49:57 +02:00
skeleton replace DAML Authors with DA in copyright headers (#5228) 2020-03-27 01:26:10 +01:00
BUILD.bazel Include create-daml-app as a template project for daml new (#5259) 2020-04-02 00:30:07 +00:00
default-dlint-yaml add default dlint.yaml (#2720) 2019-09-11 21:09:53 +02:00
default-gitignore add gitignores to templates (#2159) 2019-07-16 14:59:08 +01:00
README.txt Rename daml codegen ts to daml codegen js (#5409) 2020-04-03 14:54:46 +00:00

These are template projects for `daml new`.

Testing the create-daml-app template
====================================

While automated integration tests for the create-daml-app template are being built,
we have the following manual testing procedure.
Note that this is for testing against the head of the daml repo.
For testing against a released SDK, you can skip past the package.json step and use
`daml` instead of `daml-head` after installing the released version.


First, build the SDK from head using the `daml-sdk-head` command.
This gives an executable DAML assistant called `daml-head` in your path.

Next, instantiate the `create-daml-app` template as follows:

```
daml-head new create-daml-app
cd create-daml-app
```

Crucially, you'll need to add a package.json file at the root of the project for testing
(this is not required when using the released SDK).
It should look as follows, with the dummy paths here replaced by relative paths to locally
built TypeScript libraries.
(These need to be built from head using Bazel:
```
bazel build //language-support/ts/daml-types
bazel build //language-support/ts/daml-ledger
bazel build //language-support/ts/daml-react```)

package.json:
{
    "resolutions": {
        "@daml/types": "file:path/to/daml-types/npm_package",
        "@daml/ledger": "file:path/to/daml-ledger/npm_package",
        "@daml/react": "file:path/to/daml-react/npm_package"
    },
    "private": true,
    "workspaces": [
        "daml.js",
        "ui"
    ]
}

Now you can continue to build and run the project as described in create-daml-app/README.md,
using `daml-head` instead of `daml`.
Specifically, you should run the following in the root directory:
```
daml-head build
daml-head codegen js .daml/dist/create-daml-app-0.1.0.dar -o daml.js
daml-head start
```

Then in another terminal, navigate to `create-daml-app/ui/` and run:
```
yarn install
yarn start
```
And check that the app works.

Finally, terminate both the `daml start` and `yarn start` processes and run
`yarn test` from the `ui` directory. All tests should pass.