{"name":"@module-federation/sdk","version":"0.8.2","keywords":["Module Federation","sdk"],"author":{"name":"zhanghang","email":"hanric.zhang@gmail.com"},"license":"MIT","_id":"@module-federation/sdk@0.8.2","maintainers":[{"name":"gioboa","email":"giorgiob.boa@gmail.com"},{"name":"zackljackson","email":"zackary.l.jackson@gmail.com"},{"name":"tysonrm","email":"tyson.midboe@gmail.com"},{"name":"ranshamay","email":"ranshamay@gmail.com"},{"name":"heal","email":"TwoHeal@163.com"},{"name":"valorkin","email":"valorkin@gmail.com"},{"name":"zackarychapple","email":"zackarychapple30@gmail.com"},{"name":"ilteoood","email":"matteopietro.dazzi@gmail.com"}],"dist":{"shasum":"2b94ef0962a4cdc6189d88cf039539bace4906db","tarball":"http://registry-npm.ywwl.com/@module-federation/sdk/download/@module-federation/sdk-0.8.2.tgz","fileCount":35,"integrity":"sha512-MgVoflK9j7+Kmecnpjxb2GyjsESwFDs7oD4B21iv7VzS09YS6lXsEeiLJggVhUA2j1iuC25tSBpY/MwybYLbPg==","signatures":[{"sig":"MEQCIBisUyMGAoI0jZRVfYoln6hPzlAKpzC/j9TwywJ7DPl7AiAC56L1NjmYMkycKzDCpOvD/gj0Vm+2Vcphbbg2oQvUQg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103179,"size":22993,"noattachment":false,"key":"/@module-federation/sdk/-/@module-federation/sdk-0.8.2.tgz"},"main":"./dist/index.cjs.js","_from":"file:module-federation-sdk-0.8.2.tgz","types":"./dist/index.cjs.d.ts","module":"./dist/index.esm.mjs","exports":{".":{"types":"./dist/index.cjs.d.ts","import":"./dist/index.esm.mjs","require":"./dist/index.cjs.js"},"./normalize-webpack-path":{"types":"./dist/normalize-webpack-path.cjs.d.ts","import":"./dist/normalize-webpack-path.esm.mjs","require":"./dist/normalize-webpack-path.cjs.js"}},"_npmUser":{"name":"zackljackson","email":"zackary.l.jackson@gmail.com"},"_resolved":"/tmp/b3414440277a3f59de32a87c2d240edd/module-federation-sdk-0.8.2.tgz","_integrity":"sha512-MgVoflK9j7+Kmecnpjxb2GyjsESwFDs7oD4B21iv7VzS09YS6lXsEeiLJggVhUA2j1iuC25tSBpY/MwybYLbPg==","_npmVersion":"10.8.2","description":"A sdk for support module federation","directories":{},"sideEffects":false,"_nodeVersion":"18.20.5","dependencies":{"isomorphic-rslog":"0.0.6"},"publishConfig":{"access":"public"},"typesVersions":{"*":{".":["./dist/index.cjs.d.ts"],"normalize-webpack-path":["./dist/normalize-webpack-path.cjs.d.ts"]}},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sdk_0.8.2_1733899666933_0.8438986589808153","host":"s3://npm-registry-packages-npm-production"},"readme":"# `@module-federation/sdk` Documentation\n\n- This SDK provides utilities and tools to support the implementation of Module Federation in your projects.\n- It contains utility functions for parsing, encoding, and decoding module names, as well as generating filenames for exposed modules and shared packages.\n- It also includes a logger for debugging and environment detection utilities.\n- Additionally, it provides a function to generate a snapshot from a manifest and environment detection utilities.\n\n## Usage\n\n```javascript\n// The SDK can be used to parse entry strings, encode and decode module names, and generate filenames for exposed modules and shared packages.\n// It also includes a logger for debugging and environment detection utilities.\n// Additionally, it provides a function to generate a snapshot from a manifest and environment detection utilities.\nimport { parseEntry, encodeName, decodeName, generateExposeFilename, generateShareFilename, createLogger, isBrowserEnv, isBrowserEnvValue, isDebugMode, getProcessEnv, generateSnapshotFromManifest } from '@module-federation/sdk';\n\n// Parse an entry string into a RemoteEntryInfo object\nparseEntry('entryString');\n\n// Encode a module name with a prefix and optional extension\nencodeName('moduleName', 'prefix');\n\n// Decode a module name with a prefix and optional extension\ndecodeName('encodedModuleName', 'prefix');\n\n// Generate a filename for an exposed module\ngenerateExposeFilename('exposeName', true);\n\n// Generate a filename for a shared package\ngenerateShareFilename('packageName', true);\n\n// Create a logger\nconst logger = createLogger('identifier');\n\n// Check if the current environment is a browser\nconst inBrowser = isBrowserEnv();\nconst inBrowserStatic = isBrowserEnvValue;\n\n// Check if the current environment is in debug mode\nisDebugMode();\n\n// Get the process environment\ngetProcessEnv();\n\n// Generate a snapshot from a manifest\ngenerateSnapshotFromManifest(manifest, options);\n```\n\n### parseEntry\n\n- Type: `parseEntry(str: string, devVerOrUrl?: string, separator?: string) `\n- Parses a string into a RemoteEntryInfo object.\n\n### encodeName\n\n- Type: `encodeName(name: string, prefix?: string, withExt?: boolean)`\n- Encodes a name with a prefix and optional extension.\n\n### decodeName\n\n- Type: `decodeName(name: string, prefix?: string, withExt?: boolean)`\n- Decodes a name with a prefix and optional extension.\n\n### generateExposeFilename\n\n- Type: `generateExposeFilename(exposeName: string, withExt: boolean)`\n- Generates a filename for an expose.\n\n### generateShareFilename\n\n- Type: `generateShareFilename(pkgName: string, withExt: boolean)`\n- Generates a filename for a shared package.\n\n### createLogger\n\n- Type: `createLogger(prefix: string)`\n- Creates a logger for debugging.\n\n### isBrowserEnv\n\n- Type: `isBrowserEnv(): boolean`\n- Checks if the current environment is a browser.\n\n### isBrowserEnvValue\n\n- Type: `isBrowserEnvValue: boolean`\n- Static browser environment flag (tree-shakable when ENV_TARGET is defined).\n\n### isDebugMode\n\n- Type: `isDebugMode()`\n- Checks if the current environment is in debug mode.\n\n### getProcessEnv\n\n- Type: `getProcessEnv()`\n- Gets the process environment.\n\n### generateSnapshotFromManifest\n\n- Type: `generateSnapshotFromManifest(manifest: Manifest, options?: IOptions)`\n- Generates a snapshot from a manifest.\n\n## Testing\n\nThe SDK uses Jest for testing. The configuration can be found in `jest.config.js`. The tests are located in the **tests** directory.\n","publish_time":1733899667137,"_cnpm_publish_time":1733899667137,"dist-tags":{"canary":"1.1.0-canary.1","experimental":"0.0.0-feat-node-support-1703050615268","latest":"2.9.3","next":"0.0.0-feat-enhanced-runtime-unification-20261110060527"}}