-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #313 from plopjs/monorepo
Monorepo
- Loading branch information
Showing
226 changed files
with
25,254 additions
and
13,299 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": ["@changesets/changelog-github", { "repo": "plopjs/plop" }], | ||
"commit": false, | ||
"fixed": [], | ||
"linked": [], | ||
"access": "public", | ||
"baseBranch": "master", | ||
"updateInternalDependencies": "patch", | ||
"ignore": [] | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,43 @@ | ||
const ts = { | ||
files: ["**/*.ts"], | ||
extends: [ | ||
"plugin:prettier/recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
], | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
sourceType: "module", | ||
project: "./tsconfig.json", | ||
allowImportExportEverywhere: true, | ||
}, | ||
plugins: ["@typescript-eslint"], | ||
rules: { | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/no-empty-function": "off", | ||
"@typescript-eslint/no-var-requires": "off", | ||
"@typescript-eslint/no-unused-vars": "off", | ||
"prefer-const": "off" | ||
}, | ||
}; | ||
|
||
module.exports = { | ||
env: { | ||
commonjs: true, | ||
es2021: true, | ||
es6: true, | ||
node: true, | ||
jest: true, | ||
}, | ||
parserOptions: { | ||
sourceType: "module", | ||
"allowImportExportEverywhere": true | ||
ecmaVersion: 2021, | ||
allowImportExportEverywhere: true, | ||
}, | ||
extends: ["plugin:prettier/recommended"], | ||
rules: { | ||
// https://github.com/plopjs/plop/issues/288 | ||
"linebreak-style": ["error", "unix"], | ||
}, | ||
overrides: [ts], | ||
}; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,6 @@ | ||
node_modules/ | ||
*.sublime-* | ||
example/folder/ | ||
example/change-me.txt | ||
.idea | ||
.vscode | ||
.DS_STORE | ||
.nyc_output | ||
coverage | ||
instrumented/ | ||
.eslintcache | ||
yarn-error.log | ||
.nyc_output |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
For each change made (anything not marked as a "chore"), run the following command: | ||
``` | ||
yarn changeset add | ||
``` | ||
|
||
This will allow you to do the following: | ||
|
||
1) Select impacted packages | ||
2) Add a related message | ||
3) Notify what type of package bump is required (major, minor, patch) | ||
|
||
------- | ||
|
||
# Releasing | ||
|
||
When a maintainer is ready to publish, run the following command to generate a changelog: | ||
|
||
``` | ||
yarn changeset version | ||
``` | ||
|
||
You should then verify, using your Git CLI or Git GUI, that the CHANGELOG is correct, everything is up-to-date, and that you're ready to release! | ||
|
||
> **Do not create a commit manually after "yarn changeset version"**. | ||
Then, once you've ran `version`, run the following command to publish to NPM: | ||
|
||
``` | ||
yarn changeset publish | ||
``` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"packages": [ | ||
"packages/*" | ||
], | ||
"npmClient": "yarn", | ||
"useWorkspaces": true, | ||
"version": "0.0.0" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,51 @@ | ||
{ | ||
"name": "plop", | ||
"version": "3.0.5", | ||
"description": "Micro-generator framework that makes it easy for an entire team to create files with a level of uniformity", | ||
"main": "./src/plop.js", | ||
"type": "module", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/plopjs/plop.git" | ||
}, | ||
"keywords": [ | ||
"generator", | ||
"scaffolding", | ||
"yeoman", | ||
"make", | ||
"build", | ||
"generate", | ||
"gen", | ||
"plop" | ||
], | ||
"author": "Andrew Worcester <[email protected]> (http://amwmedia.com)", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/plopjs/plop/issues" | ||
}, | ||
"scripts": { | ||
"test": "npm run test:instrument && npm run vitest && nyc report", | ||
"test:instrument": "nyc instrument ./bin ./instrumented/bin && nyc instrument ./src ./instrumented/src && cp package.json ./instrumented", | ||
"vitest": "vitest run", | ||
"format": "eslint --fix ./", | ||
"prepare": "husky install" | ||
}, | ||
"devDependencies": { | ||
"cli-testing-library": "^1.0.1", | ||
"eslint": "^8.3.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"husky": "^7.0.4", | ||
"inquirer-directory": "^2.2.0", | ||
"lint-staged": "^12.1.2", | ||
"nyc": "^15.1.0", | ||
"plop-pack-fancy-comments": "^0.2.0", | ||
"prettier": "^2.5.0", | ||
"queue-microtask": "^1.2.3", | ||
"vitest": "^0.5.5" | ||
}, | ||
"homepage": "https://plopjs.com", | ||
"dependencies": { | ||
"@types/liftoff": "^4.0.0", | ||
"chalk": "^5.0.0", | ||
"interpret": "^2.2.0", | ||
"liftoff": "^4.0.0", | ||
"minimist": "^1.2.5", | ||
"node-plop": "^0.30.0", | ||
"ora": "^6.0.1", | ||
"v8flags": "^4.0.0" | ||
}, | ||
"engines": { | ||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0" | ||
}, | ||
"preferGlobal": true, | ||
"bin": { | ||
"plop": "./bin/plop.js" | ||
}, | ||
"lint-staged": { | ||
"*.js": "eslint --cache --fix" | ||
} | ||
} | ||
{ | ||
"name": "plop-monorepo", | ||
"version": "0.0.0", | ||
"private": true, | ||
"workspaces": { | ||
"packages": [ | ||
"packages/*" | ||
], | ||
"nohoist": [ | ||
"**/plop-pack-fancy-comments" | ||
] | ||
}, | ||
"type": "module", | ||
"scripts": { | ||
"bootstrap": "lerna exec yarn install", | ||
"build": "lerna run build", | ||
"test": "lerna run --parallel test", | ||
"format": "eslint -c .eslintrc.cjs --fix ./", | ||
"prepare": "husky install", | ||
"plop": "node ./packages/plop/bin/plop.js" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/plopjs/plop/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/plopjs/plop.git" | ||
}, | ||
"homepage": "https://plopjs.com", | ||
"license": "MIT", | ||
"engines": { | ||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0" | ||
}, | ||
"devDependencies": { | ||
"@changesets/changelog-github": "^0.4.4", | ||
"@changesets/cli": "^2.22.0", | ||
"@typescript-eslint/eslint-plugin": "^5.12.1", | ||
"@typescript-eslint/parser": "^5.12.1", | ||
"eslint": "^8.9.0", | ||
"eslint-config-prettier": "^8.4.0", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"husky": "^7.0.4", | ||
"lerna": "^4.0.0", | ||
"lint-staged": "^12.1.2", | ||
"prettier": "^2.5.1", | ||
"typescript": "^4.5.2" | ||
}, | ||
"lint-staged": { | ||
"*.js": "eslint --cache --fix" | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Dependency directory | ||
node_modules | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Compiled src | ||
lib | ||
|
||
# Test mocks | ||
tests/*-mock/src | ||
|
||
# IDE files | ||
.idea |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
tests | ||
.*rc | ||
build-scripts | ||
plopfile.js | ||
plop-templates |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2016 Andrew Worcester | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Node-Plop | ||
====== | ||
|
||
[![npm](https://img.shields.io/npm/v/node-plop.svg)](https://www.npmjs.com/package/node-plop) | ||
[![GitHub actions](https://img.shields.io/github/workflow/status/plopjs/node-plop/test)](https://github.com/plopjs/node-plop/actions/workflows/test.yml) | ||
|
||
This is an early publication of the plop core logic being removed from the CLI tool. Main purpose for this is to make it easier for others to automate code generation through processes and tools OTHER than the command line. This also makes it easier to test the code functionality of PLOP without needing to test via the CLI interface. | ||
|
||
This is the backend code that drives the plop CLI tool using node-plop. | ||
|
||
``` javascript | ||
import nodePlop from 'node-plop'; | ||
// load an instance of plop from a plopfile | ||
const plop = await nodePlop(`./path/to/plopfile.js`); | ||
// get a generator by name | ||
const basicAdd = plop.getGenerator('basic-add'); | ||
|
||
// run all the generator actions using the data specified | ||
basicAdd.runActions({name: 'this is a test'}).then(function (results) { | ||
// do something after the actions have run | ||
}); | ||
``` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import * as del from "del"; | ||
|
||
del.sync("./lib"); |
Oops, something went wrong.