Skip to content

Commit

Permalink
chore: Update to npm 7
Browse files Browse the repository at this point in the history
  • Loading branch information
aasanchez committed Dec 22, 2021
1 parent 9604189 commit fd69e81
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 42 deletions.
28 changes: 15 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ references:
container_config_node12: &container_config_node12
working_directory: ~/project/build
docker:
- image: circleci/node:12-browsers
- image: cimg/node:12.22-browsers

container_config_lambda_node12: &container_config_lambda_node12
working_directory: ~/project/build
Expand All @@ -22,14 +22,14 @@ references:

npm_cache_keys: &npm_cache_keys
keys:
- v2-dependency-npm-{{ checksum "package.json" }}-
- v2-dependency-npm-{{ checksum "package.json" }}
- v2-dependency-npm-
- v2-dependency-npm-{{ checksum "package.json" }}-
- v2-dependency-npm-{{ checksum "package.json" }}
- v2-dependency-npm-

cache_npm_cache: &cache_npm_cache
save_cache:
key: v2-dependency-npm-{{ checksum "package.json" }}-{{ epoch }}
paths:
key: v2-dependency-npm-{{ checksum "package.json" }}-{{ epoch }}
paths:
- ./node_modules/

restore_npm_cache: &restore_npm_cache
Expand All @@ -55,7 +55,10 @@ references:
branches:
ignore: /.*/

version: 2
version: 2.1

orbs:
node: circleci/node@4.6.0

jobs:

Expand All @@ -67,15 +70,14 @@ jobs:
name: Checkout next-ci-shared-helpers
command: git clone --depth 1 git@github.com:Financial-Times/next-ci-shared-helpers.git .circleci/shared-helpers
- *restore_npm_cache
- node/install-npm:
version: "7"
- run:
name: Install python
command: sudo apt-get update && sudo apt-get install python -qq
- run:
name: Install project dependencies
command: make install
- run:
name: shared-helper / npm-install-peer-deps
command: .circleci/shared-helpers/helper-npm-install-peer-deps
- run:
name: shared-helper / npm-update
command: .circleci/shared-helpers/helper-npm-update
- run:
name: shared-helper / generate-build-state-artifacts
command: .circleci/shared-helpers/helper-generate-build-state-artifacts
Expand Down
63 changes: 38 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,60 @@
# n-syndication [![CircleCI](https://circleci.com/gh/Financial-Times/n-syndication.svg?style=svg)](https://circleci.com/gh/Financial-Times/n-syndication)
# n-syndication

[![CircleCI](https://circleci.com/gh/Financial-Times/n-syndication.svg?style=svg)](https://circleci.com/gh/Financial-Times/n-syndication)

## Troubleshooting

All troubleshooting information is gathered in the [Syndication API Troubleshooting runbook](https://runbooks.ftops.tech/next-syndication-api).

## What is n-syndication and how does it work

A client side library available as a Bower component that displays icons next to headlines allowing syndication customers to download or save content for republishing.
A client side library available as a Bower component that displays icons next to headlines allowing syndication
customers to download or save content for republishing.

* [n-syndication wiki page](https://github.com/Financial-Times/next-syndication-api/wiki/n-syndication-icons-display-library) gives some background context on how the icons work
* [n-syndication wiki page](https://github.com/Financial-Times/next-syndication-api/wiki/n-syndication-icons-display-library)
gives some background context on how the icons work

See [getting started](https://github.com/Financial-Times/next-syndication-api/wiki/Syndication-API:-authentication#getting-started) on the authentication wiki page if you need to be added as a syndication subscriber.
See [getting started](https://github.com/Financial-Times/next-syndication-api/wiki/Syndication-API:-authentication#getting-started)
on the authentication wiki page if you need to be added as a syndication subscriber.

You can develop with n-syndication without installing all of syndication. See instructions for local development and developing with a Next app.
You can develop with n-syndication without installing all of syndication. See instructions for local development and
developing with a Next app.

If your app is failing locally as if you need the syndication API installed locally, you probably have some syndication port details in `next-router`'s `.env` variables. Removing them should get the app to call the live production syndication API instead.
If your app is failing locally as if you need the syndication API installed locally, you probably have some syndication
port details in `next-router`'s `.env` variables. Removing them should get the app to call the live production
syndication API instead.

### More information about the syndication system

* [The Syndication Wiki](https://github.com/Financial-Times/next-syndication-api/wiki) explains the system and its architecture, including endpoints and authentication.
* [Next Wiki](https://github.com/Financial-Times/next/wiki/Syndication) covers GDPR SAR and erasure requests so that people without github access can read it, as it is automatically published to https://customer-products.in.ft.com/wiki/Syndication.
* [The Syndication Wiki](https://github.com/Financial-Times/next-syndication-api/wiki) explains the system and its
architecture, including endpoints and authentication.
* [Next Wiki](https://github.com/Financial-Times/next/wiki/Syndication) covers GDPR SAR and erasure requests so that
people without github access can read it, as it is automatically published to [Syndication](https://customer-products.in.ft.com/wiki/Syndication).

## Local Development

```sh
$ git clone git@github.com:Financial-Times/n-syndication.git
$ cd n-syndication
$ make install
```shell
git clone git@github.com:Financial-Times/n-syndication.git
cd n-syndication
make install
```

Run the (incomplete) test suite with

```sh
$ make test
```shell
make test
```

Verify that the Sass can compile by running

```sh
$ npx sass ./test/main.scss --load-path=./bower_components/
```shell
npx sass ./test/main.scss --load-path=./bower_components/
```

And by running:

```sh
$ npx sass ./test/main.scss --load-path=./node_modules --load-path=./node_modules/@financial-times
```shell
npx sass ./test/main.scss --load-path=./node_modules --load-path=./node_modules/@financial-times
```

### Developing with a next app
Expand All @@ -53,18 +63,21 @@ Instruction for developing the library within a next app will be are in developm

## Deployment

Create a release tag [in Github](https://github.com/Financial-Times/n-syndication/releases) following the Semver convention and prefixing the release number with `v`. This will make this available as a bower component at that version.
Create a release tag [in Github](https://github.com/Financial-Times/n-syndication/releases) following the Semver
convention and prefixing the release number with `v`. This will make this available as a bower component at that version.

If you are wanting to deploy to FT.com, after creating the tag you will need to coordinate the release for [these repos](https://github.com/search?q=org%3AFinancial-Times+filename%3Abower.json+n-syndication+NOT+repo%3AFinancial-Times%2Fnext-alpha-front-page+NOT+repo%3AFinancial-Times%2Fn-ui+NOT+repo%3AFinancial-Times%2Fn-syndication&type=Code). You should create a pull request updating the package version in the repo's `bower.json`.
If you are wanting to deploy to FT.com, after creating the tag you will need to coordinate the release for
[these repos](https://github.com/search?q=org%3AFinancial-Times+filename%3Abower.json+n-syndication+NOT+repo%3AFinancial-Times%2Fnext-alpha-front-page+NOT+repo%3AFinancial-Times%2Fn-ui+NOT+repo%3AFinancial-Times%2Fn-syndication&type=Code). You should create a pull request
updating the package version in the repo's `bower.json`.

## This is just some javascript - is there other code elsewhere?
Yep - These links will probably be wrong pretty soon but will hopefully point you in the right direction:

**n-teaser** - https://github.com/Financial-Times/n-teaser/blob/main/src/presenters/teaser-presenter.js#L77
Here we add an additional modifier if syndication is available on this article
Yep - These links will probably be wrong pretty soon but will hopefully point you in the right direction:

**next-article** - https://github.com/Financial-Times/next-article/blob/main/views/content.html#L20
Here a data attribute is added containing the syndication status of the article.
* [n-teaser](https://github.com/Financial-Times/n-teaser/blob/main/src/presenters/teaser-presenter.js#L77) Here we add
an additional modifier if syndication is available on this article
* [next-article](https://github.com/Financial-Times/next-article/blob/main/views/content.html#L20) Here a data attribute
is added containing the syndication status of the article.

**generic** - add the following data attributes to your markup:

Expand Down
15 changes: 11 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"babel-preset-react": "^6.11.1",
"bower": "^1.8.8",
"bower-resolve-webpack-plugin": "^1.0.3",
"check-engine": "^1.10.1",
"eslint": "^4.2.0",
"extract-css-block-webpack-plugin": "^1.3.0",
"extract-text-webpack-plugin": "^2.1.0",
Expand All @@ -36,21 +37,23 @@
"n-ui-foundations": "github:financial-times/n-ui-foundations#nobower",
"next-session-client": "^3.0.1",
"o-buttons": "npm:@financial-times/o-buttons@^6.0.2",
"o-icons": "npm:@financial-times/o-icons@^6.3.0",
"o-message": "npm:@financial-times/o-message@^4.1.8",
"o-overlay": "npm:@financial-times/o-overlay@^3.0.0",
"o-tracking": "npm:@financial-times/o-tracking@^2.0.3",
"o-viewport": "npm:@financial-times/o-viewport@^5.0.0",
"o-visual-effects": "npm:@financial-times/o-visual-effects@^3.0.0",
"superstore": "^2.1.0",
"o-icons": "npm:@financial-times/o-icons@^7.0.0"
"superstore": "^2.1.0"
},
"config": {},
"engines": {
"node": "12.x"
"node": "12.x",
"npm": "7.x || 8.x"
},
"scripts": {
"commit": "commit-wizard",
"prepare": "npx snyk protect || npx snyk protect -d || true"
"prepare": "npx snyk protect || npx snyk protect -d || true",
"preinstall": "[ \"$INIT_CWD\" != \"$PWD\" ] || npm_config_yes=true npx check-engine && { [ \"$INIT_CWD\" != \"$PWD\" ] || npm_config_yes=true npx check-engine; }"
},
"false": {},
"husky": {
Expand All @@ -59,5 +62,9 @@
"pre-commit": "node_modules/.bin/secret-squirrel && node ./scripts/fromBowerToNpm.js",
"pre-push": "make verify -j3"
}
},
"volta": {
"node": "12.22.5",
"npm": "7.20.2"
}
}

0 comments on commit fd69e81

Please sign in to comment.