Skip to content

Commit

Permalink
Dependencies and scaffolding
Browse files Browse the repository at this point in the history
  • Loading branch information
devowhippit committed Jun 18, 2021
1 parent e092c55 commit 69cee7b
Show file tree
Hide file tree
Showing 31 changed files with 25,023 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# osx noise
.DS_Store
profile

# svn
.svn

# npm
node_modules
npm-debug.log
87 changes: 86 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,86 @@
# mhfa
# MHFA

Work-in-progress.

## Contributing

As of right now this project should be relative to the Growing Up Patterns.

```
- 📁 growingupnyc-patterns
- 📁 mhfa
```

If you do not have the [Growing Up NYC Patterns](https://github.com/NYCOpportunity/growingupnyc-patterns) set up this way, clone them before cloning this package.

```shell
$ git clone https://github.com/NYCOpportunity/growingupnyc-patterns
$ git clone https://github.com/CityOfNewYork/mhfa
$ cd mhfa
```

Then install dependencies and start the [Patterns CLI](https://github.com/CityOfNewYork/patterns-cli) development server.

```shell
$ npm install
$ npm start
```

## CHANGELOG

### v0.0.0-1

Initialized an NPM/Node.js project.

```
$ npm init
```

Installed the @NYCOpportunity [Patterns CLI](https://github.com/CityOfNewYork/patterns-cli) and [Growing Up NYC Patterns](https://github.com/NYCOpportunity/growingupnyc-patterns).

```shell
$ npm install @nycopportunity/pttrn
```

The **Growing Up NYC Patterns** need to be installed as a local file dependency.

```
$ cd ../
$ git clone https://github.com/NYCOpportunity/growingupnyc-patterns
$ cd mhfa
$ npm install ../growingupnyc-patterns
```

The path **../growingupnyc-patterns** would vary if Growing Up Patterns is already cloned locally.

Ran the [pttrn scaffold command](https://github.com/CityOfNewYork/patterns-cli/#scaffold) to set up the project.

```shell
$ npx pttrn scaffold
```

Added [Pattern NPM scripts](https://github.com/CityOfNewYork/patterns-cli/#npm-scripts) to the project.

```json
"scripts": {
"start": "cross-env NODE_ENV=development concurrently \"pttrn -w\" \"pttrn serve -w\" -p \"none\"",
"version": "npm run default && git add .",
"prepublishOnly": "git push && git push --tags",
"publish": "cross-env NODE_ENV=production pttrn publish",
"default": "cross-env NODE_ENV=production pttrn"
},
```

Added **.gitignore** to the project.

```shell
$ touch .gitignore
```

Updated README.md

---

![The Mayor's Office for Economic Opportunity](NYCMOEO_SecondaryBlue256px.png)

[The Mayor's Office for Economic Opportunity](http://nyc.gov/opportunity) (NYC Opportunity) is committed to sharing open source software that we use in our products. Feel free to ask questions and share feedback. **Interested in contributing?** See our open positions on [buildwithnyc.github.io](http://buildwithnyc.github.io/). Follow our team on [Github](https://github.com/orgs/CityOfNewYork/teams/nycopportunity) (if you are part of the [@cityofnewyork](https://github.com/CityOfNewYork/) organization) or [browse our work on Github](https://github.com/search?q=nycopportunity).
60 changes: 60 additions & 0 deletions config/rollup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/**
* Dependencies
*/

const nodeResolve = require('@rollup/plugin-node-resolve'); // Locate modules using the Node resolution algorithm, for using third party modules in node_modules.
const replace = require('@rollup/plugin-replace'); // Replace content while bundling.

/**
* Base module configuration. Refer to the package for details on the available options.
*
* @source https://rollupjs.org
*
* @type {Object}
*/
const rollup = {
sourcemap: 'inline',
format: 'iife',
strict: true
};

/**
* Plugin configuration. Refer to the package for details on the available options.
*
* @source https://github.com/rollup/plugins
*
* @type {Object}
*/
let plugins = [
replace({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
}),
nodeResolve.nodeResolve({
browser: true,
customResolveOptions: {
moduleDirectory: 'node_modules'
}
})
];

/**
* ES Module Exports
*
* @type {Array}
*/
module.exports = [
{
input: `${process.env.PWD}/src/js/default.js`,
output: [
{
name: 'Default',
file: `${process.env.PWD}/dist/js/default.js`,
sourcemap: rollup.sourcemap,
format: rollup.format,
strict: rollup.strict
}
],
plugins: plugins,
devModule: true
}
];
28 changes: 28 additions & 0 deletions config/sass.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* Config
*
* @type {Object}
*/
const sass = {
sourceMapEmbed: true,
includePaths: [
`${process.env.PWD}/src/`,
`${process.env.PWD}/node_modules/`
]
};

/**
* Sass Export
*
* @type {Array}
*/
module.exports = [
{
file: `${process.env.PWD}/src/scss/default.scss`,
outDir: `${process.env.PWD}/dist/css/`,
outFile: 'default.css',
sourceMapEmbed: sass.sourceMapEmbed,
includePaths: sass.includePaths,
devModule: true // This needs to be set if we want the module to be compiled during development
}
];
12 changes: 12 additions & 0 deletions config/tailwindcss.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Dependencies
*/

// const defaultConfig = require('tailwindcss/defaultConfig');
// const tokens = require('tokens');

/**
* Config
*/

module.exports = {};
56 changes: 56 additions & 0 deletions config/tokens.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/**
* Dependencies
*/

const package = require(`${process.env.PWD}/package.json`);

/**
* Config
*/

module.exports = {
'output': `"${process.env.PWD}/src/config/_tokens.scss"`,
'version': `"${package.version}"`,
'border': {
'width': '3px',
'style': 'solid',
'radius': '16px'
},
'color': {
'white': '#FFF',
'blue': '#284CCA',
'red': '#FC5D52',
'gray': '#E6E8EC'
},
'font-family': {
'system': ['-apple-system', 'BlinkMacSystemFont', '"Segoe UI"', 'Roboto', 'Oxygen-Sans', 'Ubuntu', 'Cantarell', '"Helvetica Neue"', 'sans-serif'],
'monospace': 'monospace'
},
'font': {
'body': 'system',
'pre': 'monospace'
},
'font-weight': {
'body': 'normal',
'pre': 'normal'
},
'font-style': {
'body': 'normal',
'pre': 'normal'
},
'font-size': {
'body': '1em',
'pre': '0.9em'
},
'line-height': {
'body': '1.2',
'pre': '1.5'
},
'grid': '8px', // 8px grid system
'typography': {
'small': '16px',
'mobile': '18px',
'tablet': '20px',
'desktop': '22px'
}
};
Empty file added dist/.gitkeep
Empty file.
Loading

0 comments on commit 69cee7b

Please sign in to comment.