This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"tools": [ | |
{ | |
"type": "function", | |
"function": { | |
"name": "codebase_search", | |
"description": "Find snippets of code from the codebase most relevant to the search query.\nThis is a semantic search tool, so the query should ask for something semantically matching what is needed.\nIf it makes sense to only search in particular directories, please specify them in the target_directories field.\nUnless there is a clear reason to use your own search query, please just reuse the user's exact query with their wording.\nTheir exact wording/phrasing can often be helpful for the semantic search query. Keeping the same exact question format can also be helpful.", | |
"parameters": { | |
"type": "object", | |
"properties": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
const {ModuleFederationPlugin} = require('webpack').container; | |
const {RuntimeGlobals, RuntimeModule} = require('webpack'); | |
const path = require('path'); | |
const deps = require('./package.json').dependencies; | |
class Testing123RuntimeModule extends RuntimeModule { | |
constructor() { | |
super('testing123', RuntimeModule.STAGE_BASIC + 1); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******/ // load script equivalent for server side | |
/******/ __webpack_require__.l = function(url,callback,chunkId) { | |
/******/ if(!global.__remote_scope__) { | |
/******/ // create a global scope for container, similar to how remotes are set on window in the browser | |
/******/ global.__remote_scope__ = { | |
/******/ _config: {}, | |
/******/ } | |
/******/ } | |
/******/ | |
/******/ function executeLoad(url, callback, name) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { injectScript } from '@module-federation/utilities'; | |
// example of dynamic remote import on server and client | |
const isServer = typeof window === 'undefined'; | |
//could also use | |
// getModule({ | |
// remoteContainer: { | |
// global: 'app2', | |
// url: 'http://localhost:3002/remoteEntry.js', | |
// }, | |
// modulePath: './sample' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function recursiveMap(children, fn) { | |
return React.Children.map(children, (child) => { | |
if (!React.isValidElement(child)) { | |
return child; | |
} | |
if (child.props.children) { | |
child = React.cloneElement(child, { | |
children: recursiveMap(child.props.children, fn), | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const withLocalCSS = (nextConfig = {}) => Object.assign({}, nextConfig, { | |
webpack: (config, options) => { | |
const nextCssLoaders = config.module.rules.find(rule => typeof rule.oneOf === 'object'); | |
// .module.css | |
if (nextCssLoaders) { | |
nextCssLoaders.oneOf.forEach( | |
(rule) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Modified version of @lingui/loader. | |
// Current version does not read message catalogs correctly. | |
// https://github.com/lingui/js-lingui/blob/388464825440b7df3f20a549e425399f8a64c0b7/packages/loader/src/index.js | |
const path = require("path"); | |
const { getConfig } = require("@lingui/conf"); | |
const { createCompiledCatalog, configureCatalog } = require("@lingui/cli/api"); | |
const loaderUtils = require("loader-utils"); | |
// Check if JavascriptParser and JavascriptGenerator exists -> Webpack 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const PLUGIN_NAME = "MutateRuntimePlugin"; | |
class MutateRuntimePlugin { | |
/** | |
* | |
* @param {FederationDashboardPluginOptions} options | |
*/ | |
constructor(options) {} | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"publicPath": "http://localhost:3001/", | |
"federationRemoteEntry": { | |
"rendered": true, | |
"initial": true, | |
"entry": true, | |
"recorded": false, | |
"size": 7355, | |
"sizes": { | |
"javascript": 42, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var chunkMap = {}/******/ (function(modules) { // webpackBootstrap | |
/******/ // install a JSONP callback for chunk loading | |
/******/ function webpackJsonpCallback(data) { | |
/******/ var chunkIds = data[0]; | |
/******/ var moreModules = data[1]; | |
/******/ var executeModules = data[2]; | |
/******/ | |
/******/ // add "moreModules" to the modules object, | |
/******/ // then flag all "chunkIds" as loaded and fire callback | |
/******/ var moduleId, chunkId, i = 0, resolves = []; |
NewerOlder