Skip to content

Commit

Permalink
Release 1.0.0 (#23)
Browse files Browse the repository at this point in the history
* Updates modules to 1.0.0
* Update README.md
* Add a launch URL to sample backend
* Updates to released dependencies
* Updates documentation
  • Loading branch information
JohanPetersson authored Nov 16, 2021
1 parent 044aa76 commit 2bf0610
Show file tree
Hide file tree
Showing 29 changed files with 89 additions and 83 deletions.
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at support@episerver.com. All
reported by contacting the project team at support@optimizely.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Did you find a bug?

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

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

Expand Down
33 changes: 18 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@
[![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)


This repository contains the source code for the Content Delivery SDKs and samples.

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

## Content Definitions

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

## Content Delivery

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

## Samples

* [Vue.js](https://github.com/episerver/content-delivery-js-sdk/tree/master/samples/music-festival-vue-decoupled)

## Prerequisites for building and testing the SDKs

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

## Creating a release
## Create a release

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

## Contributing

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.
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.
13 changes: 8 additions & 5 deletions samples/music-festival-vue-decoupled/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Episerver Content Delivery - Decoupled
# Optimizely Content Delivery - Decoupled

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.
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.

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.

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

## Prerequisites

Expand All @@ -19,7 +19,10 @@ This project uses:
1. Run `setup.cmd`. You can re-run `setup.cmd` at any time to reset the backend with a fresh database.
2. Open terminal for `./backend` and run `dotnet run`.
* sign in with either `bob/bob` (admin) or `alice/alice` (editor).
3. Open terminal for `./frontend` and run `npm install` (only needed first run) and then `npm run serve`.
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.
* Open terminal for `../../src/@episerver/content-definitions` and run `npm install` (only needed first run).
* Open terminal for `../../src/@episerver/content-delivery` and run `npm install` (only needed first run).
4. Open terminal for `./frontend` and run `npm install` (only needed first run) and then `npm run serve`.

## Notable files

Expand All @@ -43,4 +46,4 @@ This project uses:

## Debugging Vuex state

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).
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).
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="EPiServer.CMS" Version="12.0.2" />
<PackageReference Include="EPiServer.ContentDefinitionsApi" Version="3.0.0-ci-002490" />
<PackageReference Include="EPiServer.ContentDeliveryApi.Cms" Version="3.0.0-ci-002490" />
<PackageReference Include="EPiServer.OpenIDConnect" Version="3.0.0-ci-002490" />
<PackageReference Include="EPiServer.CMS" Version="12.1.0" />
<PackageReference Include="EPiServer.Hosting" Version="12.1.0" />
<PackageReference Include="EPiServer.Framework" Version="12.1.0" />
<PackageReference Include="EPiServer.ContentDefinitionsApi" Version="3.0.0" />
<PackageReference Include="EPiServer.ContentDeliveryApi.Cms" Version="3.0.0" />
<PackageReference Include="EPiServer.OpenIDConnect" Version="3.0.0" />
</ItemGroup>

</Project>
21 changes: 8 additions & 13 deletions samples/music-festival-vue-decoupled/backend/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using EPiServer.Cms.UI.AspNetIdentity;
using EPiServer.ContentApi.Cms.Configuration;
using EPiServer.ContentApi.Core.Configuration;
using EPiServer.ContentApi.Cms;
using EPiServer.ContentApi.Core.DependencyInjection;
using EPiServer.ContentDefinitionsApi;
using EPiServer.Core;
using EPiServer.Data;
using EPiServer.DependencyInjection;
using EPiServer.OpenIDConnect;
using EPiServer.ServiceLocation;
using EPiServer.Web;
Expand Down Expand Up @@ -70,7 +69,7 @@ public void ConfigureServices(IServiceCollection services)
options.Applications.Add(new OpenIDConnectApplication
{
ClientId = "frontend",
Scopes = { "openid", "offline_access", "profile", "email", "roles", ContentDeliveryAuthorizationOptionsDefaults.Scope },
Scopes = { "openid", "offline_access", "profile", "email", "roles", ContentDeliveryApiOptionsDefaults.Scope },
PostLogoutRedirectUris = { _frontendUri },
RedirectUris =
{
Expand All @@ -87,14 +86,9 @@ public void ConfigureServices(IServiceCollection services)
});
});

services.AddContentDeliveryApi(OpenIDConnectOptionsDefaults.AuthenticationScheme, options =>
{
options.ExpandedBehavior = ExpandedLanguageBehavior.RequestedLanguage;
options.FlattenPropertyModel = true;
options.ForceAbsolute = true;
});

services.AddContentDefinitionsApi(OpenIDConnectOptionsDefaults.AuthenticationScheme);
services.AddContentDeliveryApi(OpenIDConnectOptionsDefaults.AuthenticationScheme);
services.ConfigureForContentDeliveryClient();

services.AddHostedService<ProvisionDatabase>();
}
Expand All @@ -109,10 +103,11 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
app.UseStaticFiles();
app.UseRouting();

// TODO: Enable CORS for all APIs with our own method
app.UseCors(b => b
.WithOrigins(new[] { "http://localhost:8080" })
.AllowAnyHeader()
.WithExposedContentDeliveryApiHeaders()
.WithExposedContentDefinitionApiHeaders()
.WithHeaders("Authorization")
.AllowAnyMethod()
.AllowCredentials());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"dotnetRunMessages": "true",
"launchBrowser": true,
"applicationUrl": "http://localhost:8081",
"launchUrl": "episerver/cms",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

By setting the `data-epi-block-id` attribute the block becomes editable
during On-Page Edit. It will not be set in View mode to not leak out too
much info about Episerver to visitors.
much info about Optimizely to visitors.

The model property is provided by the page or block that owns the
ContentArea.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default {
// There is an open feature-request for making 'router-link' support absolute links.
// https://github.com/vuejs/vue-router/issues/1280
//
// Always user an 'a' tag in edit mode to update the Episerver UI
// Always user an 'a' tag in edit mode to update the Optimizely UI

if (state.epiContext.inEditMode) {
return 'a';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
This should be used for links when they should be completely disabled when in
an Episerver CMS UI editing context. One example is language selection links,
an Optimizely CMS UI editing context. One example is language selection links,
because language selection should be done in the CMS UI instead.
-->

Expand Down
2 changes: 1 addition & 1 deletion samples/music-festival-vue-decoupled/frontend/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const app = createApp(App)
.use(store)
.use(router);

// Register all Episerver view components globally. This requires webpack!
// Register all Optimizely view components globally. This requires webpack!
// Otherwise we need to register all components manually here in main.js.
const requireComponent = require.context('./views', true, /.vue$/);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { createStore } from 'vuex';
import appContext from './modules/appContext'; // Module handling app specific state
import epiContext from './modules/epiContext'; // Module handling Episerver specific state
import epiContext from './modules/epiContext'; // Module handling Optimizely specific state
import epiDataModel from './modules/epiDataModel'; // Module handling model state

export default createStore({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
</template>

<script>
import _ from 'lodash';
import { mapState } from 'vuex';
import { ContentLoader } from '@episerver/content-delivery';
import BackButton from '@/components/widgets/BackButton.vue';
import Card from '@/components/widgets/Card.vue';
import LanguageSelector from '@/components/widgets/LanguageSelector.vue';
import _ from 'lodash';
import { mapState } from 'vuex';

export default {
props: ['model'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@
</template>

<script>
import { mapMutations } from 'vuex';
import ContentArea from '@/components/EpiContentArea.vue';
import EpiLink from '@/components/EpiLink.vue';
import Hero from '@/components/widgets/Hero.vue';
import LanguageSelector from '@/components/widgets/LanguageSelector.vue';
import Modal from '@/components/widgets/Modal.vue';
import BuyTicketBlock from '@/views/blocks/BuyTicketBlock.vue';
import { SHOW_MODAL } from '@/store/modules/appContext';
import { mapMutations } from 'vuex';

export default {
components: {
Expand Down
1 change: 0 additions & 1 deletion samples/music-festival-vue-decoupled/nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<configuration>
<packageSources>
<clear />
<add key="beta" value="https://pkgs.dev.azure.com/EpiserverEngineering/netCore/_packaging/beta-program/nuget/v3/index.json" />
<add key="optimizely.com" value="https://nuget.optimizely.com/feed/packages.svc/" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
Expand Down
4 changes: 2 additions & 2 deletions src/@episerver/content-definitions/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Episerver Content Delivery JavaScript SDK - Content Definitions
# Optimizely Content Delivery JavaScript SDK - Content Definitions

SDK and CLI for managing content definitions and modelling of data in an Episerver application running the [Content Definitions API](https://world.optimizely.com/documentation/developer-guides/content-definitions-api/).
SDK and CLI for managing content definitions and modelling of data in an Optimizely application running the [Content Definitions API](https://world.optimizely.com/documentation/developer-guides/content-definitions-api/).

Please visit [Optimizely World](https://world.optimizely.com/) for full documentation of the APIs.

Expand Down
4 changes: 2 additions & 2 deletions src/@episerver/content-definitions/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/@episerver/content-definitions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@episerver/content-definitions",
"version": "1.0.0-pre.1",
"version": "1.0.0",
"description": "CLI tool for managing content definitions manifest files.",
"author": "Johan Petersson <[email protected]>",
"license": "Apache-2.0",
Expand All @@ -10,7 +10,7 @@
"manifest",
"definitions"
],
"homepage": "https://www.episerver.com",
"homepage": "https://www.optimizely.com",
"repository": {
"type": "git",
"url": "git+https://github.com/episerver/content-delivery-js-sdk.git"
Expand Down
4 changes: 2 additions & 2 deletions src/@episerver/content-delivery/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Episerver Content Delivery JavaScript SDK - Content Loader, Content Resolver and Site Loader
# Optimizely Content Delivery JavaScript SDK - Content Loader, Content Resolver and Site Loader

SDK for loading and resolving content from an Episerver application running the [Content Delivery API](https://world.optimizely.com/documentation/developer-guides/content-delivery-api/). The SDK is written in TypeScript and includes types.
SDK for loading and resolving content from an Optimizely application running the [Content Delivery API](https://world.optimizely.com/documentation/developer-guides/content-delivery-api/). The SDK is written in TypeScript and includes types.

Please visit [Optimizely World](https://world.optimizely.com/) for full documentation of the APIs.

Expand Down
4 changes: 2 additions & 2 deletions src/@episerver/content-delivery/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/@episerver/content-delivery/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@episerver/content-delivery",
"version": "1.0.0-pre.1",
"version": "1.0.0",
"description": "SDK for the Episerver Content Delivery API.",
"author": "Johan Petersson <[email protected]>",
"license": "Apache-2.0",
Expand All @@ -12,7 +12,7 @@
"sdk",
"client"
],
"homepage": "https://www.episerver.com",
"homepage": "https://www.optimizely.com",
"repository": {
"type": "git",
"url": "git+https://github.com/episerver/content-delivery-js-sdk.git"
Expand Down
Loading

0 comments on commit 2bf0610

Please sign in to comment.