Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

Commit

Permalink
Publish Tweeks (adazzle#622)
Browse files Browse the repository at this point in the history
* Fixed examples publish

* Fixed editable example

* Can't use node on script delegator

* Fixed HMR

* Updated lerna version

* Fixed get next version

* Fix get current version

* Fixed major version on main entry

* Deleted sorry

* Change getnext version script

* Update npmrc.enc and secure variable

* Updated npmrc enc

* Reverted getNextVersion changes

* Updated lerna to last release

* Updated npmrc.enc

* Updated npmrc

* New secret key
  • Loading branch information
diogofcunha authored Jan 27, 2017
1 parent 7166161 commit dc3e3a8
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .npmrc.enc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
't򝡖i Hff��@�t���=n/���blEQJk�ɇx�ׄ���(
��2@�� ��aH����-����R�·
��g�S�#
H9��B�����6���%r��S�l��2P,���G�۾�\�OI�E��7�}�Z�m��[{"S
Expand Down
5 changes: 1 addition & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ environment:
access_token:
secure: dHfUgllfTEAqpcoz3iQj8TO0DGh8n90Coqf0+IXT0bIRNSIxGTDu991X+FStY613
npmrc_token:
secure: /9XWoCG/xQ2+rJpht0B5kA==
secure: jG6oWTaTCoL72ZhDYY8ipA==


# Install scripts. (runs after repo cloning)
Expand Down Expand Up @@ -50,9 +50,6 @@ test_script:
# Don't run MS build step
build: off

#cache:
# - '%AppData%\npm-cache -> package.json'

on_success:
# If it is not a scheduled build/pr build and the current branch is master publish a new package.
# If it is not build on master publish npm tag.
Expand Down
2 changes: 1 addition & 1 deletion ci/publish/getCurrentVersion.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var semver = require('semver');
fs = require('fs')
json = JSON.parse(fs.readFileSync('./package.json', 'utf8'))
json = JSON.parse(fs.readFileSync('./packages/react-data-grid/package.json', 'utf8'))
process.stdout.write(json.version);
2 changes: 1 addition & 1 deletion ci/publish/getNextVersion.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var semver = require('semver');
fs = require('fs')
json = JSON.parse(fs.readFileSync('./package.json', 'utf8'))
json = JSON.parse(fs.readFileSync('./packages/react-data-grid/package.json', 'utf8'))
var execSync = require('child_process').execSync,
child;

Expand Down
19 changes: 18 additions & 1 deletion ci/publish/publishExamples.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
const ghpages = require('gh-pages');
const path = require('path');
const copydir = require('copy-dir');
const fs = require('fs');

const copyDistFolder = () => {
const srcDistPath = path.join(__dirname, '../../packages/react-data-grid-examples/src/dist');

try {
fs.mkdirSync(srcDistPath);
} catch (e) {
if ( e.code !== 'EEXIST' ) throw e;
}

copydir.sync(
path.join(__dirname, '../../packages/react-data-grid-examples/dist'),
srcDistPath);
};

const publishToGhPages = () => {
ghpages.publish(
path.join(__dirname, '../../packages/react-data-grid-examples'),
path.join(__dirname, '../../packages/react-data-grid-examples/src'),
(err) => {
if (err) throw new Error(err);
}
);
};

copyDistFolder();
publishToGhPages();
2 changes: 1 addition & 1 deletion ci/publish/publishMaster.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if($?)
{
./node_modules/.bin/lerna publish --message "Version bump [ci skip]" --yes
if($?){
Write-Host "regenerating public site and examples"
Write-Host "Regenerating public site and examples"
node ./ci/publish/publishExamples.js
}
}
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"lerna": "2.0.0-beta.32",
"lerna": "2.0.0-beta.34",
"version": "2.0.1"
}
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-data-grid",
"version": "2.0.0",
"version": "2.0.1",
"description": "Data grid for React",
"main": "src/index.js",
"scripts": {
Expand Down Expand Up @@ -52,6 +52,7 @@
"babel-preset-es2015": "^6.9.0",
"babel-preset-es2015-loose": "^7.0.0",
"babel-preset-react": "^6.3.13",
"copy-dir": "^0.3.0",
"css-loader": "^0.26.0",
"del": "^1.2.1",
"enzyme": "^2.4.1",
Expand All @@ -78,7 +79,7 @@
"karma-phantomjs-launcher": "^0.1.4",
"karma-phantomjs-launcher-nonet": "^0.1.3",
"karma-webpack": "^1.7.0",
"lerna": "2.0.0-beta.32",
"lerna": "2.0.0-beta.34",
"minimist": "^1.1.0",
"mkdirp": "^0.5.1",
"moment": "^2.10.6",
Expand All @@ -91,8 +92,8 @@
"react-addons-test-utils": "^15.4.2",
"react-addons-transition-group": "^15.4.2",
"react-dnd-test-backend": "^1.0.2",
"react-dom": "^15.4.2",
"react-docgen": "^2.8.2",
"react-dom": "^15.4.2",
"rewire": "^2.1.3",
"rewire-webpack": "^1.0.0",
"run-sequence": "^1.2.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-data-grid-examples/src/scriptDelegator.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const isDevEnv = () => window.location.hostname === 'localhost';

const delegateScript = fileName => {
let src = isDevEnv() ? `http://localhost:8080/${fileName}` : `../dist/${fileName}`;
let src = isDevEnv() ? `http://localhost:8080/${fileName}` : `dist/${fileName}`;

let script = document.createElement('script');
script.setAttribute('src', src);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,16 @@ const Example = React.createClass({
return this.state.rows[i];
},

handleRowUpdated({ rowIdx, updated }) {
// merge updated row with current row and rerender by setting state
const rows = this.state.rows;
Object.assign(rows[rowIdx], updated);
this.setState({rows: rows});
handleGridRowsUpdated({ fromRow, toRow, updated }) {
let rows = this.state.rows;

for (let i = fromRow; i <= toRow; i++) {
let rowToUpdate = rows[i];
let updatedRow = React.addons.update(rowToUpdate, {$merge: updated});
rows[i] = updatedRow;
}

this.setState({ rows });
},

render() {
Expand All @@ -84,7 +89,7 @@ const Example = React.createClass({
rowGetter={this.rowGetter}
rowsCount={this.state.rows.length}
minHeight={500}
onRowUpdated={this.handleRowUpdated} />);
onGridRowsUpdated={this.handleGridRowsUpdated} />);
}
});

Expand All @@ -96,5 +101,5 @@ module.exports = exampleWrapper({
exampleName: 'Editable Example',
exampleDescription,
examplePath: './scripts/example04-editable.js',
examplePlaygroundLink: 'https://jsfiddle.net/k7tfnw1n/6/'
examplePlaygroundLink: 'https://jsfiddle.net/k7tfnw1n/10/'
});
9 changes: 3 additions & 6 deletions webpack-dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,10 @@ const specificConfig = {
};

const config = Object.assign({ }, webpackCommon, specificConfig);
const entries = config.entry;

for (const key in entries) {
if (entries.hasOwnProperty(key)) {
entries[key].unshift('webpack-dev-server/client?http://localhost:8080/', 'webpack/hot/dev-server');
}
}
config.entry.index.unshift('webpack-dev-server/client?http://localhost:8080/', 'webpack/hot/dev-server');
config.entry.shared.unshift('webpack-dev-server/client?http://localhost:8080/', 'webpack/hot/dev-server');
config.entry.examples.unshift('webpack-dev-server/client?http://localhost:8080/', 'webpack/hot/dev-server');

const compiler = webpack(config);
const server = new WebpackDevServer(compiler, {
Expand Down

0 comments on commit dc3e3a8

Please sign in to comment.