{"id":23635367,"url":"https://github.com/filefoxper/pmnps","last_synced_at":"2026-04-15T09:31:33.672Z","repository":{"id":44384728,"uuid":"512136393","full_name":"filefoxper/pmnps","owner":"filefoxper","description":"a monorepo project creator","archived":false,"fork":false,"pushed_at":"2022-08-09T11:54:29.000Z","size":153,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-19T04:09:27.266Z","etag":null,"topics":["common-package-manage","monorepo","nodejs","npm","platforms","without-build-common-package"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/filefoxper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-09T08:42:20.000Z","updated_at":"2023-01-29T06:25:55.000Z","dependencies_parsed_at":"2022-07-14T14:31:23.298Z","dependency_job_id":null,"html_url":"https://github.com/filefoxper/pmnps","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/filefoxper/pmnps","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filefoxper%2Fpmnps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filefoxper%2Fpmnps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filefoxper%2Fpmnps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filefoxper%2Fpmnps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/filefoxper","download_url":"https://codeload.github.com/filefoxper/pmnps/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filefoxper%2Fpmnps/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31834510,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T07:17:56.427Z","status":"ssl_error","status_checked_at":"2026-04-15T07:17:30.007Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["common-package-manage","monorepo","nodejs","npm","platforms","without-build-common-package"],"created_at":"2024-12-28T05:34:11.253Z","updated_at":"2026-04-15T09:31:33.641Z","avatar_url":"https://github.com/filefoxper.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm][npm-image]][npm-url]\n[![standard][standard-image]][standard-url]\n\n[npm-image]: https://img.shields.io/npm/v/pmnps.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/pmnps\n[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square\n[standard-url]: http://npm.im/standard\n\n# pmnps\n\n`pmnps` is a monorepo tool, it uses `npm workspaces` to manage packages and platforms.\n\n## Other language\n\n[中文](https://github.com/filefoxper/pmnps/blob/master/README_zh.md)\n\n## Install\n\n```\nnpm install pmnps -g\n```\n\nor\n\n```\nnpm install pmnps --save-dev\n```\n\n## Basic usage\n\n### use pmnps\n\n```\n$ pmnps\n```\n\nafter running:\n\n```\n- project\n  - node_modules\n  - packages\n  - plats\n  package.json\n  .pmnpsrc.json\n```\n\nThis command can create a monorepo project and install the `dependencies \u0026 devDependencies` into root `node_modules`.\n\n### use create command\n\n#### create a package\n\n```\n$ pmnps create package -n test\n```\n\nafter running:\n\n```\n- project\n  - node_modules\n  - packages\n    - test\n      - src\n      index.ts\n      package.json\n  - plats\n  package.json\n  .pmnpsrc.json\n```\n\n#### create a platform\n\n```\n$ pmnps platform -n web-test\n```\n\nafter running:\n\n```\n- project\n  - node_modules\n  - packages\n    - test\n      - src\n      index.ts\n      package.json\n  - plats\n    - web-test\n      -src\n        index.tsx\n      package.json\n  package.json\n  .pmnpsrc.json\n```\n\nThis command can add a package or a platform, and install the `dependencies \u0026 devDependencies` into root `node_modules`.\n\n### use refresh command\n\n```\n$ pmnps refresh\n```\n\nafter running:\n\n```\n- project\n  - node_modules\n  - packages\n    - test\n      - src\n      index.ts\n      package.json\n  - plats\n    - web-test\n      -src\n        index.tsx\n      package.json\n  package.json\n  .pmnpsrc.json\n```\n\nThis command can install all the dependencies and devDependencies from `packages` and `platforms` into the root `node_modules`.\n\n### use start command\n\nThe `start` command can start a platform development. It runs `npm start` command in platform `package.json \u003e scripts.start`.\n\n```\n$ pmnps start\n```\n\nor\n\n```\n$ pmnps start -n \u003cplatform\u003e\n```\n\n### use build command\n\nThe `build` command can build platforms. It runs `npm run build` command in platform `package.json \u003e scripts.build`.\n\n```\n# build all platforms\n$ pmnps build\n```\n\nor\n\n```\n# build a special platform\n$ pmnps build -n \u003cplatform name\u003e\n```\n\nIf you want to build with a mode you set with command `config`, you can use option param `-m \u003cmode\u003e`.\n\n```\n$ pmnps build -n \u003cplatform name\u003e -m \u003cmode\u003e\n```\n\nIf you want to install dependencies before build, you can use option param `-i`.\n\n```\n$ pmnps build -n \u003cplatform name\u003e -m \u003cmode\u003e -i\n```\n\nIf you want to add param to npm build script, you can use option param `-p \u003cparam\u003e`.\n\n```\n$ pmnps build -p \"-i -e \u003cparam desc\u003e\"\n```\n\nNotice, the usage about `-p` below is global for all building platforms, if you want assign the params to platforms which you want params work on, you can use the url query param to replace it.\n\n```\n# it looks like url query param \"?name1=param1\u0026name2=param2\"\n$ pmnps build -p \"?platA= -i -e \u003cparam desc\u003e\u0026platB= -i\"\n```\n\n### use config command\n\nThe `config` command allows you to do more configs. You can open `git usage`, `rename workspace` and add `build mode` for your project. The `build mode` is a string word which will be added into your `package.json \u003e scripts` like `scripts.build-\u003cmode\u003e`, when you use command `build` with option `-m \u003cmode\u003e`, it runs `npm run build-\u003cmode\u003e` script.\n\n```\n$ pmnps config\n```\n\noptions:\n\n```\nrename workspace              # rename the workspace name\nactive/disable git            # active or disable git usage\nlock/unlock                   # lock or unlock the config\npackage build strict/loose    # the package create mode\nprivate/public project        # set packages or platforms 'private'\n```\n\nThe package build mode `loose`, creates a `index file` directly in the root dir of package, that means you can use this package as a module in your platform project, and it does not need to build alone, you can build the platform directly, just like the package dependence is just a part module in platform.\n\nThe package build mode `strict`, creates a `index file` in a `src` dir. If you are using typescript, you may find that almost all the popular code editors can not find the dependency codes from package, but it works well, so, you have to write `index.d.ts` file to resolve this problem. And in this mode, you can build packages and publish it into `npm` manually.\n\n### use template command\n\nThe `template` command can help you build some templates for `packages` and `plats`. When you use `pack` or `plat` command to build a project, it can be helpful.\n\n```\n$ pmnps template\n```\n\n### use publish command\n\nThe `publish` command can help you publish the packages and platforms.\n\n```\n$ pmnps publish\n```\n\nIf you have set one password, please use `-o` to pass it in.\n\n```\n$ pmnps publish -o 123456\n```\n\n## Package.json config\n\nNow, you can add `pmnps` property into your package.json in platforms or packages.\n\n### platform config platDependencies\n\nAdd `pmnps.platDependencies` config to describe the build dependencies in platforms.\n\nplatA -\u003e package.json\n\n```\n{\n  \"private\": true,\n  \"name\": \"platA\",\n  \"version\": \"0.0.1\",\n  \"scripts\": {\n    \"start\": \"...start\",\n    \"build\": \"... build\",\n    \"build-inside\": \".... build inside mode\" \n  },\n  \"pmnps\": {\n    \"platDependencies\": [\n      \"platB\"\n    ]\n  }\n}\n```\n\nplatB -\u003e package.json\n\n```\n{\n  \"private\": true,\n  \"name\": \"platB\",\n  \"version\": \"0.0.1\",\n  \"scripts\": {\n    \"start\": \"...start\",\n    \"build\": \"... build\",\n    \"build-inside\": \".... build inside mode\" \n  },\n  \"pmnps\": {\n    \"platDependencies\": [\n      \"platC\"\n    ]\n  }\n}\n```\n\nplatC -\u003e package.json\n\n```\n{\n  \"private\": true,\n  \"name\": \"platC\",\n  \"version\": \"0.0.1\",\n  \"scripts\": {\n    \"start\": \"...start\",\n    \"build\": \"... build\",\n    \"build-inside\": \".... build inside mode\" \n  }\n}\n```\n\nSo, when use command `build`, it will follow the `platDependencies` build one by one, `build platC -\u003e build platB -\u003e build platA`.\n\n### platform config ownRoot\n\nAdd `pmnps.ownRoot` config to describe a platform which installs `node_modules` in own root folder.\n\n```\n{\n  \"private\": true,\n  \"name\": \"platB\",\n  \"version\": \"0.0.1\",\n  \"scripts\": {\n    \"start\": \"...start\",\n    \"build\": \"... build\",\n    \"build-inside\": \".... build inside mode\" \n  },\n  \"pmnps\": {\n    \"ownRoot\": true\n  }\n}\n```\n\n### platform config alias\n\nAdd `pmnps.alias` config to give your platform a alias name.\n\n```\n{\n  \"private\": true,\n  \"name\": \"platB\",\n  \"version\": \"0.0.1\",\n  \"scripts\": {\n    \"start\": \"...start\",\n    \"build\": \"... build\",\n    \"build-inside\": \".... build inside mode\" \n  },\n  \"pmnps\": {\n    \"alias\": \"pb\"\n  }\n}\n```\n\nThe alias name can only works with `build -p` command option currently.\n\n```\n# it looks like url query param \"?name1=param1\u0026name2=param2\"\n$ pmnps build -p \"?platA= -i -e \u003cparam desc\u003e\u0026platB= -i\"\n\n# use alias\n$ pmnps build -p \"?pb= -i\"\n```\n\n### platform config alias\n\n`pmnps.buildHook` provides two synchronous scripts `before` and `after` hook to every platform building.\n\n```\n{\n  \"private\": true,\n  \"name\": \"platB\",\n  \"version\": \"0.0.1\",\n  \"scripts\": {\n    \"start\": \"...start\",\n    \"build\": \"... build\",\n    \"build-inside\": \".... build inside mode\" \n  },\n  \"pmnps\": {\n    \"buildHook\": {\n      \"before\":\"echo build start...\",\n      \"after\":\"echo build end...\"\n    }\n  }\n}\n```\n\nUse `build -p`, we can provide params for `before` or `after` scripts.\n\n```\n$ pmnps build -p \"?platB.before= -i -e \u003cword\u003e\"\n```\n\n## .pmnpsrc.json\n\nThe file `pmnpsrc.json` is the config file for whole root project, it contains `workspace name`, `git usage`, `lock flag` and `plugins`.\n\n```\n{\n  \"workspace\": \"workspace\",\n  \"git\": true,\n  \"lock\": true,\n  \"plugins\": [\"pmnps-dependencies-detect-plugin\"]\n}\n```\n\n## plugins\n\nThe plugins is added from `pmnps@2.0.0`, you can write plugins and publish them to `npm`, or pick the plugins you need, and config them in `pmnpsrc.json` file for usage.\n\n```\n{\n  \"workspace\": \"workspace\",\n  \"git\": true,\n  \"lock\": true,\n  \"plugins\": [\"pmnps-dependencies-detect-plugin\"]\n}\n```\n\nAnd before config them, you should add the `plugin` into `devDependencies` in `package.json` file.\n\n## update\n\n### v2.0.0\n\n* `start -p` changes to `start -n`\n* `pack` command changes to `package` command\n* `plat` command changes to `platform` command\n* The root config `pmnps.config.json` changes to `.pmnpsrc.json`\n* `pmnps.pack.json` \u0026 `pmnps.plat.json` is deprecated\n* add simple plugin system.\n\n### v2.0.1\n\n* smooth the all build process.\n\n### v2.0.2\n\n* modify log name about all build process.\n\n### v2.0.3\n\n* fix all build log at wrong position bug. \n\n### v2.0.4\n\n* support parent config file finding.\n\n### v2.1.0\n\n* deprecate the `initial` command.\n* use `create` command to replace the old `package` and `platform` command.\n* deprecate the global `build mode` config\n* add the package build mode.\n\n### v2.1.1\n\n* add `publish` command.\n\n### v2.1.2\n\n* fix the problem that the `prettier` can not add to `devDependencies`.\n\n### v2.1.3\n\n* make `create platform` have a build mode selection.\n\n### v2.1.4\n\n* fix the problem about `ctrl + c` can not kill the `pmnps start child process` problem.\n\n### v2.1.5\n\n* use `SIGKILL` to kill sub process.\n\n### v2.1.6\n\n* listen to `SIGTERM\\SIGKILL\\SIGINT` for closing child process.\n\n### v2.1.7\n\n* try to kill the windows npx start\n\n### v2.1.8\n\n* fix the problem about windows can not kill child process.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilefoxper%2Fpmnps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffilefoxper%2Fpmnps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilefoxper%2Fpmnps/lists"}