Skip to content

Commit

Permalink
Merge pull request #2 from payscale/DoTheThing
Browse files Browse the repository at this point in the history
this will fix weirdness in the build and start outputting to a lib folder
  • Loading branch information
jrskerritt authored Jan 15, 2019
2 parents 4f20107 + 529184b commit 4e6a141
Show file tree
Hide file tree
Showing 22 changed files with 5,825 additions and 6,609 deletions.
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ jobs:

- run: yarn lint

- run: yarn test
- run: yarn test

- run: yarn build
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ dist
.DS_Store
yarn-error.log
.out
.cache
.cache
lib
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ examples
jsconfig.json
node_modules
scripts
src/__tests__
src
testSetup.js
testShims.js
webpack.config.*
Expand Down
2 changes: 1 addition & 1 deletion examples/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Ads, Favicons, Gtm, WebFont } from '../src/lib';
import { Ads, Favicons, Gtm, WebFont } from '../src/components';

const App = () => (
<div className="example-app" style={{ fontFamily: 'Roboto, sans-serif', fontSize: '32px' }}>
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-beret",
"version": "0.1.0",
"version": "0.1.1",
"description": "React components for your web page's tracking, assets, and more",
"author": "Jim Skerritt <[email protected]>",
"license": "MIT",
Expand All @@ -21,10 +21,11 @@
"publishConfig": {
"registry": "https://registry.npmjs.org"
},
"main": "./dist/lib/index.js",
"main": "./index.js",
"scripts": {
"build": "webpack --mode=production",
"example": "node examples/index.js",
"start": "yarn example",
"install:peers": "node ./scripts/install-peers.js",
"lint:fix": "eslint --fix --config .eslintrc --format table src",
"lint": "eslint --config .eslintrc --format table src",
Expand Down
4 changes: 2 additions & 2 deletions scripts/install-peers.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const fs = require('fs');
const path = require('path');
const { spawnSync } = require('child_process');
const { execSync } = require('child_process');
const addPeerDeps = require('./add-peer-deps');
const removePeerDeps = require('./remove-peer-deps');

addPeerDeps();
spawnSync('yarn', {
execSync('yarn', {
cwd: path.join(__dirname, '..'),
stdio: [process.stdin, process.stdout, process.stderr],
encoding: 'utf-8'
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/Ads-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { mount } from 'enzyme';
import Helmet from 'react-helmet';
import Ads from '../lib/Ads';
import Ads from '../components/Ads';

describe('Ads', () => {
test('exists and is not null', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/Favicons-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { shallow } from 'enzyme';
import Favicons from '../lib/Favicons';
import Favicons from '../components/Favicons';

describe('Favicons', () => {
test('renders null element if no favicons', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/Gtm-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { mount } from 'enzyme';
import Helmet from 'react-helmet';
import Gtm from '../lib/Gtm';
import Gtm from '../components/Gtm';

describe('Gtm', () => {
test('exists and is not null', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/GtmNoScript-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { shallow } from 'enzyme';
import GtmNoScript from '../lib/GtmNoScript';
import GtmNoScript from '../components/GtmNoScript';

describe('GtmNoScript', () => {
test('exists and is not null', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/Vwo-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { mount } from 'enzyme';
import Helmet from 'react-helmet';
import Vwo from '../lib/Vwo';
import Vwo from '../components/Vwo';

describe('Vwo', () => {
test('exists and is not null', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/WebFont-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { shallow, mount } from 'enzyme';
import Helmet from 'react-helmet';
import WebFont from '../lib/WebFont';
import WebFont from '../components/WebFont';

describe('WebFont', () => {
test('returns null element if no font families given', () => {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 0 additions & 28 deletions webpack.config.dev.js

This file was deleted.

13 changes: 10 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@ const path = require('path');

module.exports = {
mode: 'production',
entry: path.resolve(__dirname, 'src/lib/index.js'),
entry: {
Ads: './src/components/Ads.js',
Favicons: './src/components/Favicons.js',
Gtm: './src/components/Gtm.js',
GtmNoScript: './src/components/GtmNoScript.js',
Vwo: './src/components/Vwo.js',
WebFont: './src/components/WebFont.js',
},
output: {
path: path.resolve(__dirname, './dist/lib'),
filename: 'index.js',
path: path.resolve(__dirname, 'lib'),
filename: '[name].js',
library: '',
libraryTarget: 'commonjs'
},
Expand Down
Loading

0 comments on commit 4e6a141

Please sign in to comment.