Commit 54c566d2 by Jason Zhou

fix app App issue

parent 8a5fbded
...@@ -15,11 +15,16 @@ handlebars.registerHelper('if_eq', function(a, b, opts) { ...@@ -15,11 +15,16 @@ handlebars.registerHelper('if_eq', function(a, b, opts) {
const restoreLegacyCodes = () => { const restoreLegacyCodes = () => {
log.title('📤 Restore previous codes') log.title('📤 Restore previous codes')
LEGACY_CODES.forEach(file => { LEGACY_CODES.regulars.forEach(file => {
log.item(`Restoring ${file} ...`) log.item(`Restoring ${file} ...`)
const basename = path.basename(file) const basename = path.basename(file)
fs.copyFileSync(`${__dirname}/codes/old/${basename}`, file) fs.copyFileSync(`${__dirname}/codes/old/${basename}`, file)
}) })
LEGACY_CODES.exceptions.forEach(file => {
log.item(`Restoring ${file} ...`)
const basename = path.basename(file)
fs.copyFileSync(`${__dirname}/codes/old/exceptions/${basename}`, file)
})
} }
const updateConfigs = (mode = 'chill') => { const updateConfigs = (mode = 'chill') => {
...@@ -45,11 +50,16 @@ const restoreConfigs = () => { ...@@ -45,11 +50,16 @@ const restoreConfigs = () => {
} }
const updateCodes = () => { const updateCodes = () => {
LEGACY_CODES.forEach(file => { LEGACY_CODES.regulars.forEach(file => {
const basename = path.basename(file) const basename = path.basename(file)
log.item(`Updating ${basename} ...`) log.item(`Updating ${basename} ...`)
fs.copyFileSync(`${__dirname}/codes/new/${basename}`, file) fs.copyFileSync(`${__dirname}/codes/new/${basename}`, file)
}) })
LEGACY_CODES.exceptions.forEach(file => {
const basename = path.basename(file)
log.item(`Updating ${basename} ...`)
fs.copyFileSync(`${__dirname}/codes/new/exceptions/${basename}`, file)
})
} }
const updatePackages = () => { const updatePackages = () => {
......
[ {
"package.json", "regulars": [
"yarn.lock", "package.json",
"config/fonts.json", "yarn.lock",
"Procfile", "config/fonts.json",
"fe/js/App.es6", "Procfile",
"fe/js/blog.client.es6", "fe/js/blog.client.es6",
"fe/js/BlogEditor.es6", "fe/js/BlogEditor.es6",
"fe/js/components/HtmlComponent.es6", "fe/js/components/HtmlComponent.es6",
"fe/js/components/page_settings_dialog/NewDomainsTab.es6", "fe/js/components/page_settings_dialog/NewDomainsTab.es6",
"fe/js/EcommerceManager.es6", "fe/js/EcommerceManager.es6",
"fe/js/editor.es6", "fe/js/editor.es6",
"fe/js/Landing.es6", "fe/js/Landing.es6",
"fe/js/MainDashboard.es6", "fe/js/MainDashboard.es6",
"fe/js/page.client.es6", "fe/js/page.client.es6",
"fe/js/PortfolioManager.es6", "fe/js/PortfolioManager.es6",
"fe/js/stores/font_store.es6", "fe/js/stores/font_store.es6",
"fe/js/utils/helpers/EcommerceHelper.es6", "fe/js/utils/helpers/EcommerceHelper.es6",
"fe/js/v3_bridge/page_analytics_engine.es6", "fe/js/v3_bridge/page_analytics_engine.es6",
"fe/js/v4_bridge/Bridge.es6", "fe/js/v4_bridge/Bridge.es6",
"fe/lib/webpack/entries-generation-webpack-plugin.js", "fe/lib/webpack/entries-generation-webpack-plugin.js",
"fe/manifests/verticals/app.js", "fe/manifests/verticals/app.js",
"fe/manifests/verticals/bright.js", "fe/manifests/verticals/bright.js",
"fe/manifests/verticals/fresh.js", "fe/manifests/verticals/fresh.js",
"fe/manifests/verticals/glow.js", "fe/manifests/verticals/glow.js",
"fe/manifests/verticals/ion.js", "fe/manifests/verticals/ion.js",
"fe/manifests/verticals/minimal.js", "fe/manifests/verticals/minimal.js",
"fe/manifests/verticals/onyx_new.js", "fe/manifests/verticals/onyx_new.js",
"fe/manifests/verticals/persona.js", "fe/manifests/verticals/persona.js",
"fe/manifests/verticals/personal.js", "fe/manifests/verticals/personal.js",
"fe/manifests/verticals/perspective.js", "fe/manifests/verticals/perspective.js",
"fe/manifests/verticals/pitch_new.js", "fe/manifests/verticals/pitch_new.js",
"fe/manifests/verticals/profile.js", "fe/manifests/verticals/profile.js",
"fe/manifests/verticals/s5-theme.js", "fe/manifests/verticals/s5-theme.js",
"fe/manifests/verticals/sleek.js", "fe/manifests/verticals/sleek.js",
"fe/manifests/verticals/spectre.js", "fe/manifests/verticals/spectre.js",
"fe/manifests/verticals/zine.js", "fe/manifests/verticals/zine.js",
"fe/nextgen/app.es6", "fe/nextgen/app.es6",
"fe/scripts/fonts/generateFontsJson.js" "fe/scripts/fonts/generateFontsJson.js"
] ],
"exceptions": ["fe/js/App.es6"]
}
require('./init')
// This component will be the entry point for our entire app based on new architecture design from
// this document: https://striking.quip.com/gazxA3ZruIrs
// It curently only includes very limited functionality, but the goal is to gradually move everything
// to be bootstrap from here
import $ from 'jquery'
import EditorStore from 'js/stores/editor_store'
import EditPage from 'js/v3_bridge/edit_page_bridge'
import * as i18nHelper from 'js/utils/helpers/i18nHelper'
import 'js/vendor/jquery/jquery.ba-hashchange.min'
// HACK: setup event object (v3 legacy, only a fix for old code)
// v3 code still relay on event to communicate with iframes
let Event = null
window.edit_page = EditPage
if (parent.window.edit_page && parent.window.edit_page.Event) {
Event = parent.window.edit_page.Event
EditPage.Event = Event
} else {
Event = EditPage.Event
if (parent.window.edit_page) {
parent.window.edit_page.Event = Event
} else {
parent.window.edit_page = {
Event
}
}
}
const p1 = import(`locales/${i18nHelper.getTranslationFile()}`)
Promise.all([p1])
.then(([poFile]) => {
const I18n = require('js/utils/i18n')
I18n.init(poFile)
$(() => {
const cloudinary = require('cloudinary')
const ConfStore = require('js/stores/conf_store')
cloudinary.config('cloud_name', ConfStore.getCloudinaryCloudName())
const ctx = EditorStore.init()
const ReactAppManager = require('js/v4_bridge/react_app_bridge/ReactAppManager')
ReactAppManager.init(ctx)
// TODO: use react router
$(window).hashchange(() => {
const appName = document.location.hash.replace('#', '')
if (appName !== '') {
ReactAppManager.loadApp(appName)
}
})
$(window).hashchange()
})
})
.catch(e => console.error(e))
if (module.hot) {
module.hot.accept(err => {
if (err) {
console.error(err)
}
})
}
require('./init')
// This component will be the entry point for our entire app based on new architecture design from
// this document: https://striking.quip.com/gazxA3ZruIrs
// It curently only includes very limited functionality, but the goal is to gradually move everything
// to be bootstrap from here
import $ from 'jquery'
import EditorStore from 'js/stores/editor_store'
import EditPage from 'js/v3_bridge/edit_page_bridge'
import * as i18nHelper from 'js/utils/helpers/i18nHelper'
import 'js/vendor/jquery/jquery.ba-hashchange.min'
// HACK: setup event object (v3 legacy, only a fix for old code)
// v3 code still relay on event to communicate with iframes
let Event = null
window.edit_page = EditPage
if (parent.window.edit_page && parent.window.edit_page.Event) {
Event = parent.window.edit_page.Event
EditPage.Event = Event
} else {
Event = EditPage.Event
if (parent.window.edit_page) {
parent.window.edit_page.Event = Event
} else {
parent.window.edit_page = {
Event,
}
}
}
const p1 = require(`promise-loader?global!locales/${i18nHelper.getTranslationFile()}`)
Promise.all([p1()])
.then(([poFile]) => {
const I18n = require('js/utils/i18n')
I18n.init(poFile)
$(() => {
const cloudinary = require('cloudinary')
const ConfStore = require('js/stores/conf_store')
cloudinary.config('cloud_name', ConfStore.getCloudinaryCloudName())
const ctx = EditorStore.init()
const ReactAppManager = require('js/v4_bridge/react_app_bridge/ReactAppManager')
ReactAppManager.init(ctx)
// TODO: use react router
$(window).hashchange(() => {
const appName = document.location.hash.replace('#', '')
if (appName !== '') {
ReactAppManager.loadApp(appName)
}
})
$(window).hashchange()
})
})
.catch(e => console.error(e))
if (module.hot) {
module.hot.accept(err => {
if (err) {
console.error(err)
}
})
}
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