Skip to content

Commit

Permalink
chore: update version
Browse files Browse the repository at this point in the history
  • Loading branch information
iosh committed Aug 9, 2024
1 parent 1f104f3 commit a4ee057
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 18 deletions.
4 changes: 1 addition & 3 deletions .env
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# shared basic environment variable
# the build tool will load this file with any NODE_ENV
SNOWPACK_PUBLIC_FLUENT_VERSION=2.6.3
NODE_ENV=production
CI=
SNOWPACK_PUBLIC_SENTRY_DSN=
SNOWPACK_PUBLIC_FLUENT_ENV="production"
SNOWPACK_PUBLIC_FLUENT_VERSION=
SNOWPACK_PUBLIC_FLUENT_ENV="production"
3 changes: 1 addition & 2 deletions .env.development.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ SNOWPACK_PUBLIC_IS_LOCAL_ENV=true
NODE_ENV=development
CI=false
SNOWPACK_PUBLIC_SENTRY_DSN=
SNOWPACK_PUBLIC_FLUENT_ENV="debug-release"
SNOWPACK_PUBLIC_FLUENT_VERSION="0.0.0"
SNOWPACK_PUBLIC_FLUENT_ENV="debug-release"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "helios",
"private": true,
"version": "2.6.2",
"version": "2.6.3",
"workspaces": [
"websites/*",
"packages/doc-ui/*",
Expand Down
3 changes: 3 additions & 0 deletions packages/inner-utils/env.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import browser from 'webextension-polyfill'
import packageJson from '../../package.json'

export const MODE = import.meta.env.NODE_ENV
export const IS_TEST_MODE = MODE === 'test'
Expand All @@ -10,4 +11,6 @@ export const IS_CI = Boolean(
: import.meta.env.CI,
)

export const PACKAGE_VERSION = packageJson.version

export const isManifestV3 = browser.runtime.getManifest().manifest_version === 3
7 changes: 2 additions & 5 deletions packages/popup/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import App from './App'
import './i18n.js'
import {SWRConfig} from 'swr'
import {ROUTES} from './constants'
import {IS_PROD_MODE} from '@fluent-wallet/inner-utils'
import {IS_PROD_MODE, PACKAGE_VERSION} from '@fluent-wallet/inner-utils'
import {
init as initSentry,
capture as sentryCapture,
Expand Down Expand Up @@ -97,7 +97,4 @@ ReactDOM.render(
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
// reportWebVitals()

if (!IS_PROD_MODE)
console.log(
`Fluent Version: ${import.meta.env.SNOWPACK_PUBLIC_FLUENT_VERSION}`,
)
if (!IS_PROD_MODE) console.log(`Fluent Version: ${PACKAGE_VERSION}`)
5 changes: 4 additions & 1 deletion packages/rpcs/wallet_getFluentMetadata/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {optParam} from '@fluent-wallet/spec'
import {PACKAGE_VERSION} from '@fluent-wallet/inner-utils'

export const NAME = 'wallet_getFluentMetadata'

Expand All @@ -14,5 +15,7 @@ export const permissions = {
}

export const main = () => {
return {version: import.meta.env.SNOWPACK_PUBLIC_FLUENT_VERSION}
return {
version: PACKAGE_VERSION,
}
}
4 changes: 3 additions & 1 deletion packages/sentry/computeDefaultOptions.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import {PACKAGE_VERSION} from '@fluent-wallet/inner-utils'

export function getDefaultOptions() {
return {
dsn: import.meta.env.SNOWPACK_PUBLIC_SENTRY_DSN,
environment:
import.meta.env.SNOWPACK_PUBLIC_FLUENT_ENV || import.meta.env.NODE_ENV,
release: import.meta.env.SNOWPACK_PUBLIC_FLUENT_VERSION,
release: PACKAGE_VERSION,
}
}
3 changes: 2 additions & 1 deletion scripts/before_all.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
const {isDev, mustacheRender} = require('./snowpack.utils')
const path = require('path')
const {ensureDirSync} = require('fs-extra')
const {PACKAGE_VERSION} = require('@fluent-wallet/inner-utils')

const extDir = path.resolve(__dirname, '../packages/browser-extension')

ensureDirSync(path.resolve(extDir, 'build'))
ensureDirSync(path.resolve(extDir, 'build/popup'))
ensureDirSync(path.resolve(extDir, 'build/background'))

const version = process.env.SNOWPACK_PUBLIC_FLUENT_VERSION
const version = PACKAGE_VERSION

mustacheRender(
path.resolve(extDir, 'manifest.json.mustache'),
Expand Down
8 changes: 5 additions & 3 deletions scripts/create-zip.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import {PACKAGE_VERSION} from '@fluent-wallet/inner-utils'

const {zip} = require('zip-a-folder')
const path = require('path')
const mkdirp = require('mkdirp')
Expand All @@ -6,9 +8,9 @@ const buildPath = path.resolve(__dirname, '../packages/browser-extension/build')
const targetPath = path.resolve(__dirname, '../releases')
const targetFile = path.resolve(
targetPath,
`fluent-wallet-${
process.env.SNOWPACK_PUBLIC_FLUENT_VERSION || 'na_version'
}-${process.env.GITHUB_SHA || 'na_sha'}.zip`,
`fluent-wallet-${PACKAGE_VERSION || 'na_version'}-${
process.env.GITHUB_SHA || 'na_sha'
}.zip`,
)

;(async function () {
Expand Down
2 changes: 1 addition & 1 deletion scripts/webpack.config.prod.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default merge(webpackConfig, {
path: path.join(path.resolve(), './.env'),
safe: true,
}),
new BundleAnalyzerPlugin(),
// new BundleAnalyzerPlugin(),
],
optimization: {
minimizer: [
Expand Down

0 comments on commit a4ee057

Please sign in to comment.