-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:joelcox22/lint
- Loading branch information
Showing
17 changed files
with
247 additions
and
140 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
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,2 +1,3 @@ | ||
node_modules | ||
*.tgz | ||
tsconfig.tsbuildinfo |
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,7 +1,7 @@ | ||
{ | ||
"name": "@joelbot/eslint-config", | ||
"version": "0.0.0", | ||
"private": true, | ||
"private": false, | ||
"main": "index.js", | ||
"description": "A personal opinionated eslint configuration.", | ||
"author": "Joel Cox <[email protected]>", | ||
|
@@ -31,5 +31,13 @@ | |
}, | ||
"peerDependencies": { | ||
"typescript": "^5.0.0" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"release": { | ||
"branches": [ | ||
"main" | ||
] | ||
} | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import * as util from '../util.js'; | ||
import * as fs from 'fs'; | ||
|
||
const debug = util.debug('configure-typescript'); | ||
|
||
export const name = 'typescript'; | ||
|
||
export default function configure() { | ||
const packageJson = util.readJson('package.json'); | ||
if (packageJson.name === '@joelbot/lint') { | ||
debug("looks like you're working on @joelbot/lint repo, doing nothing"); | ||
return; | ||
} | ||
if ('typescript' in packageJson.devDependencies) { | ||
debug('typescript is a devDependency, setting up tsconfig'); | ||
fs.writeFileSync( | ||
'tsconfig.json', | ||
JSON.stringify( | ||
{ | ||
extends: '@joelbot/tsconfig/tsconfig.json', | ||
}, | ||
null, | ||
2, | ||
), | ||
); | ||
packageJson.devDependencies['@joelbot/tsconfig'] = '^1.0.0'; | ||
} else { | ||
if (fs.exists('tsconfig.json')) { | ||
debug('typescript is not a devDependency, removing tsconfig.json'); | ||
fs.rmSync('tsconfig.json'); | ||
} else { | ||
debug('typescript is not a devDependency, and tsconfig.json does not exist, doing nothing'); | ||
} | ||
} | ||
util.writeJson('package.json', packageJson); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env node | ||
|
||
import * as fs from 'fs'; | ||
import * as cp from 'child_process'; | ||
import root from 'app-root-path'; | ||
import Debug from 'debug'; | ||
|
||
const debug = Debug(`@joelbot/release`); | ||
|
||
debug('running in directory', process.cwd()); | ||
debug('project root directory is', root.path); | ||
|
||
if (!fs.existsSync('package.json')) { | ||
debug('package.json does not exist, doing nothing'); | ||
process.exit(0); | ||
} | ||
|
||
const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8')); | ||
|
||
if (packageJson.workspaces) { | ||
debug('running in a workspace, looping through workspaces and re-running release'); | ||
const result = cp.spawnSync('yarn', ['workspaces', 'run', 'release'], { | ||
stdio: 'inherit', | ||
}); | ||
process.exit(result.status); | ||
} | ||
|
||
if (packageJson.publishConfig?.access !== 'public') { | ||
debug('publishConfig.access is not public, doing nothing'); | ||
process.exit(0); | ||
} | ||
|
||
debug('publishConfig.access is public, running semantic-release'); | ||
|
||
if (process.cwd() !== root.path) { | ||
debug('running in a workspace folder, using semantic-release-monorepo'); | ||
const result = cp.spawnSync('yarn', ['semantic-release', '-e', 'semantic-release-monorepo'], { | ||
stdio: 'inherit', | ||
}); | ||
process.exit(result.status); | ||
} else { | ||
debug('running semantic-release in project root'); | ||
const result = cp.spawnSync('yarn', ['semantic-release'], { | ||
stdio: 'inherit', | ||
}); | ||
process.exit(result.status); | ||
} |
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,17 @@ | ||
{ | ||
"name": "@joelbot/release", | ||
"version": "0.0.0", | ||
"private": true, | ||
"main": "index.js", | ||
"description": "An opinionated semantic-release wrapper / helper tool for my personal projects.", | ||
"author": "Joel Cox <[email protected]>", | ||
"license": "0BSD", | ||
"type": "module", | ||
"dependencies": { | ||
"app-root-path": "^3.1.0", | ||
"debug": "^4.3.4" | ||
}, | ||
"bin": { | ||
"release": "index.js" | ||
} | ||
} |
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
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,20 @@ | ||
{ | ||
"name": "@joelbot/tsconfig", | ||
"version": "0.0.0", | ||
"private": false, | ||
"description": "just a base tsconfig", | ||
"author": "Joel Cox <[email protected]>", | ||
"license": "0BSD", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/joelcox22/lint.git" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"release": { | ||
"branches": [ | ||
"main" | ||
] | ||
} | ||
} |
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 @@ | ||
{ | ||
"compilerOptions": { | ||
"incremental": true, | ||
"target": "ESNext", | ||
"jsx": "react", | ||
"moduleDetection": "auto", | ||
"moduleResolution": "NodeNext", | ||
"module": "Node16", | ||
"allowArbitraryExtensions": true, | ||
"declaration": true, | ||
"declarationMap": true, | ||
"sourceMap": true, | ||
"outDir": "./", | ||
"removeComments": true, | ||
"importsNotUsedAsValues": "remove", | ||
"downlevelIteration": true, | ||
"emitBOM": true, | ||
"newLine": "lf", | ||
"stripInternal": true, | ||
"noEmitOnError": true, | ||
"isolatedModules": true, | ||
"allowSyntheticDefaultImports": true, | ||
"allowImportingTsExtensions": true, | ||
"esModuleInterop": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"strict": true, | ||
"skipLibCheck": true | ||
}, | ||
"exclude": ["node_modules", "cdk.out", "dist", "build", "coverage", "public", ".parcel-cache", ".wrangler"] | ||
} |
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 @@ | ||
packages/tsconfig/tsconfig.json |
Oops, something went wrong.