Skip to content

Conversation

@kinyoklion
Copy link
Member

@kinyoklion kinyoklion commented May 5, 2022

This makes a basic layout to work from.

sdk-common - Put code here that could be common to both a client and server JS SDK.
server-sdk-common - Put code here that is common to JS server SDKs.
platform-node - The platform specific SDK implementation. The output of this would be a fully functional SDK for that platform.

NPM went with funny names like the context. The top level is a workspace and it contains... workspaces.

npm run build will build everything.
npm run clean will clean everything.

We can add whatever commands we want to any of the workspaces. Linting will be another PR.

@shortcut-integration
Copy link

This pull request has been linked to Shortcut Story #150980: Setup typescript project suitable for a library..

@@ -0,0 +1,49 @@
# Contributing to the LaunchDarkly Server-Side SDK for Node.js
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left the contributing and readme as node specific for now.

@@ -0,0 +1,12 @@
{
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a workspace package.json. Which allows sharing dependencies, dependencies between packages in this repository, and for everything to be built at the top level.

@@ -0,0 +1,27 @@
{
"name": "@launchdarkly/js-server-sdk-platform-node",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've used organization prefixes for these names, but we can change them to whatever we want before we publish them.
This would likely just be the launchdarkly-node-server-sdk for continuity.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the application teams have been using @launchdarkly to publish our internal packages.

@@ -0,0 +1,3 @@
import doesItWork from '@launchdarkly/js-server-sdk-common';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The index files just contain some code to make sure things are linking together correctly.

@@ -0,0 +1,18 @@
{
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a good starting point, but we may want to change things for compatibility as we work through things. This should be good for node.

@@ -0,0 +1,14 @@
{
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This references the other tsconfigs and allows building the entire project at once. Each project will have its own 'dist' output.

@kinyoklion kinyoklion changed the title Layout an initial repository for create a typescript server sdk. #1 Layout an initial repository for create a typescript server sdk. May 5, 2022
@kinyoklion kinyoklion marked this pull request as ready for review May 5, 2022 23:30
@kinyoklion
Copy link
Member Author

Working through the interfaces I may make some more modules. Internal to the interfaces there were several logical modules, which I think we can make into workspaces of their own. Like the integrations.

node: true,
},
extends: [
'airbnb-base',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've used the airbnb style as the base. It is very popular and so will produce a style very familiar to many developers.

@@ -0,0 +1,5 @@
{
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file exists so the linter can lint all the TS. Otherwise it will get confused about TS files outside the 'project'.

@kinyoklion kinyoklion requested a review from eli-darkly May 6, 2022 21:35
kinyoklion added 3 commits May 6, 2022 15:30
…m:launchdarkly/js-server-sdk-private into rlamb/sc-150980/initial-repository-layout
@kinyoklion kinyoklion merged commit b043331 into main May 16, 2022
@kinyoklion kinyoklion deleted the rlamb/sc-150980/initial-repository-layout branch May 16, 2022 21:01
kinyoklion added a commit that referenced this pull request May 25, 2022
kinyoklion added a commit that referenced this pull request Jun 1, 2022
Co-authored-by: Alex Engelberg <alex.benjamin.engelberg@gmail.com>
Co-authored-by: Matthew M. Keeler <keelerm84@gmail.com>
kinyoklion added a commit that referenced this pull request Jun 2, 2022
Co-authored-by: Matthew M. Keeler <keelerm84@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants