Skip to content

Commit

Permalink
Merge branch 'bw/36771/apply-markdown-templates' of github.com:launch…
Browse files Browse the repository at this point in the history
…darkly/js-client-sdk-private
  • Loading branch information
bwoskow-ld committed May 4, 2019
2 parents 1b5f965 + d0d87ec commit 4732080
Show file tree
Hide file tree
Showing 116 changed files with 2,697 additions and 2,243 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ jobs:
# able to produce separate output files.
- run: mkdir -p reports/junit
- run:
command: cd ~/project/packages/ldclient-js-common && npm run test:junit
command: cd ~/project/packages/launchdarkly-js-sdk-common && npm run test:junit
environment:
JEST_JUNIT_OUTPUT: "./reports/junit/js-common-test-results.xml"
- run:
command: cd ~/project/packages/ldclient-js && npm run test:junit
command: cd ~/project/packages/launchdarkly-js-client-sdk && npm run test:junit
environment:
JEST_JUNIT_OUTPUT: "./reports/junit/js-test-results.xml"
- run:
command: cd ~/project/packages/ldclient-react && npm run test:junit
command: cd ~/project/packages/launchdarkly-react-client-sdk && npm run test:junit
environment:
JEST_JUNIT_OUTPUT: "./reports/junit/react-test-results.xml"

Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ Build instructions

Before building the code, it would be helpful to know a bit about the structure of the code in this repository. This repository is a monorepo containing three projects, each of which is published to npm as a package with the same name:

- `ldclient-js`: This is the main SDK package that applications will import. Any logic that specifically relies on being in a browser environment should go here (see `browserPlatform.js`). This automatically imports `ldclient-js-common`.
- `ldclient-js-common`: Internal implementation code that is not browser-specific.
- `ldclient-react`: The React wrapper. This automatically imports both of the other packages.
- `launchdarkly-js-client-sdk`: This is the main SDK package that applications will import. Any logic that specifically relies on being in a browser environment should go here (see `browserPlatform.js`). This automatically imports `launchdarkly-js-sdk-common`.
- `launchdarkly-js-sdk-common`: Internal implementation code that is not browser-specific.
- `launchdarkly-react-client-sdk`: The React wrapper. This automatically imports both of the other packages.

The reason `ldclient-js-common` exists is that the [Electron SDK](https://github.com/launchdarkly/electron-client) has very similar functionality to the browser SDK. Therefore, all of the code that is used by both has been factored out into the common package.
The reason `launchdarkly-js-sdk-common` exists is that the [Electron SDK](https://github.com/launchdarkly/electron-client) has very similar functionality to the browser SDK. Therefore, all of the code that is used by both has been factored out into the common package.

### Prerequisites

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## LaunchDarkly overview

[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves over 100 billion feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/docs/getting-started) using LaunchDarkly today!

[![Twitter Follow](https://img.shields.io/twitter/follow/launchdarkly.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/intent/follow?screen_name=launchdarkly)

## Getting started
Expand All @@ -18,7 +18,7 @@ Please note that the JavaScript SDK has two special requirements in terms of you

### ReactJS

The SDK does not require any particular JavaScript framework. However, if you are using [React](https://reactjs.org/), there is an add-on to simplify use of the SDK. See the [`ldclient-react` documentation](packages/ldclient-react/README.md).
The SDK does not require any particular JavaScript framework. However, if you are using [React](https://reactjs.org/), there is an add-on to simplify use of the SDK. See the [`launchdarkly-react-client-sdk` documentation](packages/launchdarkly-react-client-sdk/README.md).

## Browser compatibility

Expand Down
16 changes: 8 additions & 8 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

# The TypeDoc build for ldclient-js is more complicated than for ldclient-node because ldclient-js takes
# some of its types from ldclient-js-common. TypeDoc unfortunately does not understand the directive
# "export * from 'ldclient-js-common'" - so, by default, even though it does see the common types (like
# The TypeDoc build for launchdarkly-js-client-sdk is more complicated than for ldclient-node because launchdarkly-js-client-sdks takes
# some of its types from launchdarkly-js-sdk-common. TypeDoc unfortunately does not understand the directive
# "export * from 'launchdarkly-js-sdk-common'" - so, by default, even though it does see the common types (like
# LDUser), it will not include them in the output.
#
# The current solution is to run TypeDoc on a hacked-together file that puts all of the types directly
# into one package. The sed commands below create this temporary declaration file by taking the types file
# from ldclient-js and replacing the ldclient-js-common imports with the actual contents of the
# ldclient-js-common module. We then run TypeDoc from the docs directory, which contains its own
# from launchdarkly-js-client-sdk and replacing the launchdarkly-js-sdk-common imports with the actual contents of the
# launchdarkly-js-sdk-common module. We then run TypeDoc from the docs directory, which contains its own
# tsconfig.json that points to the temporarily file instead of the original files.
#

Expand All @@ -19,10 +19,10 @@ html: prepare
prepare:
rm -rf build
mkdir build
@# Extract the whole module declaration from ldclient-js-common, then remove the first and last lines
sed -n '/^declare module/,/^}/p' ../packages/ldclient-js-common/typings.d.ts | \
@# Extract the whole module declaration from launchdarkly-js-sdk-common, then remove the first and last lines
sed -n '/^declare module/,/^}/p' ../packages/launchdarkly-js-sdk-common/typings.d.ts | \
sed '1d;$$d' \
>build/common-excerpt
@# Replace the block from DOCBUILD-START-REPLACE to DOCBUILD-END-REPLACE with that excerpt
sed -e '/DOCBUILD-END-REPLACE/r build/common-excerpt' ../packages/ldclient-js/typings.d.ts | \
sed -e '/DOCBUILD-END-REPLACE/r build/common-excerpt' ../packages/launchdarkly-js-client-sdk/typings.d.ts | \
sed -e '/DOCBUILD-START-REPLACE/,/DOCBUILD-END-REPLACE/d' >build/typings.d.ts
4 changes: 2 additions & 2 deletions docs/typedoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

let version = process.env.VERSION;
if (!version) {
const package = require('../packages/ldclient-js/package.json');
const package = require('../packages/launchdarkly-js-client-sdk/package.json');
version = package.version;
}

Expand All @@ -15,5 +15,5 @@ module.exports = {
readme: 'none', // don't add a home page with a copy of README.md
mode: 'file', // don't treat "typings.d.ts" itself as a parent module
includeDeclarations: true, // allows it to process a .d.ts file instead of actual TS code
entryPoint: '"ldclient-js"' // note extra quotes - workaround for a TypeDoc bug
entryPoint: '"launchdarkly-js-client-sdk"' // note extra quotes - workaround for a TypeDoc bug
};
Loading

0 comments on commit 4732080

Please sign in to comment.