2.1.1 • Published 11 months ago

@withjoy/server-core v2.1.1

Weekly downloads
175
License
MIT
Repository
-
Last release
11 months ago

server-core

Getting Started

You do not need any external components / dependencies to manage this module.

# set up Node
nvm use
yarn install

# run the Test Suite
yarn test

All shell tasks for the Service are executed with scripts from package.json. Here are some of the basics:

# compile TypeScript => `dist/*`
yarn build
yarn test:build

# run the Test Suite
yarn test
yarn test:only src/utils/miscellaneous.spec.ts

Publishing the Module

To publish a new version of this module,

  • do not up-version on your development branch
  • merge your fixes into master
  • from the master branch,
yarn version --patch  # or whatever is suitable

As a follow-up,

  • package.json is up-versioned
  • a semver-ish tag is pushed to Git
  • CircleCI will perform the yarn publish operation when it detects the tag
  • it's ready once the 'versions' in yarn info @withjoy/server-core have been updated

Integrating / Upgrading the Module

Before You Publish

When you're doing trial runs of the built package, using the 'file://' protocol and the file TGZ output by yarn pack is the recommended strategy. Please see Developing Node Modules.

PS. it's okay to replace the { dependencies } wildcard for testing purposes, but that is not the approach for upgrading to the published version -- see below.

Upgrading the Published Module

The following process is also touched upon within Gateway Services 'package.json' Setup, a more high-level discussion around package conventions.

'server-core' and 'server-core-test' are interdependent in a way that makes package.json resolutions complicated. Each one advances forward on its own version timeline, while 'server-core-test' also provides a extended Test Suite for 'server-core'.

To address this, our package.json files are configured as follows:

{
  "resolutions": {
    "@withjoy/server-core": "^X.X.X",
    ...
  },
  "dependencies": {
    "@withjoy/server-core": "*", // <= wildcard
    ...
  },
  "devDependencies": {
    "@withjoy/server-core-test": "^X.X.X",
    ...
  }
}

To upgrade 'server-core'

  • call out the new version in { resolutions } -- (leave the wildcard alone)
  • yarn install
  • confirm that your yarn.lock has been updated accordingly

If experience problems trying to import { } the newly-published code, you may need to

  • hand-edit the yarn.lock file and remove all the disparate '@withjoy/server-core' versions
  • yarn install again

You should be in good shape after that.

PS. upgrading 'server-core-test' is easy; it follows typical version specification patterns.

Node 6 Support

NOTE: CircleCI runs the Test Suites for both Engines.

If you want a feature to be exposed to app-server-api, it must be compatible with the Node 6 engine.

The require syntax for Node 6 compatible features is:

const { ... } = require("@withjoy/server-core/dist/node6");

What To Do

You only need to worry about dealing with Node 6 Support when you're going to expose a new version to app-server-api. As long as the monorepo doesn't upgrade its version, you can pretend that Node 6 Support isn't there.

Make sure to keep these files in-sync:

  • src/node6, for selective exports
  • mocha-node6.opts, for their matching Test Suite coverage

And here's the basic process:

# fresh clone of the repo
#   so as not to conflict with Node 10's installed `node_modules`
git clone git@github.com:joylifeinc/server-core.git
cd server-core

nvm use 6  # ... obviously

# install Node 6 modules from `yarn.lock`, then rebuild the source
yarn install
yarn run node6:build

# build & run the Test Suite
yarn run node6:test:build
yarn run node6:test:run

And once it's all passing,

  • push your changes
  • version + publish from within Node 10

Build Tooling

It's somewhat fragile;

  • we are using yarn in Node 6
    • yes, the same version of yarn that we use in Node 10
  • the Node 10 version of jest won't launch in Node 6
    • so we use mocha + chai
    • mocha@5, because
      • there's no @types/mocha@6
      • mocha@6 doesn't run on Node 6 (for the same reason as jest)
    • and we compile with jests global DSL (describe, etc.) because it's identical to mochas
  • we use tsc to build / transpile in Node 6
    • we publish the Node 10 transpiled versions, which work fine in Node 6
    • however, the Test Suite is written in TypeScript, and it is not built as part of dist/* -- instead, it transpiles into build/*, which is not "dist"ributed

These files are related, but won't change often (if ever)

  • tsconfig.node6-test.json
  • .circleci/config.yml

CircleCI

Its Project uses the following Environment Variables:

  • ARTIFACTORY_TOKEN
  • NPM_TOKEN
2.1.1

11 months ago

2.1.0-beta-2

1 year ago

2.1.0-beta-3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.1.0-beta

1 year ago

2.1.0

1 year ago

1.47.0

1 year ago

2.0.0

1 year ago

1.37.0

2 years ago

1.37.1

2 years ago

1.40.0

2 years ago

1.40.1

2 years ago

1.44.0

2 years ago

1.38.0

2 years ago

1.41.0

2 years ago

1.45.1

2 years ago

1.45.0

2 years ago

1.45.3

2 years ago

1.45.2

2 years ago

1.45.5

1 year ago

1.45.4

2 years ago

1.45.7

1 year ago

1.45.6

1 year ago

1.45.8

1 year ago

1.39.1

2 years ago

1.39.2

2 years ago

1.39.0

2 years ago

1.42.0

2 years ago

1.46.0

1 year ago

1.43.1

2 years ago

1.43.0

2 years ago

1.43.2

2 years ago

1.33.3

2 years ago

1.33.1

2 years ago

1.33.2

2 years ago

1.32.0

2 years ago

1.34.0

2 years ago

1.33.0

2 years ago

1.31.3

2 years ago

1.35.0

2 years ago

1.36.0

2 years ago

1.36.1

2 years ago

1.36.2

2 years ago

1.36.3

2 years ago

1.31.2

2 years ago

1.31.0

2 years ago

1.30.0

3 years ago

1.29.0

3 years ago

1.28.0

3 years ago

1.27.3

3 years ago

1.27.2

3 years ago

1.27.0

3 years ago

1.27.1

3 years ago

1.26.1

3 years ago

1.26.0

3 years ago

1.25.5

3 years ago

1.25.6

3 years ago

1.25.0

3 years ago

1.25.1

3 years ago

1.25.4

3 years ago

1.25.2

3 years ago

1.25.3

3 years ago

1.24.2

3 years ago

1.24.1

3 years ago

1.23.1

3 years ago

1.24.0

3 years ago

1.23.1-a

3 years ago

1.23.1-b

3 years ago

1.23.0

3 years ago

1.22.5-d

3 years ago

1.22.1-c

3 years ago

1.22.1-b

3 years ago

1.22.1

3 years ago

1.22.0

3 years ago

1.21.2

3 years ago

1.21.3

3 years ago

1.21.0

3 years ago

1.21.1

3 years ago

1.20.1

3 years ago

1.20.0

3 years ago

1.19.0

3 years ago

1.18.3

3 years ago

1.18.2

3 years ago

1.18.1

3 years ago

1.18.0

3 years ago

1.17.1

3 years ago

1.17.0

3 years ago

1.16.0

4 years ago

1.15.4

4 years ago

1.15.3

4 years ago

1.15.2

4 years ago

1.15.1

4 years ago

1.14.16-0

4 years ago

1.15.0

4 years ago

1.14.15-0

4 years ago

1.14.14-0

4 years ago

1.14.4

4 years ago

1.14.3

4 years ago

1.14.1

4 years ago

1.14.2

4 years ago

1.13.0

4 years ago

1.12.3

4 years ago

1.12.2

4 years ago

1.12.1

4 years ago

1.12.0

4 years ago

1.12.0-beta-2

4 years ago

1.12.0-beta-1

4 years ago

1.11.2

4 years ago

1.11.1

4 years ago

1.11.0

4 years ago

1.10.3

4 years ago

1.10.2

4 years ago

1.10.1

4 years ago

1.10.0

4 years ago

1.9.0

4 years ago

1.8.1

4 years ago

1.8.0

4 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.3

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.2

4 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8-a

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago