Skip to content

Commit d2ddd23

Browse files
committed
npm version script
1 parent 31ec0c6 commit d2ddd23

File tree

3 files changed

+53
-11
lines changed

3 files changed

+53
-11
lines changed

packages/selenium-ide/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"build": "webpack",
1010
"build-prod": "rm -rf build && env NODE_ENV=production yarn build",
1111
"build-chrome": "./build.sh build ../../selenium-ide.pem 1>/dev/null && mkdir -p dist && mv build.crx dist/selenium-ide.crx && echo \"Wrote dist/selenium-ide.crx\"",
12-
"build-firefox": "web-ext sign -s build -a dist --api-key=$AMO_JWT_ISSUER --api-secret=$AMO_JWT_SECRET --id=$(cat ../../.web-extension-id)"
12+
"build-firefox": "web-ext sign -s build -a dist --api-key=$AMO_JWT_ISSUER --api-secret=$AMO_JWT_SECRET --id=$(cat ../../.web-extension-id)",
13+
"version": "node scripts/version.js"
1314
},
1415
"devDependencies": {
1516
"autoprefixer": "^7.1.4",
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Licensed to the Software Freedom Conservancy (SFC) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The SFC licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
// This script will copy over the package.json version over
19+
// to the manifest.version
20+
21+
const fs = require("fs");
22+
const path = require("path");
23+
24+
const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, "../package.json")));
25+
const manifestLocation = path.join(__dirname, "../src/manifest.json");
26+
const manifest = JSON.parse(fs.readFileSync(manifestLocation));
27+
manifest.version_name = pkg.version;
28+
manifest.version = pkg.version.match(/(\d+\.){0,3}\d+/)[0];
29+
fs.writeFileSync(manifestLocation, JSON.stringify(manifest, undefined, 2));

packages/selenium-ide/src/manifest.json

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"description": "Selenium Record and Playback tool for ease of getting acquainted with Selenium WebDriver.",
33
"manifest_version": 2,
44
"name": "Selenium IDE",
5-
"version": "3.2.0.0",
6-
"version_name": "3.2.0",
5+
"version": "3.2.0",
6+
"version_name": "3.2.0-beta.4",
77
"homepage_url": "https://github.com/SeleniumHQ/selenium-ide",
88
"icons": {
99
"16": "icons/icon16.png",
@@ -19,7 +19,6 @@
1919
},
2020
"default_title": "Selenium IDE"
2121
},
22-
2322
"permissions": [
2423
"tabs",
2524
"activeTab",
@@ -33,7 +32,9 @@
3332
"<all_urls>"
3433
],
3534
"externally_connectable": {
36-
"ids": ["*"]
35+
"ids": [
36+
"*"
37+
]
3738
},
3839
"web_accessible_resources": [
3940
"icons/icon128.png",
@@ -44,14 +45,25 @@
4445
"content_security_policy": "script-src 'self'; object-src 'self'",
4546
"content_scripts": [
4647
{
47-
"matches": ["<all_urls>"],
48-
"js": ["assets/vendor/global.js", "assets/vendor/htmlutils.js", "assets/vendor/selenium-browserdetect.js", "assets/polyfills.js", "assets/escape.js", "assets/injector.js", "assets/record.js"],
48+
"matches": [
49+
"<all_urls>"
50+
],
51+
"js": [
52+
"assets/vendor/global.js",
53+
"assets/vendor/htmlutils.js",
54+
"assets/vendor/selenium-browserdetect.js",
55+
"assets/polyfills.js",
56+
"assets/escape.js",
57+
"assets/injector.js",
58+
"assets/record.js"
59+
],
4960
"match_about_blank": true,
5061
"all_frames": true
5162
}
5263
],
53-
"background":
54-
{
55-
"scripts": ["assets/background.js"]
64+
"background": {
65+
"scripts": [
66+
"assets/background.js"
67+
]
5668
}
57-
}
69+
}

0 commit comments

Comments
 (0)