Skip to content

Commit 2bf0610

Browse files
Release 1.0.0 (#23)
* Updates modules to 1.0.0 * Update README.md * Add a launch URL to sample backend * Updates to released dependencies * Updates documentation
1 parent 044aa76 commit 2bf0610

29 files changed

+89
-83
lines changed

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
5555
## Enforcement
5656

5757
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58-
reported by contacting the project team at support@episerver.com. All
58+
reported by contacting the project team at support@optimizely.com. All
5959
complaints will be reviewed and investigated and will result in a response that
6060
is deemed necessary and appropriate to the circumstances. The project team is
6161
obligated to maintain confidentiality with regard to the reporter of an incident.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Did you find a bug?
44

5-
* Do not open up a GitHub issue if the bug is a security vulnerability, instead contact support@episerver.com.
5+
* Do not open up a GitHub issue if the bug is a security vulnerability, instead contact support@optimizely.com.
66

77
* Ensure the bug was not already reported by searching on GitHub under [Issues](https://github.com/episerver/content-delivery-js-sdk/issues).
88

README.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,21 @@
33
[![Npm publish](https://github.com/episerver/content-delivery-js-sdk/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/episerver/content-delivery-js-sdk/actions/workflows/npm-publish.yml) [![Continuous integration](https://github.com/episerver/content-delivery-js-sdk/actions/workflows/ci.yml/badge.svg)](https://github.com/episerver/content-delivery-js-sdk/actions/workflows/ci.yml)
44

55

6-
This repository contains the source code for the Content Delivery SDKs and samples.
7-
8-
> Note the SDK is in preview. Please provide feedback and report issues.
9-
10-
Visit [Optimizely World](https://world.optimizely.com/documentation/developer-guides/content-delivery-api/) for full documentation of the REST APIs.
6+
This repository contains the source code for the Content Delivery JavaScript SDKs and samples.
117

128
## Content Definitions
139

14-
[Source code and documentation](https://github.com/episerver/content-delivery-js-sdk/tree/master/src/%40episerver/content-definitions).
10+
* [Source code and documentation](https://github.com/episerver/content-delivery-js-sdk/tree/master/src/%40episerver/content-definitions)
11+
* [REST API documentation](https://world.optimizely.com/documentation/developer-guides/content-definitions-api/)
1512

1613
## Content Delivery
1714

18-
[Source code and documentation](https://github.com/episerver/content-delivery-js-sdk/tree/master/src/%40episerver/content-delivery).
15+
* [Source code and documentation](https://github.com/episerver/content-delivery-js-sdk/tree/master/src/%40episerver/content-delivery)
16+
* [REST API documentation](https://world.optimizely.com/documentation/developer-guides/content-delivery-api/)
17+
18+
## Samples
19+
20+
* [Vue.js](https://github.com/episerver/content-delivery-js-sdk/tree/master/samples/music-festival-vue-decoupled)
1921

2022
## Prerequisites for building and testing the SDKs
2123

@@ -25,15 +27,16 @@ This project uses:
2527
* .NET SDK 5+
2628
* SQL Server 2016 Express LocalDB ([download here](https://www.microsoft.com/en-us/sql-server/sql-server-downloads))
2729

28-
## Creating a release
30+
## Create a release
2931

30-
1. Update version in all SDK package.json files.
31-
2. Merge to master branch.
32-
3. Create new Github release based of master branch.
33-
4. Tag version with following format: v1.2.0.
34-
5. Give the release a title and write an optional description.
35-
6. Publish.
32+
1. Update the version in all modules with `npm version 1.2.3`.
33+
2. Run `npm install` in all samples to update their package-lock.json files.
34+
3. Commit, push, and create PR to `master` branch.
35+
4. Create new Github release based of `master` branch.
36+
5. Tag version with following format `v1.2.3`.
37+
6. Give the release a title and write an optional description.
38+
7. Publish.
3639

3740
## Contributing
3841

39-
The easiest way to contribute is to join in with the discussions on Github issues or create new issues with questions, suggestions or any other feedback. If you want to contribute code or documentation, you are more than welcome to create pull-requests, but make sure that you read the contribution page first.
42+
The easiest way to contribute is to join in with the discussions on Github issues or create new issues with questions, suggestions or any other feedback. If you want to contribute code or documentation, you are more than welcome to create pull-requests, but make sure that you read the contribution page first.

samples/music-festival-vue-decoupled/README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Episerver Content Delivery - Decoupled
1+
# Optimizely Content Delivery - Decoupled
22

3-
This sample site demonstrates one approach to render Episerver content in a client side framework that is using client side routing for navigation with a working On Page Edit (OPE) mode in the Episerver UI, where the frontend and backend are hosted separately.
3+
This sample site demonstrates one approach to render Optimizely content in a client side framework that is using client side routing for navigation with a working On Page Edit (OPE) mode in the Optimizely UI, where the frontend and backend are hosted separately.
44

55
This particular solution uses [Vue CLI](https://cli.vuejs.org/) with [Vuex](https://next.vuex.vuejs.org/) to handle the state of the app in a `single source of truth`. Most of the techniques are framework agnostic and can be used with any other framework, such as React or Angular.
66

7-
Content is fetched from Episerver using the Content Delivery API: https://world.optimizely.com/documentation/developer-guides/cms/content/content-delivery-api/
7+
Content is fetched from Optimizely using the Content Delivery API: https://world.optimizely.com/documentation/developer-guides/cms/content/content-delivery-api/
88

99
## Prerequisites
1010

@@ -19,7 +19,10 @@ This project uses:
1919
1. Run `setup.cmd`. You can re-run `setup.cmd` at any time to reset the backend with a fresh database.
2020
2. Open terminal for `./backend` and run `dotnet run`.
2121
* sign in with either `bob/bob` (admin) or `alice/alice` (editor).
22-
3. Open terminal for `./frontend` and run `npm install` (only needed first run) and then `npm run serve`.
22+
3. Since we reference two NPM modules locally, we need to install them first. Note that this is not needed if you install the modules from npmjs.com.
23+
* Open terminal for `../../src/@episerver/content-definitions` and run `npm install` (only needed first run).
24+
* Open terminal for `../../src/@episerver/content-delivery` and run `npm install` (only needed first run).
25+
4. Open terminal for `./frontend` and run `npm install` (only needed first run) and then `npm run serve`.
2326

2427
## Notable files
2528

@@ -43,4 +46,4 @@ This project uses:
4346

4447
## Debugging Vuex state
4548

46-
Using the [Vue-devtools](https://github.com/vuejs/vue-devtools) to see the state changes in the store in view mode works as expected. There are however some limitations to follow state changes when you are editing in Episerver edit mode because of the site is running inside an iframe. To be able to see the vuex state while editing you need to run the stand alone electron app as described on the github page: [Vue standalone Electron app](https://github.com/vuejs/vue-devtools/blob/master/shells/electron/README.md).
49+
Using the [Vue-devtools](https://github.com/vuejs/vue-devtools) to see the state changes in the store in view mode works as expected. There are however some limitations to follow state changes when you are editing in Optimizely edit mode because of the site is running inside an iframe. To be able to see the vuex state while editing you need to run the stand alone electron app as described on the github page: [Vue standalone Electron app](https://github.com/vuejs/vue-devtools/blob/master/shells/electron/README.md).

samples/music-festival-vue-decoupled/backend/MusicFestival.Backend.csproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="EPiServer.CMS" Version="12.0.2" />
10-
<PackageReference Include="EPiServer.ContentDefinitionsApi" Version="3.0.0-ci-002490" />
11-
<PackageReference Include="EPiServer.ContentDeliveryApi.Cms" Version="3.0.0-ci-002490" />
12-
<PackageReference Include="EPiServer.OpenIDConnect" Version="3.0.0-ci-002490" />
9+
<PackageReference Include="EPiServer.CMS" Version="12.1.0" />
10+
<PackageReference Include="EPiServer.Hosting" Version="12.1.0" />
11+
<PackageReference Include="EPiServer.Framework" Version="12.1.0" />
12+
<PackageReference Include="EPiServer.ContentDefinitionsApi" Version="3.0.0" />
13+
<PackageReference Include="EPiServer.ContentDeliveryApi.Cms" Version="3.0.0" />
14+
<PackageReference Include="EPiServer.OpenIDConnect" Version="3.0.0" />
1315
</ItemGroup>
1416

1517
</Project>

samples/music-festival-vue-decoupled/backend/Startup.cs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
using EPiServer.Cms.UI.AspNetIdentity;
2-
using EPiServer.ContentApi.Cms.Configuration;
3-
using EPiServer.ContentApi.Core.Configuration;
2+
using EPiServer.ContentApi.Cms;
3+
using EPiServer.ContentApi.Core.DependencyInjection;
44
using EPiServer.ContentDefinitionsApi;
55
using EPiServer.Core;
66
using EPiServer.Data;
7-
using EPiServer.DependencyInjection;
87
using EPiServer.OpenIDConnect;
98
using EPiServer.ServiceLocation;
109
using EPiServer.Web;
@@ -70,7 +69,7 @@ public void ConfigureServices(IServiceCollection services)
7069
options.Applications.Add(new OpenIDConnectApplication
7170
{
7271
ClientId = "frontend",
73-
Scopes = { "openid", "offline_access", "profile", "email", "roles", ContentDeliveryAuthorizationOptionsDefaults.Scope },
72+
Scopes = { "openid", "offline_access", "profile", "email", "roles", ContentDeliveryApiOptionsDefaults.Scope },
7473
PostLogoutRedirectUris = { _frontendUri },
7574
RedirectUris =
7675
{
@@ -87,14 +86,9 @@ public void ConfigureServices(IServiceCollection services)
8786
});
8887
});
8988

90-
services.AddContentDeliveryApi(OpenIDConnectOptionsDefaults.AuthenticationScheme, options =>
91-
{
92-
options.ExpandedBehavior = ExpandedLanguageBehavior.RequestedLanguage;
93-
options.FlattenPropertyModel = true;
94-
options.ForceAbsolute = true;
95-
});
96-
9789
services.AddContentDefinitionsApi(OpenIDConnectOptionsDefaults.AuthenticationScheme);
90+
services.AddContentDeliveryApi(OpenIDConnectOptionsDefaults.AuthenticationScheme);
91+
services.ConfigureForContentDeliveryClient();
9892

9993
services.AddHostedService<ProvisionDatabase>();
10094
}
@@ -109,10 +103,11 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
109103
app.UseStaticFiles();
110104
app.UseRouting();
111105

112-
// TODO: Enable CORS for all APIs with our own method
113106
app.UseCors(b => b
114107
.WithOrigins(new[] { "http://localhost:8080" })
115-
.AllowAnyHeader()
108+
.WithExposedContentDeliveryApiHeaders()
109+
.WithExposedContentDefinitionApiHeaders()
110+
.WithHeaders("Authorization")
116111
.AllowAnyMethod()
117112
.AllowCredentials());
118113

samples/music-festival-vue-decoupled/backend/properties/launchSettings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"dotnetRunMessages": "true",
66
"launchBrowser": true,
77
"applicationUrl": "http://localhost:8081",
8+
"launchUrl": "episerver/cms",
89
"environmentVariables": {
910
"ASPNETCORE_ENVIRONMENT": "Development"
1011
}

samples/music-festival-vue-decoupled/frontend/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/music-festival-vue-decoupled/frontend/src/components/EpiContentArea.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
By setting the `data-epi-block-id` attribute the block becomes editable
66
during On-Page Edit. It will not be set in View mode to not leak out too
7-
much info about Episerver to visitors.
7+
much info about Optimizely to visitors.
88
99
The model property is provided by the page or block that owns the
1010
ContentArea.

samples/music-festival-vue-decoupled/frontend/src/components/EpiLink.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default {
2929
// There is an open feature-request for making 'router-link' support absolute links.
3030
// https://github.com/vuejs/vue-router/issues/1280
3131
//
32-
// Always user an 'a' tag in edit mode to update the Episerver UI
32+
// Always user an 'a' tag in edit mode to update the Optimizely UI
3333
3434
if (state.epiContext.inEditMode) {
3535
return 'a';

0 commit comments

Comments
 (0)