Skip to content

Commit

Permalink
docs: Use 'latest' for package versions
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeckem committed Jun 28, 2024
1 parent 6023177 commit c409926
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docs/tutorials/HowToCreateAPackage.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ In order to use the new package, it must be declared as a dependency in your app
"name": "empty",
"private": true,
"peerDependencies": {
"@open-pioneer/runtime": "^1.0.0",
"@open-pioneer/chakra-integration": "^1.0.0",
"@open-pioneer/runtime": "latest",
"@open-pioneer/chakra-integration": "latest",
// Add this line:
"hello-world": "workspace:*"
}
Expand Down
14 changes: 7 additions & 7 deletions docs/tutorials/HowToCreateAService.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ The test-utils package contains helpers for testing service classes:
"name": "math",
"private": true,
"devDependencies": {
"@open-pioneer/test-utils": "^1.0.0"
"@open-pioneer/test-utils": "latest"
}
}
```
Expand Down Expand Up @@ -139,8 +139,8 @@ First, add the package `math` in the app's `package.json`:
"name": "empty",
"private": true,
"peerDependencies": {
"@open-pioneer/runtime": "^1.0.0",
"@open-pioneer/chakra-integration": "^1.0.0",
"@open-pioneer/runtime": "latest",
"@open-pioneer/chakra-integration": "latest",
"math": "workspace:^"
}
}
Expand Down Expand Up @@ -244,7 +244,7 @@ Because we do not intend to export any classes, functions or constants, we'll ju
"private": true,
"main": "api.ts",
"devDependencies": {
"@open-pioneer/test-utils": "^1.0.0"
"@open-pioneer/test-utils": "latest"
}
}
```
Expand Down Expand Up @@ -469,9 +469,9 @@ We want to use its logger implementation:
"name": "empty",
"private": true,
"peerDependencies": {
"@open-pioneer/chakra-integration": "^1.0.0",
"@open-pioneer/core": "^1.0.0",
"@open-pioneer/runtime": "^1.0.0",
"@open-pioneer/chakra-integration": "latest",
"@open-pioneer/core": "latest",
"@open-pioneer/runtime": "latest",
"math": "workspace:^"
}
}
Expand Down
6 changes: 5 additions & 1 deletion docs/tutorials/HowToCreateAnApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ Create a very simple [`package.json`](https://docs.npmjs.com/cli/v9/configuring-
"name": "my-app",
"private": true,
"dependencies": {
"@open-pioneer/runtime": "^1.0.0"
"@open-pioneer/runtime": "latest"
}
}
```

> NOTE
> Dependencies in the preceding example snippet (and some other snippets in this documentation) use the version specifier `latest` to avoid being immediately outdated.
> You should pick a recent version with the help of your IDE or the index at [npmjs.com](https://www.npmjs.com/), for example `"@open-pioneer/some-package": "^1.2.3"`.
A `package.json` file should always contain at least a `name`, usually some `dependencies` and either `private: true` or a valid license (in case you intend to publish it).
After creating a new package or modifying the dependencies of an existing package, you should run `pnpm install`:

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/HowToProvideAnAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { ApiExtension } from "@open-pioneer/integration";
export class LogApiExtension implements ApiExtension {}
```

Make sure to additionally add the `"@open-pioneer/integration": "^1.0.0"` dependency in the package.json, then run `pnpm install`.
Make sure to additionally add the `"@open-pioneer/integration"` dependency in the package.json, then run `pnpm install`.

Now you should see an error similar to "Property 'getApiMethods' is missing" on the class.
This is because the interface requires that a function `getApiMethods` must exist.
Expand Down
3 changes: 2 additions & 1 deletion docs/tutorials/HowToPublishAPackage.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ We have also been told to configure `publishConfig.directory`:
"build": "build-pioneer-package"
},
+ "peerDependencies": {
+ "@open-pioneer/core": "^1.0.0"
+ "@open-pioneer/core": "<omitted from example>"
+ },
+ "publishConfig": {
+ "directory": "dist",
Expand All @@ -396,6 +396,7 @@ We have also been told to configure `publishConfig.directory`:
```

Because the core package is a Trails package, we have added it as a `peerDependency` (see [Best Practices](../BestPractices.md#dependency-management)).

We also added `linkDirectory: false`, see [Publishing](#publishing).

#### Adding required files
Expand Down

0 comments on commit c409926

Please sign in to comment.