-
Notifications
You must be signed in to change notification settings - Fork 31
#1 Layout an initial repository for create a typescript server sdk. #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
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 | |||
There was a problem hiding this comment.
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 @@ | |||
| { | |||
There was a problem hiding this comment.
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", | |||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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'; | |||
There was a problem hiding this comment.
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 @@ | |||
| { | |||
There was a problem hiding this comment.
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 @@ | |||
| { | |||
There was a problem hiding this comment.
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.
|
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', |
There was a problem hiding this comment.
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 @@ | |||
| { | |||
There was a problem hiding this comment.
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'.
…m:launchdarkly/js-server-sdk-private into rlamb/sc-150980/initial-repository-layout
Co-authored-by: Alex Engelberg <alex.benjamin.engelberg@gmail.com> Co-authored-by: Matthew M. Keeler <keelerm84@gmail.com>
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 buildwill build everything.npm run cleanwill clean everything.We can add whatever commands we want to any of the workspaces. Linting will be another PR.