refactor: put all non-public projects to directories that start with __

This commit is contained in:
Zoltan Kochan
2022-11-20 02:29:28 +02:00
parent 4ca53b0b50
commit 9cbe293876
346 changed files with 731 additions and 732 deletions

View File

@@ -16,8 +16,7 @@ export default async (workspaceDir: string) => {
const pnpmManifest = loadJsonFile.sync(path.join(workspaceDir, 'pnpm/package.json'))
const pnpmVersion = pnpmManifest!['version'] // eslint-disable-line
const pnpmMajorKeyword = `pnpm${pnpmVersion.split('.')[0]}`
const privatePkgsDir = path.join(workspaceDir, 'privatePackages')
const utilsDir = path.join(workspaceDir, 'utils')
const utilsDir = path.join(workspaceDir, '__utils__')
const lockfile = await readWantedLockfile(workspaceDir, { ignoreIncompatible: false })
if (lockfile == null) {
throw new Error('no lockfile found')
@@ -39,7 +38,7 @@ export default async (workspaceDir: string) => {
} else if (manifest.name === CLI_PKG_NAME && manifest.devDependencies) {
delete manifest.devDependencies[manifest.name]
}
if (manifest.private || isSubdir(privatePkgsDir, dir) || isSubdir(utilsDir, dir)) return manifest
if (manifest.private || isSubdir(utilsDir, dir)) return manifest
manifest.keywords = [
pnpmMajorKeyword,
...(manifest.keywords ?? []).filter((keyword) => !/^pnpm[0-9]+$/.test(keyword)),
@@ -104,7 +103,7 @@ async function updateTSConfig (
include: [
'src/**/*.ts',
'test/**/*.ts',
'../../typings/**/*.d.ts',
'../../__typings__/**/*.d.ts',
],
}, { indent: 2 })
return {

View File

@@ -3,6 +3,6 @@
"include": [
"src/**/*.ts",
"test/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
]
}

View File

View File

View File

View File

@@ -1,4 +1,4 @@
/// <reference path="../../../typings/index.d.ts"/>
/// <reference path="../../../__typings__/index.d.ts"/>
import path from 'path'
import { assertProject } from '../src'

View File

@@ -6,7 +6,7 @@
},
"include": [
"src/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
],
"references": [
{

View File

@@ -3,6 +3,6 @@
"include": [
"src/**/*.ts",
"test/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
]
}

View File

@@ -1,4 +1,4 @@
/// <reference path="../../../typings/index.d.ts"/>
/// <reference path="../../../__typings__/index.d.ts"/>
import path from 'path'
import { assertStore } from '@pnpm/assert-store'

View File

@@ -6,7 +6,7 @@
},
"include": [
"src/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
],
"references": [
{

View File

@@ -3,6 +3,6 @@
"include": [
"src/**/*.ts",
"test/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
]
}

View File

@@ -1,4 +1,4 @@
/// <reference path="../../../typings/local.d.ts" />
/// <reference path="../../../__typings__/local.d.ts" />
import fs from 'fs'
import path from 'path'
import { fileURLToPath } from 'url'

View File

@@ -7,7 +7,7 @@
},
"include": [
"src/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
],
"references": []
}

View File

@@ -3,6 +3,6 @@
"include": [
"src/**/*.ts",
"test/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
]
}

View File

@@ -6,7 +6,7 @@
},
"include": [
"src/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
],
"references": [
{

View File

@@ -3,6 +3,6 @@
"include": [
"src/**/*.ts",
"test/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
]
}

View File

@@ -6,7 +6,7 @@
},
"include": [
"src/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
],
"references": [
{

View File

@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"include": [
"src/**/*.ts",
"test/**/*.ts",
"../../__typings__/**/*.d.ts"
]
}

View File

@@ -0,0 +1,39 @@
{
"name": "@pnpm/tsconfig",
"description": "pnpm's TypeScript configuration",
"version": "2.0.0",
"author": {
"name": "Zoltan Kochan",
"email": "z@kochan.io",
"url": "https://www.kochan.io/"
},
"license": "MIT",
"main": "tsconfig.json",
"homepage": "https://github.com/pnpm/pnpm/blob/main/__utils__/tsconfig#readme",
"repository": "https://github.com/pnpm/pnpm/blob/main/__utils__/tsconfig",
"bugs": {
"url": "https://github.com/pnpm/pnpm/issues"
},
"devDependencies": {
"@pnpm/tsconfig": "workspace:*"
},
"keywords": [
"pnpm7"
],
"engines": {
"node": ">=14.6"
},
"files": [
"lib",
"!*.map"
],
"funding": "https://opencollective.com/pnpm",
"scripts": {
"test": "pnpm run compile",
"compile": "tsc --build && pnpm run lint --fix",
"prepublishOnly": "pnpm run compile"
},
"exports": {
".": "./lib/index.js"
}
}

View File

@@ -6,7 +6,7 @@
},
"include": [
"src/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
],
"references": [
{

View File

@@ -3,6 +3,6 @@
"include": [
"src/**/*.ts",
"test/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
]
}

View File

@@ -6,7 +6,7 @@
},
"include": [
"src/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
],
"references": [
{

View File

@@ -3,6 +3,6 @@
"include": [
"src/**/*.ts",
"test/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
]
}

View File

@@ -6,7 +6,7 @@
},
"include": [
"src/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
],
"references": []
}

View File

@@ -3,6 +3,6 @@
"include": [
"src/**/*.ts",
"test/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
]
}

View File

@@ -6,7 +6,7 @@
},
"include": [
"src/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
],
"references": []
}

View File

@@ -3,6 +3,6 @@
"include": [
"src/**/*.ts",
"test/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
]
}

View File

@@ -1,4 +1,4 @@
/// <reference path="../../../typings/index.d.ts"/>
/// <reference path="../../../__typings__/index.d.ts"/>
import path from 'path'
import { Config } from '@pnpm/config'
import {

View File

@@ -6,7 +6,7 @@
},
"include": [
"src/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
],
"references": [
{

View File

@@ -3,6 +3,6 @@
"include": [
"src/**/*.ts",
"test/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
]
}

View File

@@ -6,7 +6,7 @@
},
"include": [
"src/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
],
"references": [
{

View File

@@ -3,6 +3,6 @@
"include": [
"src/**/*.ts",
"test/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
]
}

View File

@@ -1,4 +1,4 @@
/// <reference path="../../../typings/index.d.ts"/>
/// <reference path="../../../__typings__/index.d.ts"/>
import fs from 'fs'
import { tempDir } from '@pnpm/prepare'
import path from 'path'

View File

@@ -1,4 +1,4 @@
/// <reference path="../../../typings/index.d.ts"/>
/// <reference path="../../../__typings__/index.d.ts"/>
import { promises as fs } from 'fs'
import path from 'path'
import PATH from 'path-name'

View File

@@ -6,9 +6,15 @@
},
"include": [
"src/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
],
"references": [
{
"path": "../../__utils__/prepare"
},
{
"path": "../../__utils__/test-fixtures"
},
{
"path": "../../hooks/pnpmfile"
},
@@ -27,12 +33,6 @@
{
"path": "../../pkg-manifest/read-project-manifest"
},
{
"path": "../../privatePackages/prepare"
},
{
"path": "../../privatePackages/test-fixtures"
},
{
"path": "../matcher"
}

View File

@@ -3,6 +3,6 @@
"include": [
"src/**/*.ts",
"test/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
]
}

View File

@@ -6,7 +6,7 @@
},
"include": [
"src/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
],
"references": []
}

View File

@@ -3,6 +3,6 @@
"include": [
"src/**/*.ts",
"test/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
]
}

View File

@@ -6,7 +6,7 @@
},
"include": [
"src/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
],
"references": [
{

View File

@@ -3,6 +3,6 @@
"include": [
"src/**/*.ts",
"test/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
]
}

View File

@@ -6,7 +6,7 @@
},
"include": [
"src/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
],
"references": [
{

View File

@@ -3,6 +3,6 @@
"include": [
"src/**/*.ts",
"test/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
]
}

View File

@@ -6,7 +6,7 @@
},
"include": [
"src/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
],
"references": [
{

View File

@@ -3,6 +3,6 @@
"include": [
"src/**/*.ts",
"test/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
]
}

View File

@@ -6,7 +6,7 @@
},
"include": [
"src/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
],
"references": [
{

View File

@@ -3,6 +3,6 @@
"include": [
"src/**/*.ts",
"test/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
]
}

View File

@@ -6,9 +6,12 @@
},
"include": [
"src/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
],
"references": [
{
"path": "../../__utils__/prepare"
},
{
"path": "../../fetching/fetcher-base"
},
@@ -24,9 +27,6 @@
{
"path": "../../packages/error"
},
{
"path": "../../privatePackages/prepare"
},
{
"path": "../../store/cafs-types"
},

View File

@@ -3,6 +3,6 @@
"include": [
"src/**/*.ts",
"test/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
]
}

View File

@@ -6,7 +6,7 @@
},
"include": [
"src/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
],
"references": [
{

View File

@@ -3,6 +3,6 @@
"include": [
"src/**/*.ts",
"test/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
]
}

View File

@@ -6,9 +6,12 @@
},
"include": [
"src/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
],
"references": [
{
"path": "../../__utils__/prepare"
},
{
"path": "../../cli/cli-utils"
},
@@ -24,9 +27,6 @@
{
"path": "../../pkg-manager/remove-bins"
},
{
"path": "../../privatePackages/prepare"
},
{
"path": "../../store/store-path"
},

View File

@@ -3,6 +3,6 @@
"include": [
"src/**/*.ts",
"test/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
]
}

View File

@@ -6,7 +6,7 @@
},
"include": [
"src/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
],
"references": [
{

View File

@@ -3,6 +3,6 @@
"include": [
"src/**/*.ts",
"test/**/*.ts",
"../../typings/**/*.d.ts"
"../../__typings__/**/*.d.ts"
]
}

Some files were not shown because too many files have changed in this diff Show More