Merge pull request #8295 from ahocevar/build-5

Prepare for building/publishing v5
This commit is contained in:
Andreas Hocevar
2018-06-21 13:59:19 +02:00
committed by GitHub
8 changed files with 48 additions and 10 deletions

View File

@@ -7,7 +7,7 @@
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" type="text/css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="./resources/prism/prism.css" type="text/css">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="./css/ol.css" type="text/css">
<link rel="stylesheet" href="./resources/layout.css" type="text/css">
{{{ extraHead.local }}}
{{{ css.tag }}}

View File

@@ -34,7 +34,7 @@ module.exports = {
common: 'common'
}),
new CopyPlugin([
{from: '../css', to: 'css'},
{from: '../src/ol/ol.css', to: 'css'},
{from: 'data', to: 'data'},
{from: 'resources', to: 'resources'},
{from: 'Jugl.js', to: 'Jugl.js'},

View File

@@ -1,6 +1,6 @@
{
"name": "openlayers",
"version": "5.0.0-beta.12",
"version": "5.0.0-beta.14",
"description": "Build tools and sources for developing OpenLayers based mapping applications",
"keywords": [
"map",
@@ -13,11 +13,13 @@
"pretest": "npm run lint",
"test": "npm run karma -- --single-run",
"karma": "karma start test/karma.config.js",
"serve-examples": "mkdir -p build/examples && webpack --config examples/webpack/config.js --mode development --watch & serve build/examples",
"serve-examples": "webpack-dev-server --config examples/webpack/config.js --mode development --watch",
"build-examples": "webpack --config examples/webpack/config.js --mode production",
"build-index": "node tasks/generate-index",
"prebuild": "npm run build-index",
"build": "rollup --config config/rollup.js",
"set-version": "node tasks/set-version",
"prebuild": "npm run set-version && npm run build-index",
"prepare": "npm run set-version",
"build": "rollup --config config/rollup.js && cleancss --source-map src/ol/ol.css -o build/ol.css",
"presrc-closure": "npm run prebuild",
"src-closure": "node tasks/transform-types",
"pretypecheck": "npm run src-closure",
@@ -80,13 +82,13 @@
"rollup-plugin-node-resolve": "3.3.0",
"rollup-plugin-sourcemaps": "0.4.2",
"rollup-plugin-uglify": "4.0.0",
"serve": "^9.0.0",
"sinon": "^6.0.0",
"uglifyjs-webpack-plugin": "^1.2.5",
"url-polyfill": "^1.0.13",
"walk": "^2.3.9",
"webpack": "4.12.0",
"webpack-cli": "^3.0.3"
"webpack-cli": "^3.0.3",
"webpack-dev-server": "^3.1.4"
},
"eslintConfig": {
"extends": "openlayers"

View File

@@ -13,7 +13,7 @@ import {VERSION, inherits} from './index.js';
*/
const AssertionError = function(code) {
const path = VERSION ? VERSION.split('-')[0] : 'latest';
const path = VERSION.split('-')[0];
/**
* @type {string}

View File

@@ -68,7 +68,7 @@ export {HAS_WEBGL, WEBGL_MAX_TEXTURE_SIZE, WEBGL_EXTENSIONS};
* OpenLayers version.
* @type {string}
*/
export const VERSION = 'v4.6.4';
export const VERSION = '5.0.0-beta.14';
/**

13
src/ol/package.json Normal file
View File

@@ -0,0 +1,13 @@
{
"name": "ol",
"version": "5.0.0-beta.14",
"description": "OpenLayers mapping library",
"main": "index.js",
"module": "index.js",
"license": "BSD-2-Clause",
"dependencies": {
"pbf": "3.1.0",
"pixelworks": "1.1.0",
"rbush": "2.0.2"
}
}

23
tasks/set-version.js Normal file
View File

@@ -0,0 +1,23 @@
const fs = require('fs');
const pkg = require('../package.json');
const index = require.resolve('../src/ol/index');
const lines = fs.readFileSync(index, 'utf-8').split('\n');
const versionRegEx = /const VERSION = '(.*)';$/;
for (let i = 0, ii = lines.length; i < ii; ++i) {
const line = lines[i];
if (versionRegEx.test(line)) {
lines[i] = line.replace(versionRegEx, `const VERSION = '${pkg.version}';`);
break;
}
}
const packageJson = require.resolve('../src/ol/package.json');
const packageJsonObj = JSON.parse(fs.readFileSync(packageJson, 'utf-8'));
packageJsonObj.version = pkg.version;
fs.writeFileSync(packageJson, JSON.stringify(packageJsonObj, null, 2), 'utf-8');
fs.writeFileSync(index, lines.join('\n'), 'utf-8');