Skip to content

Commit ae2a6bf

Browse files
authored
Merge pull request #313 from plopjs/monorepo
Monorepo
2 parents 13fe141 + 06da26c commit ae2a6bf

File tree

226 files changed

+25254
-13299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

226 files changed

+25254
-13299
lines changed

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": ["@changesets/changelog-github", { "repo": "plopjs/plop" }],
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "master",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.eslintrc.cjs

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,43 @@
1+
const ts = {
2+
files: ["**/*.ts"],
3+
extends: [
4+
"plugin:prettier/recommended",
5+
"plugin:@typescript-eslint/eslint-recommended",
6+
"plugin:@typescript-eslint/recommended",
7+
],
8+
parser: "@typescript-eslint/parser",
9+
parserOptions: {
10+
ecmaVersion: 2018,
11+
sourceType: "module",
12+
project: "./tsconfig.json",
13+
allowImportExportEverywhere: true,
14+
},
15+
plugins: ["@typescript-eslint"],
16+
rules: {
17+
"@typescript-eslint/no-explicit-any": "off",
18+
"@typescript-eslint/no-empty-function": "off",
19+
"@typescript-eslint/no-var-requires": "off",
20+
"@typescript-eslint/no-unused-vars": "off",
21+
"prefer-const": "off"
22+
},
23+
};
24+
125
module.exports = {
226
env: {
327
commonjs: true,
4-
es2021: true,
28+
es6: true,
529
node: true,
30+
jest: true,
631
},
732
parserOptions: {
833
sourceType: "module",
9-
"allowImportExportEverywhere": true
34+
ecmaVersion: 2021,
35+
allowImportExportEverywhere: true,
1036
},
1137
extends: ["plugin:prettier/recommended"],
1238
rules: {
1339
// https://github.com/plopjs/plop/issues/288
1440
"linebreak-style": ["error", "unix"],
1541
},
42+
overrides: [ts],
1643
};

.github/workflows/test.yml

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,21 @@ jobs:
1414
strategy:
1515
matrix:
1616
os: [ ubuntu-latest, windows-latest ]
17-
node: [ 12, 14, 16 ]
17+
node: [ 14, 16 ]
1818
runs-on: ${{ matrix.os }}
1919
steps:
2020
- uses: actions/checkout@v2
21-
- name: Use Node.js 14.x
22-
uses: actions/setup-node@v1
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v2
2323
with:
24-
node-version: '14'
24+
node-version: ${{ matrix.node }}
25+
cache: yarn
2526

26-
# From: https://help.github.com/en/actions/configuring-and-managing-workflows/caching-dependencies-to-speed-up-workflows#example-using-the-cache-action
27-
- name: Cache node modules
28-
uses: actions/cache@v2
29-
env:
30-
cache-name: cache-node-modules
31-
with:
32-
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
33-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
34-
restore-keys: |
35-
${{ runner.os }}-build-${{ env.cache-name }}-
36-
${{ runner.os }}-build-
37-
${{ runner.os }}-
3827
- name: Install Dependencies
39-
run: npm ci
28+
run: yarn install --frozen-lockfile
29+
30+
- name: Bootstrap Dependencies
31+
run: yarn bootstrap
4032

4133
- name: Test
42-
run: npm test
34+
run: yarn test

.gitignore

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
node_modules/
2-
*.sublime-*
3-
example/folder/
4-
example/change-me.txt
52
.idea
63
.vscode
7-
.DS_STORE
8-
.nyc_output
9-
coverage
10-
instrumented/
114
.eslintcache
5+
yarn-error.log
6+
.nyc_output

CONTRIBUTING.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
For each change made (anything not marked as a "chore"), run the following command:
2+
```
3+
yarn changeset add
4+
```
5+
6+
This will allow you to do the following:
7+
8+
1) Select impacted packages
9+
2) Add a related message
10+
3) Notify what type of package bump is required (major, minor, patch)
11+
12+
-------
13+
14+
# Releasing
15+
16+
When a maintainer is ready to publish, run the following command to generate a changelog:
17+
18+
```
19+
yarn changeset version
20+
```
21+
22+
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!
23+
24+
> **Do not create a commit manually after "yarn changeset version"**.
25+
26+
Then, once you've ran `version`, run the following command to publish to NPM:
27+
28+
```
29+
yarn changeset publish
30+
```

lerna.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"packages": [
3+
"packages/*"
4+
],
5+
"npmClient": "yarn",
6+
"useWorkspaces": true,
7+
"version": "0.0.0"
8+
}

package.json

Lines changed: 51 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,51 @@
1-
{
2-
"name": "plop",
3-
"version": "3.0.5",
4-
"description": "Micro-generator framework that makes it easy for an entire team to create files with a level of uniformity",
5-
"main": "./src/plop.js",
6-
"type": "module",
7-
"repository": {
8-
"type": "git",
9-
"url": "https://github.com/plopjs/plop.git"
10-
},
11-
"keywords": [
12-
"generator",
13-
"scaffolding",
14-
"yeoman",
15-
"make",
16-
"build",
17-
"generate",
18-
"gen",
19-
"plop"
20-
],
21-
"author": "Andrew Worcester <[email protected]> (http://amwmedia.com)",
22-
"license": "MIT",
23-
"bugs": {
24-
"url": "https://github.com/plopjs/plop/issues"
25-
},
26-
"scripts": {
27-
"test": "npm run test:instrument && npm run vitest && nyc report",
28-
"test:instrument": "nyc instrument ./bin ./instrumented/bin && nyc instrument ./src ./instrumented/src && cp package.json ./instrumented",
29-
"vitest": "vitest run",
30-
"format": "eslint --fix ./",
31-
"prepare": "husky install"
32-
},
33-
"devDependencies": {
34-
"cli-testing-library": "^1.0.1",
35-
"eslint": "^8.3.0",
36-
"eslint-config-prettier": "^8.3.0",
37-
"eslint-plugin-prettier": "^4.0.0",
38-
"husky": "^7.0.4",
39-
"inquirer-directory": "^2.2.0",
40-
"lint-staged": "^12.1.2",
41-
"nyc": "^15.1.0",
42-
"plop-pack-fancy-comments": "^0.2.0",
43-
"prettier": "^2.5.0",
44-
"queue-microtask": "^1.2.3",
45-
"vitest": "^0.5.5"
46-
},
47-
"homepage": "https://plopjs.com",
48-
"dependencies": {
49-
"@types/liftoff": "^4.0.0",
50-
"chalk": "^5.0.0",
51-
"interpret": "^2.2.0",
52-
"liftoff": "^4.0.0",
53-
"minimist": "^1.2.5",
54-
"node-plop": "^0.30.0",
55-
"ora": "^6.0.1",
56-
"v8flags": "^4.0.0"
57-
},
58-
"engines": {
59-
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
60-
},
61-
"preferGlobal": true,
62-
"bin": {
63-
"plop": "./bin/plop.js"
64-
},
65-
"lint-staged": {
66-
"*.js": "eslint --cache --fix"
67-
}
68-
}
1+
{
2+
"name": "plop-monorepo",
3+
"version": "0.0.0",
4+
"private": true,
5+
"workspaces": {
6+
"packages": [
7+
"packages/*"
8+
],
9+
"nohoist": [
10+
"**/plop-pack-fancy-comments"
11+
]
12+
},
13+
"type": "module",
14+
"scripts": {
15+
"bootstrap": "lerna exec yarn install",
16+
"build": "lerna run build",
17+
"test": "lerna run --parallel test",
18+
"format": "eslint -c .eslintrc.cjs --fix ./",
19+
"prepare": "husky install",
20+
"plop": "node ./packages/plop/bin/plop.js"
21+
},
22+
"bugs": {
23+
"url": "https://github.com/plopjs/plop/issues"
24+
},
25+
"repository": {
26+
"type": "git",
27+
"url": "https://github.com/plopjs/plop.git"
28+
},
29+
"homepage": "https://plopjs.com",
30+
"license": "MIT",
31+
"engines": {
32+
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
33+
},
34+
"devDependencies": {
35+
"@changesets/changelog-github": "^0.4.4",
36+
"@changesets/cli": "^2.22.0",
37+
"@typescript-eslint/eslint-plugin": "^5.12.1",
38+
"@typescript-eslint/parser": "^5.12.1",
39+
"eslint": "^8.9.0",
40+
"eslint-config-prettier": "^8.4.0",
41+
"eslint-plugin-prettier": "^4.0.0",
42+
"husky": "^7.0.4",
43+
"lerna": "^4.0.0",
44+
"lint-staged": "^12.1.2",
45+
"prettier": "^2.5.1",
46+
"typescript": "^4.5.2"
47+
},
48+
"lint-staged": {
49+
"*.js": "eslint --cache --fix"
50+
}
51+
}

packages/node-plop/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
6+
# Runtime data
7+
pids
8+
*.pid
9+
*.seed
10+
11+
# Dependency directory
12+
node_modules
13+
14+
# Optional npm cache directory
15+
.npm
16+
17+
# Compiled src
18+
lib
19+
20+
# Test mocks
21+
tests/*-mock/src
22+
23+
# IDE files
24+
.idea

packages/node-plop/.npmignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
tests
2+
.*rc
3+
build-scripts
4+
plopfile.js
5+
plop-templates

packages/node-plop/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 Andrew Worcester
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)