Giter Site home page Giter Site logo

ncids's Introduction

NCIDS

Design system for the National Cancer Institute (NCI)

Based on the U.S. Web Design System (USWDS), this design system provides principles, guidance and code to help design and build websites using the NCI look and feel.

NCIDS is built as a monorepo, utilizing yarn and yarn workspaces for dependency management and lerna for its utility commands.

Packages

Package name Description
Documentation Design system documentation site
NCIDS-CSS SASS/CSS package for NCIDS
NCIDS-JS Javascript package builder for NCIDS
NCIDS-React React components for NCIDS

Testing

Package name Description
ncids-css-testing SASS/CSS testing package for NCIDS

Development

Adding a "common" dependency

yarn add new-dependency [--dev]

Linking sister repositories as dependencies

lerna add @my-scope-name/dependency-name --scope=@my-scope-name/package-using-dependency

Removing a global dependency

If there’s a dependency that all packages use but that you want to remove, Lerna has the exec command that runs an arbitrary command in each package. With this knowledge, we can use exec to remove a dependency on all packages.

lerna exec -- yarn remove dep-name

Referencing ncids-css in other packages in this repo

NCIDS uses uswds, and therefore references uswds/dist/scss/**/somefile in its scss files. Sass is smart enough to be able to find the package in node_modules, but you just need to help it a bit. You can do this by passing an array of search paths to the includePaths setting of sass. Our uswds has been hoisted to the root node_modules. It should be also noted that if you want to reference @nciocpl/ncids-css you also need to have the root node_modules in the search paths, so score. Assuming you are calling sass from the root of your package, raw sass config looks like:

includePaths: [
	path.join(__dirname, 'node_modules'), // The package's node_modules
	path.join(__dirname, '..', '..', 'node_modules'), // The root node modules from a package within root/packages
],

SPECIAL NOTE: the webpack sass-loader only knows how to pass .scss file to sass. Sass still need to have the includePaths setup on it, and this is separate from webpack resolution. A great example of this is in ncids-css itself.

	{
		loader: 'sass-loader',
		options: {
			sassOptions: {
				includePaths: [
					path.join(__dirname, 'node_modules'),
					path.join(__dirname, '..', '..', 'node_modules'),
				],
			},
		},
	},

There is an open TODO to figure out how this all might work from an external repo consuming our package.

Publishing

Publishing of the ncids-css and ncids-react packages is done by running the command: lerna publish Running the command will assist in versioning, kick off package tests, build the packages and finally publish to github.

ncids's People

Contributors

olitharp-nci avatar bryanpizzillo avatar karlikpj avatar russellwyatt avatar dev-rana-publicis avatar dlescarbeau avatar arcepaul avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.