Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
silentsakky committed Mar 5, 2021
1 parent 730e921 commit 06ef236
Show file tree
Hide file tree
Showing 9 changed files with 2,542 additions and 1,608 deletions.
14 changes: 14 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
extends: [
'eslint-config-synacor'
],
globals: {
zimlet: true
},
rules: {
indent: ['error', 'tab', {
ignoredNodes: ['TemplateLiteral'],
SwitchCase: 1
}]
}
};
4,044 changes: 2,469 additions & 1,575 deletions package-lock.json

Large diffs are not rendered by default.

60 changes: 30 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,74 +43,74 @@
]
},
"devDependencies": {
"@apollo/client": "^3.2.5",
"@babel/cli": "^7.12.1",
"@babel/plugin-proposal-optional-chaining": "^7.12.7",
"@apollo/client": "^3.3.11",
"@babel/cli": "^7.13.0",
"@babel/plugin-proposal-optional-chaining": "^7.13.8",
"audit-ci": "^3.1.1",
"babel-eslint": "^10.1.0",
"eslint": "^7.12.1",
"eslint": "^7.21.0",
"eslint-config-synacor": "^3.0.5",
"graphql": "^15.4.0",
"graphql": "^15.5.0",
"mkdirp": "^1.0.4",
"mockery": "^2.1.0",
"moment": "^2.29.1",
"preact": "^10.5.5",
"preact": "^10.5.12",
"preact-context-provider": "^2.0.0-preactx.2",
"preact-i18n": "^2.3.0-preactx",
"preact-render-to-string": "^5.1.11",
"preact-router": "github:zimbra/preact-router#3.1.0_base_path_support",
"preact-render-to-string": "^5.1.12",
"preact-router": "github:zimbra/preact-router#3.1.1_base_path_support",
"react-redux": "^7.2.2",
"recompose": "^0.30.0",
"rimraf": "^3.0.2"
},
"license": "GPL-3.0",
"dependencies": {
"@babel/core": "^7.12.3",
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/plugin-proposal-decorators": "^7.12.1",
"@babel/plugin-proposal-export-default-from": "^7.12.1",
"@babel/plugin-proposal-export-namespace-from": "^7.12.1",
"@babel/core": "^7.13.8",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/plugin-proposal-decorators": "^7.13.5",
"@babel/plugin-proposal-export-default-from": "^7.12.13",
"@babel/plugin-proposal-export-namespace-from": "^7.12.13",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-object-assign": "^7.12.1",
"@babel/plugin-transform-react-jsx": "^7.12.5",
"@babel/plugin-transform-object-assign": "^7.12.13",
"@babel/plugin-transform-react-jsx": "^7.12.17",
"@babel/polyfill": "^7.12.1",
"@babel/preset-env": "^7.12.1",
"@babel/register": "^7.12.1",
"@babel/runtime": "^7.12.5",
"adm-zip": "^0.4.16",
"babel-loader": "^8.1.0",
"@babel/preset-env": "^7.13.9",
"@babel/register": "^7.13.8",
"@babel/runtime": "^7.13.9",
"adm-zip": "^0.5.3",
"babel-loader": "^8.2.2",
"babel-plugin-add-module-exports": "^1.0.4",
"bundle-loader": "^0.5.6",
"chalk": "^4.1.0",
"console-clear": "^1.1.1",
"copy-webpack-plugin": "^6.3.0",
"copy-webpack-plugin": "^6.4.0",
"cors": "^2.8.5",
"cross-spawn-promise": "^0.10.2",
"css-loader": "^5.0.1",
"css-loader": "^5.1.1",
"file-loader": "^6.2.0",
"get-port": "^5.1.1",
"gittar": "^0.1.1",
"inquirer": "^7.3.3",
"inquirer": "^8.0.0",
"ip": "^1.1.5",
"less": "^3.12.2",
"less": "^4.1.1",
"less-loader": "^7.0.2",
"loader-utils": "^2.0.0",
"log-symbols": "^4.0.0",
"ora": "^5.1.0",
"postcss": "^8.1.6",
"ora": "^5.3.0",
"postcss": "^8.2.7",
"postcss-discard-comments": "^4.0.2",
"postcss-loader": "^4.0.4",
"postcss-loader": "^4.2.0",
"postcss-preset-env": "^6.7.0",
"progress-bar-webpack-plugin": "^2.1.0",
"raw-loader": "^4.0.2",
"resolve-url-loader": "^3.1.2",
"source-map-loader": "^1.1.2",
"source-map-loader": "^1.1.3",
"url-loader": "^4.1.1",
"validate-npm-package-name": "^3.0.0",
"webpack": "^4.44.2",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0",
"webpack-dev-server": "^3.11.2",
"which": "^2.0.2",
"yargs": "^16.1.0"
"yargs": "^16.2.0"
}
}
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,10 @@ export function configure(env) {
require.resolve('@babel/plugin-proposal-export-default-from'),
require.resolve('@babel/plugin-transform-object-assign'),
require.resolve('@babel/plugin-proposal-optional-chaining'),
[require.resolve('@babel/plugin-transform-react-jsx'), { pragma: 'createElement' }]
[require.resolve('@babel/plugin-transform-react-jsx'), {
runtime: 'automatic',
importSource: 'preact'
}]
]
}
},
Expand Down
2 changes: 2 additions & 0 deletions src/shims/@apollo/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const rewriteURIForGET = wrap('rewriteURIForGET');
export const selectHttpOptionsAndBody = wrap('selectHttpOptionsAndBody');
export const selectURI = wrap('selectURI');
export const serializeFetchParameter = wrap('serializeFetchParameter');
export const setLogVerbosity = wrap('setLogVerbosity');
export const Observable = wrap('Observable');
export const isReference = wrap('isReference');
export const makeReference = wrap('makeReference');
Expand All @@ -45,6 +46,7 @@ export const ObservableQuery = wrap('ObservableQuery');
export const disableExperimentalFragmentVariables = wrap('disableExperimentalFragmentVariables');
export const disableFragmentWarnings = wrap('disableFragmentWarnings');
export const enableExperimentalFragmentVariables = wrap('enableExperimentalFragmentVariables');
export const mergeOptions = wrap('mergeOptions');
export const resetCaches = wrap('resetCaches');
export const useApolloClient = wrap('useApolloClient');
export const useLazyQuery = wrap('useLazyQuery');
Expand Down
2 changes: 1 addition & 1 deletion src/shims/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* at `src/shims/${shim}/index.js` and `src/shims/${shim}/${path}/index.js`
*/
exports.SHIMMED_MODULES = [
['preact', 'compat', 'hooks'],
['preact', 'compat', 'hooks', 'jsx-runtime'],
['preact-router', 'match'],
['@apollo/client', 'react/hoc', 'react/components'],
'react-redux',
Expand Down
7 changes: 7 additions & 0 deletions src/shims/preact/compat/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,11 @@ export const SuspenseList = wrap('SuspenseList');
export const lazy = wrap('lazy');
export const __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = wrap('__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED');
export default wrap('default');
export const unstable_ImmediatePriority = wrap('unstable_ImmediatePriority');
export const unstable_UserBlockingPriority = wrap('unstable_UserBlockingPriority');
export const unstable_NormalPriority = wrap('unstable_NormalPriority');
export const unstable_LowPriority = wrap('unstable_LowPriority');
export const unstable_IdlePriority = wrap('unstable_IdlePriority');
export const unstable_runWithPriority = wrap('unstable_runWithPriority');
export const unstable_now = wrap('unstable_now');

1 change: 0 additions & 1 deletion src/shims/preact/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export const Component = wrap('Component');
export const cloneElement = wrap('cloneElement');
export const createContext = wrap('createContext');
export const toChildArray = wrap('toChildArray');
export const __u = wrap('__u');
export const options = wrap('options');

export default global.shims['preact'];
15 changes: 15 additions & 0 deletions src/shims/preact/jsx-runtime/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/** This file is an auto-generated shim, aliased in for "preact/jsx-runtime" in the webpack config.
* When components import 'preact/jsx-runtime', we want to give them back the copy
* Zimbra passed down when it called the factory provided to zimlet().
*/

/* eslint-disable camelcase, dot-notation */
import { warnOnMissingExport } from '../../';
const wrap = warnOnMissingExport.bind(null, global.shims['preact/jsx-runtime'], 'preact/jsx-runtime');

export const Fragment = wrap('Fragment');
export const jsx = wrap('jsx');
export const jsxs = wrap('jsxs');
export const jsxDEV = wrap('jsxDEV');

export default global.shims['preact/jsx-runtime'];

0 comments on commit 06ef236

Please sign in to comment.