1.4.104 • Published 1 month ago

sfc-utils v1.4.104

Weekly downloads
-
License
-
Repository
-
Last release
1 month ago

utils

Importable util functions for our templates

This package includes some helpful functions that you can use across SFC projects

The copy directory includes the standard ways we copy data from sheets and docs into project data directories. If the sheets command is giving you trouble with types in GraphQL, please note that you can force the command to return only strings by setting the third param to true:

googleAuth(project, null, true)

brands.js has all the LESS settings that are specific to each brand. They are applied to the project in gatsby-config.js using the modifyVars config option. Since it's done at build time, we can only make brand distinctions by deployable market. We cannot use this same override strategy to make a style change between CTPost and New Haven Register, for example (since they are both CT market).

nav.js and footer.js both export the HTML needed for each markets' nav and footer settings. The styles controlling the actual look of these features exists at the project level.

nav2.js overhauls our existing nav and includes styles that are bundled in this repo, giving us an extra level of control.

topper.js implements a cool standardized set of topper options. Great for templates! If story_settings is configured with the right columns, this should be standard across projects.

blueconic.js handles the mapping of domains to the arbitrary string that the blueconic script lives on. Why is there an arbitrary string instead of a standard one? Maybe blueconic.houstonchronicle.com, for example? No one knows.

settings.js reconciles the project-config.json file and a story_settings sheet (if present) into a single standard object.

specialnav.js is a cool variant of nav.js that gives it a floating style for special projects, but works the same way.

Install

This package is now officially in the npm registry! Hopefully that means no more old versions being installed from the cache. You can install the latest like this:

npm i sfc-utils

You can still install what's on master by running npm i git+https://github.com/sfchronicle/utils.git but it will occasionally result in version problems.

Updating utils

Create an npm account and ask Evan to add you as a maintainer. You MUST enable two-factor on your account to push updates. Once you are all set, these are the steps:

  1. Make sure you've incremented the version number in package.json.

  2. Update the master branch with changes you want to push.

  3. Log in to npm via the terminal with npm login (this only needs to be done once).

  4. Run npm publish.

If you want to publish a version of utils that should only be beta, not the default install version, then run npm publish --tag beta instead. Then when installing, you must target the new version directly: npm i sfc-utils@1.3.24

Import the functions

import { blendHDN, getSettings } from 'sfc-utils'

Use them

let settings = getSettings()

Troubleshooting

Only an issue for the package installed directly from Github:

If you get a message about a new function not existing in your project, you might need to force a reinstall of this package. The best way to do that is to completely uninstall it and then reinstall it:

npm uninstall sfc-utils && npm i git+https://github.com/sfchronicle/utils.git
1.4.104

1 month ago

1.4.103

1 month ago

1.4.102

1 month ago

1.4.101

1 month ago

1.4.100

2 months ago

1.4.97

2 months ago

1.4.99

2 months ago

1.4.98

2 months ago

1.4.96

2 months ago

1.4.95

2 months ago

1.4.93

3 months ago

1.4.94

3 months ago

1.4.92

3 months ago

1.4.91

3 months ago

1.4.86

3 months ago

1.4.88

3 months ago

1.4.87

3 months ago

1.4.89

3 months ago

1.4.90

3 months ago

1.4.84

4 months ago

1.4.85

4 months ago

1.4.83

4 months ago

1.4.82

4 months ago

1.4.80

5 months ago

1.4.81

5 months ago

1.4.79

5 months ago

1.4.78

5 months ago

1.4.77

5 months ago

1.4.73

7 months ago

1.4.72

7 months ago

1.4.75

6 months ago

1.4.74

6 months ago

1.4.76

6 months ago

1.4.60

8 months ago

1.4.62

7 months ago

1.4.61

8 months ago

1.4.64

7 months ago

1.4.63

7 months ago

1.4.66

7 months ago

1.4.65

7 months ago

1.4.68

7 months ago

1.4.67

7 months ago

1.4.69

7 months ago

1.4.71

7 months ago

1.4.70

7 months ago

1.4.33

11 months ago

1.4.35

11 months ago

1.4.34

11 months ago

1.4.37

11 months ago

1.4.36

11 months ago

1.4.39

11 months ago

1.4.38

11 months ago

1.4.40

10 months ago

1.4.42

10 months ago

1.4.41

10 months ago

1.4.44

9 months ago

1.4.43

10 months ago

1.4.46

9 months ago

1.4.45

9 months ago

1.4.48

9 months ago

1.4.47

9 months ago

1.4.49

9 months ago

1.4.51

9 months ago

1.4.50

9 months ago

1.4.53

8 months ago

1.4.55

8 months ago

1.4.54

8 months ago

1.4.57

8 months ago

1.4.56

8 months ago

1.4.59

8 months ago

1.4.58

8 months ago

1.4.20

1 year ago

1.4.22

1 year ago

1.4.21

1 year ago

1.4.24

1 year ago

1.3.57

1 year ago

1.4.23

1 year ago

1.3.58

1 year ago

1.4.26

1 year ago

1.3.55

1 year ago

1.4.25

1 year ago

1.3.56

1 year ago

1.4.28

12 months ago

1.4.27

12 months ago

1.3.59

1 year ago

1.4.29

12 months ago

1.3.60

1 year ago

1.3.61

1 year ago

1.4.31

12 months ago

1.3.64

1 year ago

1.4.30

12 months ago

1.3.65

1 year ago

1.3.62

1 year ago

1.4.32

12 months ago

1.3.63

1 year ago

1.3.68

1 year ago

1.3.69

1 year ago

1.3.66

1 year ago

1.3.67

1 year ago

1.4.11

1 year ago

1.4.10

1 year ago

1.4.13

1 year ago

1.4.12

1 year ago

1.4.15

1 year ago

1.4.14

1 year ago

1.4.17

1 year ago

1.4.16

1 year ago

1.4.19

1 year ago

1.4.18

1 year ago

1.4.6

1 year ago

1.4.5

1 year ago

1.4.4

1 year ago

1.4.3

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.71

1 year ago

1.3.72

1 year ago

1.3.70

1 year ago

1.3.75

1 year ago

1.3.76

1 year ago

1.3.73

1 year ago

1.3.74

1 year ago

1.4.9

1 year ago

1.4.8

1 year ago

1.4.7

1 year ago

1.3.50

1 year ago

1.3.53

1 year ago

1.3.54

1 year ago

1.3.51

1 year ago

1.3.52

1 year ago

1.3.46

2 years ago

1.3.47

1 year ago

1.3.45

2 years ago

1.3.48

1 year ago

1.3.49

1 year ago

1.3.13

2 years ago

1.3.17

2 years ago

1.3.18

2 years ago

1.3.15

2 years ago

1.3.16

2 years ago

1.3.19

2 years ago

1.3.20

2 years ago

1.3.21

2 years ago

1.3.24

2 years ago

1.3.25

2 years ago

1.3.22

2 years ago

1.3.23

2 years ago

1.3.28

2 years ago

1.3.29

2 years ago

1.3.26

2 years ago

1.3.27

2 years ago

1.3.31

2 years ago

1.3.32

2 years ago

1.3.30

2 years ago

1.3.35

2 years ago

1.3.36

2 years ago

1.3.33

2 years ago

1.3.34

2 years ago

1.3.39

2 years ago

1.3.37

2 years ago

1.3.38

2 years ago

1.3.42

2 years ago

1.3.43

2 years ago

1.3.40

2 years ago

1.3.41

2 years ago

1.3.44

2 years ago

1.3.12

2 years ago

1.3.11

2 years ago

1.3.10

2 years ago

1.3.9

2 years ago

1.3.8

2 years ago

1.3.7

2 years ago

1.3.6

2 years ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago