{"id":13532402,"url":"https://github.com/layer-pack/layer-pack","last_synced_at":"2025-04-01T20:32:02.889Z","repository":{"id":55871799,"uuid":"166390187","full_name":"layer-pack/layer-pack","owner":"layer-pack","description":"Webpack plugin to make inheritable npm packages / webpack configs, (a)sync glob imports, and mono repo apps ","archived":false,"fork":false,"pushed_at":"2024-11-25T08:24:56.000Z","size":484,"stargazers_count":29,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T21:01:56.477Z","etag":null,"topics":["boilerplate","codepipeline","extend","glob","glob-imports","inheritance","inherited-packages","modularization","mono-repository","monorepo","namespace","sass","webpack","webpack-glob"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/layer-pack.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-18T10:48:33.000Z","updated_at":"2025-03-17T19:55:56.000Z","dependencies_parsed_at":"2024-06-19T01:52:49.446Z","dependency_job_id":"2e09c564-06b2-4739-b975-efb2ad944a3a","html_url":"https://github.com/layer-pack/layer-pack","commit_stats":{"total_commits":285,"total_committers":4,"mean_commits":71.25,"dds":"0.038596491228070184","last_synced_commit":"748a025ce2f6531ed80bdbd0cfa098b6c8324858"},"previous_names":["n8tz/webpack-inherit"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/layer-pack%2Flayer-pack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/layer-pack%2Flayer-pack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/layer-pack%2Flayer-pack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/layer-pack%2Flayer-pack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/layer-pack","download_url":"https://codeload.github.com/layer-pack/layer-pack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246709923,"owners_count":20821297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["boilerplate","codepipeline","extend","glob","glob-imports","inheritance","inherited-packages","modularization","mono-repository","monorepo","namespace","sass","webpack","webpack-glob"],"created_at":"2024-08-01T07:01:10.713Z","updated_at":"2025-04-01T20:31:57.865Z","avatar_url":"https://github.com/layer-pack.png","language":"JavaScript","readme":"\n\u003cp align=\"center\"\u003e\u003cimg  width=\"192\" src =\"https://github.com/layer-pack/layer-pack/raw/master/doc/assets/logo.svg?sanitize=true\" /\u003e\u003c/p\u003e\n\u003cbr/\u003e\n\u003cp align=\"center\"\u003e\nWebpack plugin to make inheritable code layers, named glob imports, easy monorepo / multi packages app \u0026 shared webpack configs\n\u003c/p\u003e\n\u003ch1\u003e\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://www.npmjs.com/package/layer-pack\"\u003e\n\u003cimg src=\"https://img.shields.io/npm/v/layer-pack.svg\" alt=\"NPM\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://travis-ci.org/n8tz/layer-pack-samples\"\u003e\n\u003cimg src=\"https://travis-ci.org/n8tz/layer-pack-samples.svg?branch=master\" alt=\"Build Status\" /\u003e\u003c/a\u003e\n\u003cimg src=\"https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat\" /\u003e\n\u003c/p\u003e\n\n## Why Layer-pack ?\n\nLayer-pack is a webpack plugin allowing better code modularity, maintainability and flexibility by solving some of the most major problems of large JS/TS applications :\n\n- The first one, we often have to multiply internal imports in the project files. This usually leads to complex maintenance and (too) many import and require statements.\n- The second is that we cannot easily \"extend\" an existing application, we are still forced to create various interfacing systems and APIs, maintain separates build configurations and dependencies lists.\n\nLayer pack solve these problems and many others by enhancing imports \u0026 resolving :\n\n- It allows to use glob patterns in import \u0026 requires statements\n  - So we can import files and a directory tree without specifying all of their names. Yes, just paste files \u0026 play mode :)\n- It literally allows to \"inherit\" packages or \"app layers\", including theirs dependencies and webpack build configurations\n  - So you can easily \u0026 smartly split you're app in some \"app layer\" like : app.core, app.models, app.www, app.api, app.admin, app.config... \n- It \"namespaces\" the application files\n  - So we can use absolute imports where we shouldn't use relative paths,\n- Additionally, it allows to \"templatize\" webpack build configs and define multiples \"inheritable\" profiles on a unique \"app layer\" package.\n  - This mean that a unique package can expose multiples layers or bootstraps\n\n## Check the samples [here](https://github.com/n8tz/layer-pack-samples)\n\n## Small doc [here](doc/DOC.MD)\n\n## You... like it / it saved your day / you stole all the code / you want more?\n\n[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](#)\n\nBTC     : bc1qh43j8jh6dr8v3f675jwqq3nqymtsj8pyq0kh5a\u003cbr/\u003e\nPaypal  : \u003cspan class=\"badge-paypal\"\u003e\u003ca href=\"https://www.paypal.com/donate/?hosted_button_id=ECHYGKY3GR7CN\" title=\"Donate to this project using Paypal\"\u003e\u003cimg src=\"https://img.shields.io/badge/paypal-donate-yellow.svg\" alt=\"PayPal donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\n\n## Features by samples :\n\n### Namespace you're application\n\nSo you can stop using easily broken relative imports :\n\n```jsx\n// import stuff from \"../../../config\"; // no more\nimport stuff from \"App/config\"; // aw yeah\n```\n\n### Use glob patterns in imports statements\n\nJust import them all :\n\n```jsx\nimport allModules from \"App/modules/*.module.js\";\n// or\n// import allModules from \"App/modules/*/index.js\";\n```\n\nJust import them all and convert directories \u0026 files names to JS named exports :\n\n```jsx\n// or using es6 named exports\nimport AllActionsByStoreName from \"App/store/(*)/actions.js\";\n// or\nimport {MyCompByFileName} from \"App/ui/components/(*).jsx\"; // ( big import list to maintain ) no more ! :)\n// or\nimport {myFolder} from \"App/ui/components/(**/*).jsx\"; // ( walk \u0026 set myFolder/MyComp in myFolder.MyComp )\n\n// or\n// walk \u0026 set myFolder/MyComp in myFolder.MyComp using Loadable Components / webpack chuncks:\nimport {myFolder} from \"App/ui/components/(**/*).jsx?using=ReactLoadable\"; \n\n// also available : LazyReact, SuspenseReact ( lazy with suspense )\n```\n\nGlob imports also work in Scss :\n\n```scss\n\n@import \"App/ui/**/*.scss\"; // 1 import to rulz them all\n\n```\n\n### Split you're projects into multiple inheritable npm packages \n\n- inherit \u0026 share most of the code between projects\n- Include or not layers like dev tools, admin, etc\n- Switch between monorepo and npm dependencies structure\n- Test layers independently\n- Compile in 1 step, with the source map\n- Use multiple dev servers sharing the same code layers\n\n### Easily override inherited project\n\nBy enhancing / replacing any file\n\n```jsx\nimport $super from \"$super\";// require the 1st file with the same path name in the inherited packages\n\n// Add some stuff or HOCs fn\nexport default class MyOverrided extend $super{\n//...\n}\n```\n\n```scss\n@import \"$super\";\n\n// do some css additions\n.theSameWithA{\n    backgroud : red;\n}\n```\n\n### Inherit, use \u0026 extend multiple webpack config from dependencies packages\n\nSo you can share, version, extend \u0026 switch your webpack conf \u0026 boilerplate via npm\n\n## Check the samples [here](https://github.com/n8tz/layer-pack-samples)\n\n## Small doc [here](doc/DOC.MD)\n\n## Things to know\n\n- Node builds include the (node_)modules relative directories locations to preserve inherited dependencies ( if they are not included in the builds )\n- Sass imports have limitations from the sass package: it doesn't tell the files path that call imports, so scss files must import using absolute paths ( eg: App/assets/stuff.jpg, not ./assets/stuff.jpg )\n- Context based webpack requires are not processed by layer-pack, they have the normal webpack behavior\n- New versions of Yarn mess too much with the modules structure, resolving \u0026 management, it can't be used with layer-pack anymore  \n \n## Alternative to\n\n - Splitting big projects in thousands of modules\n - Lerna, others mono-repo tool chains \u0026 defining messy yarn workspaces ...\n\n## Contributors ?\n\n[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](#)\n\n\u003c!-- BACKERS/ --\u003e\n\n\u003ch3\u003eSponsors\u003c/h3\u003e\n\nBecome a sponsor!\n\n\u003cspan class=\"badge-paypal\"\u003e\u003ca href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=YNJZ6NQYVPTPE\" title=\"Donate to this project using Paypal\"\u003e\u003cimg src=\"https://img.shields.io/badge/paypal-donate-yellow.svg\" alt=\"PayPal donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n[![*](https://www.google-analytics.com/collect?v=1\u0026tid=UA-82058889-1\u0026cid=555\u0026t=event\u0026ec=project\u0026ea=view\u0026dp=%2Fproject%2Flayer-pack\u0026dt=readme)](#)\n\n## You... like it / it saved your day / you stole all the code / you want more?\n\n[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](#)\n\nBTC     : bc1qh43j8jh6dr8v3f675jwqq3nqymtsj8pyq0kh5a\u003cbr/\u003e\nPaypal  : \u003cspan class=\"badge-paypal\"\u003e\u003ca href=\"https://www.paypal.com/donate/?hosted_button_id=ECHYGKY3GR7CN\" title=\"Donate to this project using Paypal\"\u003e\u003cimg src=\"https://img.shields.io/badge/paypal-donate-yellow.svg\" alt=\"PayPal donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n","funding_links":["https://www.paypal.com/donate/?hosted_button_id=ECHYGKY3GR7CN","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=YNJZ6NQYVPTPE"],"categories":["构建系统和依赖性管理工具"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flayer-pack%2Flayer-pack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flayer-pack%2Flayer-pack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flayer-pack%2Flayer-pack/lists"}