Unverified Commit 5022d93a authored by yann300's avatar yann300 Committed by GitHub

Merge pull request #653 from ethereum/offlineVersion

package asset (theme files)
parents c22bb962 c8c6c955
...@@ -48,8 +48,7 @@ jobs: ...@@ -48,8 +48,7 @@ jobs:
- run: npm install - run: npm install
- run: npm run lint - run: npm run lint
# - run: npm run lint remix-ide-e2e # - run: npm run lint remix-ide-e2e
- run: npm run build:libs - run: npm run build:libs
- run: npm run downloadsolc_root
- run: npm run build - run: npm run build
- run: - run:
name: Download Selenium name: Download Selenium
...@@ -87,7 +86,6 @@ jobs: ...@@ -87,7 +86,6 @@ jobs:
- run: npm run lint - run: npm run lint
# - run: npm run lint remix-ide-e2e # - run: npm run lint remix-ide-e2e
- run: npm run build:libs - run: npm run build:libs
- run: npm run downloadsolc_root
- run: npm run build - run: npm run build
- run: - run:
name: Download Selenium name: Download Selenium
...@@ -130,7 +128,6 @@ jobs: ...@@ -130,7 +128,6 @@ jobs:
- run: npm run lint - run: npm run lint
# - run: npm run lint remix-ide-e2e # - run: npm run lint remix-ide-e2e
- run: npm run build:libs - run: npm run build:libs
- run: npm run downloadsolc_root
- run: npm run build - run: npm run build
- run: - run:
name: Download Selenium name: Download Selenium
...@@ -167,7 +164,6 @@ jobs: ...@@ -167,7 +164,6 @@ jobs:
- run: npm install - run: npm install
- run: npm run lint - run: npm run lint
- run: npm run build:libs - run: npm run build:libs
- run: npm run downloadsolc_root
- run: npm run build - run: npm run build
- run: - run:
name: Deploy name: Deploy
...@@ -197,7 +193,6 @@ jobs: ...@@ -197,7 +193,6 @@ jobs:
- setup_remote_docker - setup_remote_docker
- run: npm install - run: npm install
- run: npm run build:libs - run: npm run build:libs
- run: npm run downloadsolc_root
- run: npm run build - run: npm run build
- run: ./apps/remix-ide/ci/copy_resources.sh - run: ./apps/remix-ide/ci/copy_resources.sh
- run: ./apps/remix-ide/ci/publishIpfs - run: ./apps/remix-ide/ci/publishIpfs
...@@ -224,7 +219,6 @@ jobs: ...@@ -224,7 +219,6 @@ jobs:
- run: npm install - run: npm install
- run: npm run lint - run: npm run lint
- run: npm run build:libs - run: npm run build:libs
- run: npm run downloadsolc_root
- run: npm run build - run: npm run build
- run: - run:
name: Deploy name: Deploy
...@@ -254,7 +248,6 @@ jobs: ...@@ -254,7 +248,6 @@ jobs:
- run: npm install - run: npm install
- run: npm run lint - run: npm run lint
- run: npm run build:libs - run: npm run build:libs
- run: npm run downloadsolc_root
- run: npm run build - run: npm run build
- run: - run:
name: Deploy name: Deploy
......
...@@ -22,7 +22,7 @@ class CompilerContainer { ...@@ -22,7 +22,7 @@ class CompilerContainer {
timeout: 300, timeout: 300,
allversions: null, allversions: null,
selectedVersion: null, selectedVersion: null,
defaultVersion: 'soljson-v0.7.4+commit.3f05b770.js' // this default version is defined: in makeMockCompiler (for browser test) and in package.json (downloadsolc_root) for the builtin compiler defaultVersion: 'soljson-v0.7.4+commit.3f05b770.js' // this default version is defined: in makeMockCompiler (for browser test)
} }
} }
...@@ -212,6 +212,7 @@ class CompilerContainer { ...@@ -212,6 +212,7 @@ class CompilerContainer {
this._view.versionSelector = yo` this._view.versionSelector = yo`
<select onchange="${this.onchangeLoadVersion.bind(this)}" class="custom-select" id="versionSelector" disabled> <select onchange="${this.onchangeLoadVersion.bind(this)}" class="custom-select" id="versionSelector" disabled>
<option disabled selected>${this.data.defaultVersion}</option> <option disabled selected>${this.data.defaultVersion}</option>
<option disabled>builtin</option>
</select>` </select>`
this._view.languageSelector = yo` this._view.languageSelector = yo`
<select onchange="${this.onchangeLanguage.bind(this)}" class="custom-select" id="compilierLanguageSelector" title="Available since v0.5.7"> <select onchange="${this.onchangeLanguage.bind(this)}" class="custom-select" id="compilierLanguageSelector" title="Available since v0.5.7">
...@@ -452,7 +453,9 @@ class CompilerContainer { ...@@ -452,7 +453,9 @@ class CompilerContainer {
this.queryParams.update({ version: this.data.selectedVersion }) this.queryParams.update({ version: this.data.selectedVersion })
} else if (this.data.selectedVersion === 'builtin') { } else if (this.data.selectedVersion === 'builtin') {
let location = window.document.location let location = window.document.location
location = `${location.protocol}//${location.host}/${location.pathname}` let path = location.pathname
if (!path.startsWith('/')) path = '/' + path
location = `${location.protocol}//${location.host}${path}assets/js`
if (location.endsWith('index.html')) location = location.substring(0, location.length - 10) if (location.endsWith('index.html')) location = location.substring(0, location.length - 10)
if (!location.endsWith('/')) location += '/' if (!location.endsWith('/')) location += '/'
url = location + 'soljson.js' url = location + 'soljson.js'
...@@ -502,18 +505,19 @@ class CompilerContainer { ...@@ -502,18 +505,19 @@ class CompilerContainer {
// fetching both normal and wasm builds and creating a [version, baseUrl] map // fetching both normal and wasm builds and creating a [version, baseUrl] map
async fetchAllVersion (callback) { async fetchAllVersion (callback) {
let allVersions, selectedVersion, allVersionsWasm, isURL let selectedVersion, allVersionsWasm, isURL
let allVersions = [{ path: 'builtin', longVersion: 'latest local version - 0.7.4' }]
// fetch normal builds // fetch normal builds
const binRes = await promisedMiniXhr(`${baseURLBin}/list.json`) const binRes = await promisedMiniXhr(`${baseURLBin}/list.json`)
// fetch wasm builds // fetch wasm builds
const wasmRes = await promisedMiniXhr(`${baseURLWasm}/list.json`) const wasmRes = await promisedMiniXhr(`${baseURLWasm}/list.json`)
if (binRes.event.type === 'error' && wasmRes.event.type === 'error') { if (binRes.event.type === 'error' && wasmRes.event.type === 'error') {
allVersions = [{ path: 'builtin', longVersion: 'latest local version' }]
selectedVersion = 'builtin' selectedVersion = 'builtin'
callback(allVersions, selectedVersion) return callback(allVersions, selectedVersion)
} }
try { try {
allVersions = JSON.parse(binRes.json).builds.slice().reverse() const versions = JSON.parse(binRes.json).builds.slice().reverse()
allVersions = [...allVersions, ...versions]
selectedVersion = this.data.defaultVersion selectedVersion = this.data.defaultVersion
if (this.queryParams.get().version) selectedVersion = this.queryParams.get().version if (this.queryParams.get().version) selectedVersion = this.queryParams.get().version
// Check if version is a URL and corresponding filename starts with 'soljson' // Check if version is a URL and corresponding filename starts with 'soljson'
......
...@@ -5,16 +5,16 @@ import * as packageJson from '../../../../../package.json' ...@@ -5,16 +5,16 @@ import * as packageJson from '../../../../../package.json'
import yo from 'yo-yo' import yo from 'yo-yo'
const themes = [ const themes = [
{ name: 'Dark', quality: 'dark', url: 'https://res.cloudinary.com/lianahus/raw/upload/v1597918237/remix-themes/PR365/remix-dark_tvx1s2.css' }, { name: 'Dark', quality: 'dark', url: 'assets/css/themes/remix-dark_tvx1s2.css' },
{ name: 'Light', quality: 'light', url: 'https://res.cloudinary.com/lianahus/raw/upload/v1597918237/remix-themes/PR365/remix-light_powaqg.css' }, { name: 'Light', quality: 'light', url: 'assets/css/themes/remix-light_powaqg.css' },
{ name: 'Midcentury', quality: 'light', url: 'https://res.cloudinary.com/lianahus/raw/upload/v1598014334/remix-themes/PR365/remix-midcentury_hrzph3.css' }, { name: 'Midcentury', quality: 'light', url: 'assets/css/themes/remix-midcentury_hrzph3.css' },
{ name: 'Black', quality: 'dark', url: 'https://res.cloudinary.com/lianahus/raw/upload/v1598014334/remix-themes/PR365/remix-black_undtds.css' }, { name: 'Black', quality: 'dark', url: 'assets/css/themes/remix-black_undtds.css' },
{ name: 'Candy', quality: 'light', url: 'https://res.cloudinary.com/lianahus/raw/upload/v1598014799/remix-themes/PR365/remix-candy_ikhg4m.css' }, { name: 'Candy', quality: 'light', url: 'assets/css/themes/remix-candy_ikhg4m.css' },
{ name: 'Cerulean', quality: 'light', url: 'https://bootswatch.com/4/cerulean/bootstrap.min.css' }, { name: 'Cerulean', quality: 'light', url: 'assets/css/themes/bootstrap-cerulean.min.css' },
{ name: 'Flatly', quality: 'light', url: 'https://bootswatch.com/4/flatly/bootstrap.min.css' }, { name: 'Flatly', quality: 'light', url: 'assets/css/themes/bootstrap-flatly.min.css' },
{ name: 'Spacelab', quality: 'light', url: 'https://bootswatch.com/4/spacelab/bootstrap.min.css' }, { name: 'Spacelab', quality: 'light', url: 'assets/css/themes/bootstrap-spacelab.min.css' },
{ name: 'Cyborg', quality: 'dark', url: 'https://bootswatch.com/4/cyborg/bootstrap.min.css' } { name: 'Cyborg', quality: 'dark', url: 'assets/css/themes/bootstrap-cyborg.min.css' }
] ]
const profile = { const profile = {
...@@ -32,7 +32,10 @@ export class ThemeModule extends Plugin { ...@@ -32,7 +32,10 @@ export class ThemeModule extends Plugin {
this._deps = { this._deps = {
config: registry.get('config').api config: registry.get('config').api
} }
this.themes = themes.reduce((acc, theme) => ({ ...acc, [theme.name]: theme }), {}) this.themes = themes.reduce((acc, theme) => {
theme.url = window.location.origin + window.location.pathname + theme.url
return { ...acc, [theme.name]: theme }
}, {})
let queryTheme = (new QueryParams()).get().theme let queryTheme = (new QueryParams()).get().theme
queryTheme = this.themes[queryTheme] ? queryTheme : null queryTheme = this.themes[queryTheme] ? queryTheme : null
let currentTheme = this._deps.config.get('settings/theme') let currentTheme = this._deps.config.get('settings/theme')
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -76,8 +76,22 @@ export class RemixAppManager extends PluginManager { ...@@ -76,8 +76,22 @@ export class RemixAppManager extends PluginManager {
} }
async registeredPlugins () { async registeredPlugins () {
const res = await fetch(this.pluginsDirectory) let plugins
const plugins = await res.json() try {
const res = await fetch(this.pluginsDirectory)
plugins = await res.json()
localStorage.setItem('plugins-directory', JSON.stringify(plugins))
} catch (e) {
console.log('getting plugins list from localstorage...')
const savedPlugins = localStorage.getItem('plugins-directory')
if (savedPlugins) {
try {
plugins = JSON.parse(savedPlugins)
} catch (e) {
console.error(e)
}
}
}
plugins.push({ plugins.push({
name: 'walletconnect', name: 'walletconnect',
kind: 'provider', kind: 'provider',
......
...@@ -48,8 +48,8 @@ ...@@ -48,8 +48,8 @@
"build:e2e": "tsc -p apps/remix-ide-e2e/tsconfig.e2e.json", "build:e2e": "tsc -p apps/remix-ide-e2e/tsconfig.e2e.json",
"bumpVersion:libs": "gulp & gulp syncLibVersions;", "bumpVersion:libs": "gulp & gulp syncLibVersions;",
"browsertest": "sleep 5 && npm run nightwatch_local", "browsertest": "sleep 5 && npm run nightwatch_local",
"csslint": "csslint --ignore=order-alphabetical --errors='errors,duplicate-properties,empty-rules' --exclude-list='apps/remix-ide/assets/css/font-awesome.min.css' apps/remix-ide/assets/css/", "csslint": "csslint --ignore=order-alphabetical --errors='errors,duplicate-properties,empty-rules' --exclude-list='apps/remix-ide/src/assets/css/font-awesome.min.css' apps/remix-ide/src/assets/css/",
"downloadsolc_root": "wget --no-check-certificate https://solc-bin.ethereum.org/bin/soljson-v0.7.4+commit.3f05b770.js -O ./apps/remix-ide/soljson.js", "downloadsolc_assets": "wget --no-check-certificate https://solc-bin.ethereum.org/bin/soljson-v0.7.4+commit.3f05b770.js -O ./apps/remix-ide/src/assets/js/soljson.js",
"make-mock-compiler": "node apps/remix-ide/ci/makeMockCompiler.js", "make-mock-compiler": "node apps/remix-ide/ci/makeMockCompiler.js",
"minify": "uglifyjs --in-source-map inline --source-map-inline -c warnings=false", "minify": "uglifyjs --in-source-map inline --source-map-inline -c warnings=false",
"nightwatch_parallel": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=chrome,firefox", "nightwatch_parallel": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=chrome,firefox",
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
"selenium": "selenium-standalone start", "selenium": "selenium-standalone start",
"selenium-install": "selenium-standalone install", "selenium-install": "selenium-standalone install",
"sourcemap": "exorcist --root ../ apps/remix-ide/build/app.js.map > apps/remix-ide/build/app.js", "sourcemap": "exorcist --root ../ apps/remix-ide/build/app.js.map > apps/remix-ide/build/app.js",
"test-browser": "npm-run-all -lpr selenium downloadsolc_root make-mock-compiler serve browsertest", "test-browser": "npm-run-all -lpr selenium make-mock-compiler serve browsertest",
"watch": "watchify apps/remix-ide/src/index.js -dv -p browserify-reload -o apps/remix-ide/build/app.js --exclude solc", "watch": "watchify apps/remix-ide/src/index.js -dv -p browserify-reload -o apps/remix-ide/build/app.js --exclude solc",
"reinstall": "rm ./node-modules/ -rf & rm package-lock.json & rm ./build/ -rf & npm install & npm run build", "reinstall": "rm ./node-modules/ -rf & rm package-lock.json & rm ./build/ -rf & npm install & npm run build",
"ganache-cli": "npx ganache-cli" "ganache-cli": "npx ganache-cli"
......
...@@ -59,7 +59,6 @@ ...@@ -59,7 +59,6 @@
"**/node_modules/**", "**/node_modules/**",
"apps/remix-ide/build/**/*.js", "apps/remix-ide/build/**/*.js",
"apps/remix-ide/src/app/editor/mode-solidity.js", "apps/remix-ide/src/app/editor/mode-solidity.js",
"apps/remix-ide/soljson.js",
"apps/remix-ide/js/**/*.js", "apps/remix-ide/js/**/*.js",
"apps/remix-ide/src/assets/js/**/*.js" "apps/remix-ide/src/assets/js/**/*.js"
] ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment