Skip to content

Commit

Permalink
fix(release): Correctly release esm version as ES5
Browse files Browse the repository at this point in the history
  • Loading branch information
danez committed Aug 17, 2020
1 parent 1fd1797 commit 5934c64
Show file tree
Hide file tree
Showing 15 changed files with 94 additions and 85 deletions.
47 changes: 32 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
language: node_js
node_js:
- "12"
- "lts/*"
cache: yarn
deploy:
local_dir: .docs
provider: pages
skip_cleanup: true
github_token: $GH_TOKEN
on:
branch: master
condition: '"$TRAVIS_JOB_NUMBER" == *.1'
script:
- "(yarn lint && yarn test --ci --coverage) || travis_terminate"
- 'if [[ "$TRAVIS_JOB_NUMBER" == *.1 ]]; then yarn build:storybook || travis_terminate 1; fi'
- yarn release
after_success:
- bash <(curl -s https://codecov.io/bash)
stages:
- test
- name: deploy
if: branch = master
- name: release
if: branch = master AND type != pull_request
jobs:
include:
- stage: test
script:
- yarn lint
- yarn test --ci --coverage
after_success:
- bash <(curl -s https://codecov.io/bash)
- stage: deploy
script: yarn build:storybook
deploy:
local_dir: .docs
provider: pages
skip_cleanup: true
github_token: $GH_TOKEN
on:
branch: master
- stage: release
script: skip
deploy:
provider: script
skip_cleanup: true
script: yarn release
on:
branch: master
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2017 @researchgate/react-intersection-observer authors
Copyright (c) @researchgate/react-intersection-observer authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
import Observer from '../../../../lib/es/src';
import Observer from '../../../..';

export default (threshold) => (BaseComponent) => {
const displayName =
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/components/Hook/Hook.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { useIntersectionObserver } from '../../../../lib/es/src';
import { useIntersectionObserver } from '../../../..';

const Hook = () => {
const [visibility, setVisibility] = useState('invisible');
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/components/HookOnlyOnce/HookOnlyOnce.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { useIntersectionObserver } from '../../../../lib/es/src';
import { useIntersectionObserver } from '../../../..';

const HookOnlyOnce = () => {
const [visibility, setVisibility] = useState('invisible');
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/components/ImpressionTracking/AdImpression.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { action } from '@storybook/addon-actions';
import Observer from '../../../../lib/es/src';
import Observer from '../../../..';

const tracked = action('tracked');

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/components/OnlyOnce/OnlyOnce.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { decorateAction } from '@storybook/addon-actions';
import Observer from '../../../../lib/es/src';
import Observer from '../../../..';

const storyBookAction = decorateAction([
(args) =>
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/components/Playground/PlaygroundRootMargin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { decorateAction } from '@storybook/addon-actions';
import { select } from '@storybook/addon-knobs/react';
import Observer from '../../../../lib/es/src';
import Observer from '../../../..';

const storyBookAction = decorateAction([
(args) =>
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/components/WindowFrame/WindowFrame.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { decorateAction } from '@storybook/addon-actions';
import Observer from '../../../../lib/es/src';
import Observer from '../../../..';

const storyBookAction = decorateAction([
(args) =>
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/components/WindowRoot/WindowRoot.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { decorateAction } from '@storybook/addon-actions';
import Observer from '../../../../lib/es/src';
import Observer from '../../../..';

const storyBookAction = decorateAction([
(args) =>
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/components/WithRootMargin/WithRootMargin.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { decorateAction } from '@storybook/addon-actions';
import Observer from '../../../../lib/es/src';
import Observer from '../../../..';

const storyBookAction = decorateAction([
(args) =>
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/components/WithThresholds/WithThresholds.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { decorateAction } from '@storybook/addon-actions';
import Observer from '../../../../lib/es/src';
import Observer from '../../../..';

const storyBookAction = decorateAction([
(args) =>
Expand Down
19 changes: 7 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
},
"dependencies": {},
"devDependencies": {
"@babel/cli": "7.10.5",
"@babel/core": "7.11.1",
"@babel/preset-typescript": "7.10.4",
"@researchgate/babel-preset": "2.0.3",
Expand All @@ -20,14 +19,13 @@
"@storybook/addon-knobs": "5.3.19",
"@storybook/addon-options": "5.3.19",
"@storybook/react": "5.3.19",
"@types/react": "16.9.46",
"@testing-library/react-hooks": "3.4.1",
"@types/jest": "26.0.10",
"@types/react": "16.9.46",
"@types/react-dom": "16.9.8",
"@typescript-eslint/eslint-plugin": "3.9.0",
"@typescript-eslint/parser": "3.9.0",
"babel-loader": "8.1.0",
"cross-env": "7.0.2",
"babel-loader": "^8.1.0",
"intersection-observer": "0.11.0",
"npm-run-all": "4.1.5",
"prop-types": "15.7.2",
Expand Down Expand Up @@ -56,8 +54,8 @@
],
"license": "MIT",
"main": "lib/js/index.js",
"module": "lib/es/src/index.js",
"types": "typings/src/index.d.ts",
"module": "lib/es/index.js",
"types": "typings/index.d.ts",
"peerDependencies": {
"react": "^16.3.2",
"react-dom": "^16.3.2"
Expand All @@ -67,9 +65,6 @@
"url": "https://github.com/researchgate/react-intersection-observer.git"
},
"prettier": "@researchgate/prettier-config",
"resolutions": {
"serialize-javascript": "3.1.0"
},
"spire": {
"extends": [
[
Expand All @@ -84,9 +79,9 @@
]
},
"scripts": {
"build": "run-s build:js build:typescript",
"build:js": "cross-env BABEL_ENV=production BABEL_OUTPUT=cjs babel src -x .ts,.tsx -d lib/js",
"build:typescript": "cross-env tsc --build",
"build": "run-s build:esm build:cjs",
"build:esm": "tsc --build",
"build:cjs": "tsc --outDir ./lib/js --module CommonJS",
"build:storybook": "build-storybook -o .docs",
"clean:lib": "rm -rf lib",
"clean:typescript": "tsc --build --clean",
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"compilerOptions": {
"target": "es2018",
"target": "ES5",
"moduleResolution": "node",
"module": "ES2015",
"strict": true,
"strictNullChecks": true,
"noImplicitAny": true,
Expand All @@ -11,7 +12,7 @@
"forceConsistentCasingInFileNames": true,
"declaration": true,
"jsx": "react",
"rootDir": ".",
"rootDir": "src",
"declarationDir": "./typings",
"outDir": "./lib/es"
},
Expand Down
Loading

0 comments on commit 5934c64

Please sign in to comment.