Skip to content

Commit

Permalink
fix extension versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
krisboit committed Mar 15, 2019
1 parent dd0a9ff commit bf2780d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
15 changes: 6 additions & 9 deletions scripts/update-extension-version.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
const fs = require('fs');
const resolve = require('path').resolve;
const manifest = require('../src/extension/manifest.json');
const BUILD = process.env.TRAVIS_BUILD_NUMBER;
const VERSION_FILE_PATH = resolve(__dirname, '../src/extension/version.ts');
const packageJson = require('../package.json');

const VERSION_PATTERN = `export const VERSION = "%%VERSION%%";`;
manifest.version = packageJson.version;

let VER = manifest.version;
if (BUILD) {
VER += '.' + BUILD;
}

fs.writeFileSync(VERSION_FILE_PATH, VERSION_PATTERN.replace('%%VERSION%%', VER));
fs.writeFileSync(
resolve(__dirname, '../src/extension/manifest.json'),
JSON.stringify(manifest, null, 4)
);
6 changes: 3 additions & 3 deletions src/extension/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import { Blockchain } from 'moonlet-core/src/core/blockchain';
import { createLoadWallet } from '../app/data/wallet/actions';
import { ExtensionWalletProvider } from './wallet-provider';

import { VERSION } from './version';
import { browser } from 'webextension-polyfill-ts';
import { createSetPreferences } from '../app/data/user-preferences/actions';
import { createUpdateConversionRates } from '../app/data/currency/actions';
import { getSwitchNetworkConfig } from '../app/utils/blockchain/utils';

import manifest from './manifest.json';

const USER_PREFERENCES_STORAGE_KEY = 'userPref';

Expand All @@ -37,7 +37,7 @@ const store = getStore({
selectedAccount: 0
},
extension: {
version: VERSION
version: manifest.version
},
userPreferences: undefined
});
Expand Down
2 changes: 1 addition & 1 deletion src/extension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Moonlet Wallet",
"version": "0.4",
"version": "0.0.0",
"description": "Moonlet Wallet Extension",
"permissions": ["storage"],
"background": {
Expand Down
1 change: 0 additions & 1 deletion src/extension/version.ts

This file was deleted.

3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"keyofStringsOnly": true,
"noImplicitAny": false,
"allowSyntheticDefaultImports": true,
"typeRoots": ["node_modules/@types"]
"typeRoots": ["node_modules/@types"],
"resolveJsonModule": true
}
}

0 comments on commit bf2780d

Please sign in to comment.