Skip to content

Commit

Permalink
update bower refs to npm refs
Browse files Browse the repository at this point in the history
  • Loading branch information
shaundillon committed Aug 22, 2017
1 parent 84118d8 commit 4ef2428
Show file tree
Hide file tree
Showing 31 changed files with 78 additions and 73 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/build/
/node_modules/
/bower_components/
/vendor/
/examples/build.js
.tern-port
Expand Down
4 changes: 2 additions & 2 deletions .tern-project
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"requirejs": {
"baseURL": "./src",
"paths": {
"html-janitor": "./bower_components/html-janitor/src/html-janitor",
"lodash-amd": "../bower_components/lodash-amd"
"html-janitor": "./node_modules/html-janitor/src/html-janitor",
"lodash-amd": "../node_modules/lodash-amd"
}
},
"node": {}
Expand Down
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ sudo: false
cache:
directories:
- node_modules
- bower_components

before_script:
- npm install -g bower
- bower install
- npm install
script: TEST_SERVER_PORT=8090 npm test
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 4.0.0

- Builds using [webpack 2](https://webpack.js.org/)
- Switches to [npm](https://npmjs.com)-only dependency management and publishing, removing [bower](https://bower.io/) support.
- Updates dependencies

These changes are the first in a wide-ranging modernisation process that scribe will be going through.

# 3.3.0

Merges a range of bug fixes including removing the dependency on lodash, use of ES6 `const` not inserting `<br>` tags into custom elements and a sanity check to ensure a `listElement` exists before inserting a list.
Expand Down
22 changes: 14 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,18 @@ Please see the [wiki](https://github.com/guardian/scribe/wiki/Testing) for detai

## Releasing

### npm
* `git checkout master`.
* Update `CHANGELOG.md`
* Update the version number in `package.json`
* Commit with message of `v<number>`
* `git push`
* Run `npm publish`

### Bower

** NOTE: as of version 4.0.0, Scribe is no longer distributed via Bower. **

* `git checkout master`
* Run `./release.sh [ <newversion> | major | minor | patch | build ]` (we use
[mversion](https://github.com/mikaelbr/mversion#usage-cli)). (If releasing a
Expand All @@ -30,15 +41,10 @@ Please see the [wiki](https://github.com/guardian/scribe/wiki/Testing) for detai
If you are, run `git push; git push --tags`. (The `dist` tree is for
distribution via Bower).

### npm
* `git checkout master`.
* Update `CHANGELOG.md`
* Update the version number in `package.json`
* Commit with message of `v<number>`
* `git push`
* Run `npm publish`

### Update example

** NOTE: as of version 4.0.0, Scribe is no longer distributed via Bower. **

* `git checkout gh-pages`
* `git pull`
* Update necessary dependency versions in `bower.json`. Check `bower ls` to see
Expand Down
4 changes: 2 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ module.exports = function(grunt) {
baseUrl: "src",
name: "scribe",
paths: {
'lodash-amd': '../bower_components/lodash-amd',
'immutable': '../bower_components/immutable/dist/immutable'
'lodash-amd': '../node_modules/lodash-amd',
'immutable': '../node_modules/immutable/dist/immutable'
},
optimize: optimize,
preserveLicenseComments: false,
Expand Down
8 changes: 2 additions & 6 deletions Plumbing.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

var all = require('plumber-all');
// var bower = require('plumber-bower');
var glob = require('plumber-glob');
var requireJS = require('plumber-requirejs');
var uglifyJS = require('plumber-uglifyjs')();
Expand All @@ -16,8 +15,8 @@ module.exports = function (pipelines) {
// FIXME: auto?
preserveLicenseComments: false,
paths: {
'lodash-amd': '../bower_components/lodash-amd',
'immutable': '../bower_components/immutable/dist/immutable'
'lodash-amd': '../node_modules/lodash-amd',
'immutable': '../node_modules/immutable/dist/immutable'
}
});

Expand All @@ -30,9 +29,6 @@ module.exports = function (pipelines) {
/* jshint -W069 */

pipelines['build'] = [
// TODO: use bower operation to find main of this component?
// As per: https://github.com/bower/bower/issues/1090
// bower('scribe'),
glob('./src/scribe.js'),
mainRequireJS,
// Send the resource along these branches
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Scribe patches [many browser inconsistencies][browser inconsistencies] in the [n

## Installation
```
bower install scribe
npm install scribe-editor
```

Alternatively, you can [access the distribution files through GitHub releases](https://github.com/guardian/scribe/releases).
Expand Down
5 changes: 2 additions & 3 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
machine:
node:
version: 5
version: 6

dependencies:
pre:
- npm install -g bower
- bower install
- npm install
- ./setup.sh
2 changes: 1 addition & 1 deletion examples/amd-inline.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
editor using RequireJS and the AMD module syntax.
Note that you'll need to install scribe's dependencies through
`bower install`. See http://bower.io/ if you are unfamiliar.
`npm install`. See http://npmjs.com if you are unfamiliar.
-->
<style>
button {
Expand Down
4 changes: 2 additions & 2 deletions examples/amd.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
editor using RequireJS and the AMD module syntax.
Note that you'll need to install scribe's dependencies through
`bower install`. See http://bower.io/ if you are unfamiliar.
`npm install`. See https://npmjs.com/ if you are unfamiliar.
-->
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

Expand Down Expand Up @@ -34,7 +34,7 @@
height: 10em;
}
</style>
<script src="../bower_components/requirejs/require.js"></script>
<script src="../node_modules/requirejs/require.js"></script>
<script>
require({
paths: {
Expand Down
4 changes: 2 additions & 2 deletions examples/build.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
editor using RequireJS and the AMD module syntax.
Note that you'll need to install scribe's dependencies through
`bower install`. See http://bower.io/ if you are unfamiliar.
`npm install`. See https://npmjs.com/ if you are unfamiliar.
-->
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style>
Expand Down Expand Up @@ -33,7 +33,7 @@
height: 10em;
}
</style>
<script src="../bower_components/requirejs/require.js"></script>
<script src="../node_modules/requirejs/require.js"></script>
<script>
require({
paths: {
Expand Down
2 changes: 1 addition & 1 deletion examples/no-undo-manager.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
editor using RequireJS and the AMD module syntax.
Note that you'll need to install scribe's dependencies through
`bower install`. See http://bower.io/ if you are unfamiliar.
`npm install`. See https://npmjs.com/ if you are unfamiliar.
-->
<style>
button {
Expand Down
2 changes: 1 addition & 1 deletion examples/raw-inline.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
editor using RequireJS and the AMD module syntax.
Note that you'll need to install scribe's dependencies through
`bower install`. See http://bower.io/ if you are unfamiliar.
`npm install`. See https://npmjs.com/ if you are unfamiliar.
-->
<style>
button {
Expand Down
2 changes: 1 addition & 1 deletion examples/raw.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
editor using RequireJS and the AMD module syntax.
Note that you'll need to install scribe's dependencies through
`bower install`. See http://bower.io/ if you are unfamiliar.
`npm install`. See https://npmjs.com/ if you are unfamiliar.
-->
<style>
button {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scribe-editor",
"version": "3.3.0",
"version": "4.0.0",
"license": "Apache-2.0",
"main": "src/scribe.js",
"dependencies": {
Expand Down Expand Up @@ -32,7 +32,7 @@
"scribe-plugin-inline-styles-to-elements": "guardian/scribe-plugin-inline-styles-to-elements#master"
},
"scripts": {
"test": "mochaTest",
"test": "mocha",
"build": "webpack -p src/scribe.js build/scribe.min.js",
"build-dev": "webpack src/scribe.js build/scribe.js"
},
Expand Down
1 change: 0 additions & 1 deletion setup.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

npm install
bower install

# Download the selenium JAR
SELENIUM_VERSION=2.41.0
Expand Down
10 changes: 5 additions & 5 deletions test-old/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
</head>
<body>
<div class="scribe"></div>
<script src="../../bower_components/requirejs/require.js"></script>
<script src="../../node_modules/requirejs/require.js"></script>
<script>
require.config({
paths: {
'scribe-common': '../../bower_components/scribe-common',
'lodash-amd': '../../bower_components/lodash-amd',
'html-janitor': '../../bower_components/html-janitor/html-janitor',
'immutable': '../../bower_components/immutable/dist/immutable'
'scribe-common': '../../node_modules/scribe-common',
'lodash-amd': '../../node_modules/lodash-amd',
'html-janitor': '../../node_modules/html-janitor/html-janitor',
'immutable': '../../node_modules/immutable/dist/immutable'
}
});
</script>
Expand Down
2 changes: 1 addition & 1 deletion test-old/block-mode.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('block mode', function () {
describe('blockquotes', function () {
beforeEach(function () {
return driver.executeAsyncScript(function (done) {
require(['../../bower_components/scribe-plugin-blockquote-command/src/scribe-plugin-blockquote-command'], function (blockquoteCommand) {
require(['../../node_modules/scribe-plugin-blockquote-command/src/scribe-plugin-blockquote-command'], function (blockquoteCommand) {
window.scribe.use(blockquoteCommand());
done();
});
Expand Down
10 changes: 5 additions & 5 deletions test-old/formatters.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ describe('formatters', function () {
describe('convert new lines to HTML', function () {
beforeEach(function () {
return driver.executeAsyncScript(function (done) {
require(['../../bower_components/scribe-plugin-formatter-plain-text-convert-new-lines-to-html/src/scribe-plugin-formatter-plain-text-convert-new-lines-to-html'], function (convertNewLinesToHtmlFormatter) {
require(['../../node_modules/scribe-plugin-formatter-plain-text-convert-new-lines-to-html/src/scribe-plugin-formatter-plain-text-convert-new-lines-to-html'], function (convertNewLinesToHtmlFormatter) {
window.scribe.use(convertNewLinesToHtmlFormatter());
done();
});
Expand Down Expand Up @@ -242,7 +242,7 @@ describe('formatters', function () {
when('the sanitizer plugin is enabled', function () {
beforeEach(function () {
return driver.executeAsyncScript(function (done) {
require(['../../bower_components/scribe-plugin-sanitizer/src/scribe-plugin-sanitizer'], function (scribePluginSanitizer) {
require(['../../node_modules/scribe-plugin-sanitizer/src/scribe-plugin-sanitizer'], function (scribePluginSanitizer) {
window.scribe.use(scribePluginSanitizer({ tags: { p: {} } }));
done();
});
Expand Down Expand Up @@ -281,7 +281,7 @@ describe('formatters', function () {
describe('normalization phase', function () {
beforeEach(function () {
return driver.executeAsyncScript(function (done) {
require(['../../bower_components/scribe-plugin-sanitizer/src/scribe-plugin-sanitizer'], function (scribePluginSanitizer) {
require(['../../node_modules/scribe-plugin-sanitizer/src/scribe-plugin-sanitizer'], function (scribePluginSanitizer) {
window.scribe.use(scribePluginSanitizer({
tags: {
p: {}
Expand Down Expand Up @@ -310,7 +310,7 @@ describe('formatters', function () {
describe('trim whitespace', function () {
beforeEach(function () {
return driver.executeAsyncScript(function (done) {
require(['../../bower_components/scribe-plugin-sanitizer/src/scribe-plugin-sanitizer'], function (scribePluginSanitizer) {
require(['../../node_modules/scribe-plugin-sanitizer/src/scribe-plugin-sanitizer'], function (scribePluginSanitizer) {
window.scribe.use(scribePluginSanitizer({
tags: {
p: {}
Expand Down Expand Up @@ -344,7 +344,7 @@ describe('formatters', function () {
* The file below contains the formatter which corrects invalid HTML,
* ideally it should live in core and we wouldn't need to require it
**/
require(['../../bower_components/scribe-plugin-sanitizer/src/scribe-plugin-sanitizer'], function (scribePluginSanitizer) {
require(['../../node_modules/scribe-plugin-sanitizer/src/scribe-plugin-sanitizer'], function (scribePluginSanitizer) {
window.scribe.use(scribePluginSanitizer({
tags: { p: {}, b: {} }}));
done();
Expand Down
4 changes: 2 additions & 2 deletions test-old/unit/children.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require('node-amd-require')({
baseUrl: __dirname,
paths: {
'lodash-amd': '../../bower_components/lodash-amd',
'immutable': '../../bower_components/immutable'
'lodash-amd': '../../node_modules/lodash-amd',
'immutable': '../../node_modules/immutable'
}
});

Expand Down
4 changes: 2 additions & 2 deletions test-old/unit/config.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
require('node-amd-require')({
baseUrl: __dirname,
paths: {
'lodash-amd': '../../bower_components/lodash-amd',
'immutable': '../../bower_components/immutable'
'lodash-amd': '../../node_modules/lodash-amd',
'immutable': '../../node_modules/immutable'
}
});

Expand Down
4 changes: 2 additions & 2 deletions test-old/unit/event-emitter.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require('node-amd-require')({
baseUrl: __dirname,
paths: {
'lodash-amd': '../../bower_components/lodash-amd',
'immutable': '../../bower_components/immutable'
'lodash-amd': '../../node_modules/lodash-amd',
'immutable': '../../node_modules/immutable'
}
});

Expand Down
4 changes: 2 additions & 2 deletions test-old/unit/mutations.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require('node-amd-require')({
baseUrl: __dirname,
paths: {
'lodash-amd': '../../bower_components/lodash-amd',
'immutable': '../../bower_components/immutable'
'lodash-amd': '../../node_modules/lodash-amd',
'immutable': '../../node_modules/immutable'
}
});

Expand Down
4 changes: 2 additions & 2 deletions test-old/unit/node.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require('node-amd-require')({
baseUrl: __dirname,
paths: {
'lodash-amd': '../../bower_components/lodash-amd',
'immutable': '../../bower_components/immutable'
'lodash-amd': '../../node_modules/lodash-amd',
'immutable': '../../node_modules/immutable'
}
});

Expand Down
4 changes: 2 additions & 2 deletions test/children.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require('node-amd-require')({
baseUrl: __dirname,
paths: {
'lodash-amd': '../../bower_components/lodash-amd',
'immutable': '../../bower_components/immutable'
'lodash-amd': '../../node_modules/lodash-amd',
'immutable': '../../node_modules/immutable'
}
});

Expand Down
4 changes: 2 additions & 2 deletions test/config.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
require('node-amd-require')({
baseUrl: __dirname,
paths: {
'lodash-amd': '../../bower_components/lodash-amd',
'immutable': '../../bower_components/immutable'
'lodash-amd': '../../node_modules/lodash-amd',
'immutable': '../../node_modules/immutable'
}
});

Expand Down
4 changes: 2 additions & 2 deletions test/event-emitter.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require('node-amd-require')({
baseUrl: __dirname,
paths: {
'lodash-amd': '../../bower_components/lodash-amd',
'immutable': '../../bower_components/immutable'
'lodash-amd': '../../node_modules/lodash-amd',
'immutable': '../../node_modules/immutable'
}
});

Expand Down
Loading

0 comments on commit 4ef2428

Please sign in to comment.