Skip to content

Commit

Permalink
feat(peer): removing peer depednencies for direct dependencies (#28)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: we are moving to direct dependencies instead of relying on peer dependencies
  • Loading branch information
bassrock authored Jun 17, 2022
1 parent 91f2d39 commit dba390a
Show file tree
Hide file tree
Showing 3 changed files with 1,178 additions and 1,030 deletions.
54 changes: 27 additions & 27 deletions bin/install.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env node

import fs from 'fs'
import path from 'path'
import fs from 'fs';
import path from 'path';

import pkgUp from 'pkg-up'
import { pkgUp } from 'pkg-up';

import { fileURLToPath } from 'url'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));

const TSCONFIG_JSON_CONTENT = `{
"extends": "@pocket-tools/tsconfig",
Expand All @@ -23,28 +23,28 @@ const TSCONFIG_JSON_CONTENT = `{
"src/config"
],
}
`

async function main () {
const cwd = path.join(__dirname, '..', '..')
const pkg = await pkgUp({ cwd })
if (!pkg) {
return 0
}
const pkgDir = path.dirname(pkg)

const tsconfigFile = path.join(pkgDir, 'tsconfig.json')

if (!fs.existsSync(tsconfigFile)) {
console.info(`@pocket-tools/tsconfig: auto generated ${tsconfigFile}`)
fs.writeFileSync(tsconfigFile, TSCONFIG_JSON_CONTENT)
}
return 0
`;

async function main() {
const cwd = path.join(__dirname, '..', '..');
const pkg = await pkgUp({ cwd });
if (!pkg) {
return 0;
}
const pkgDir = path.dirname(pkg);

const tsconfigFile = path.join(pkgDir, 'tsconfig.json');

if (!fs.existsSync(tsconfigFile)) {
console.info(`@pocket-tools/tsconfig: auto generated ${tsconfigFile}`);
fs.writeFileSync(tsconfigFile, TSCONFIG_JSON_CONTENT);
}
return 0;
}

main()
.then(process.exit)
.catch(e => {
console.error(e)
process.exit(1)
})
.then(process.exit)
.catch((e) => {
console.error(e);
process.exit(1);
});
Loading

0 comments on commit dba390a

Please sign in to comment.