Skip to content

Commit

Permalink
chore: Move tanstack.config.js to root directory (#39)
Browse files Browse the repository at this point in the history
* Move tanstack.config.js to root

* Fix missing exit code 1 for errors
  • Loading branch information
lachlancollins authored Feb 4, 2024
1 parent 40a089a commit 471793a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
10 changes: 8 additions & 2 deletions bin/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,15 @@ Config.prepare(
})
})

program.parseAsync().catch(console.error)
program.parseAsync().catch((error) => {
console.error(error)
process.exit(1)
})
})
.catch((error) => {
console.error(error)
process.exit(1)
})
.catch(console.error)
})
},
)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
],
"packageManager": "[email protected]",
"scripts": {
"cipublish": "node bin/config.js publish --cwd config",
"cipublish": "node ./bin/config.js publish --cwd .",
"cipublishforce": "CI=true pnpm cipublish",
"prettier": "prettier --ignore-unknown '**/*'",
"prettier:write": "pnpm run prettier --write",
Expand Down
11 changes: 4 additions & 7 deletions config/tanstack.config.js → tanstack.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// @ts-check

import { resolve } from 'node:path'
import { fileURLToPath } from 'node:url'

/**
* @type {import('../src/types.js').RunOptions["packages"]}
* @type {import('./src/publish/types.js').RunOptions["packages"]}
*/
export const packages = [
{
Expand All @@ -14,7 +13,7 @@ export const packages = [
]

/**
* @type {import('../src/types.js').RunOptions["branchConfigs"]}
* @type {import('./src/publish/types.js').RunOptions["branchConfigs"]}
*/
export const branchConfigs = {
main: {
Expand All @@ -31,9 +30,7 @@ export const branchConfigs = {
},
}

const __dirname = fileURLToPath(new URL('.', import.meta.url))

/**
* @type {import('../src/types.js').RunOptions["rootDir"]}
* @type {import('./src/publish/types.js').RunOptions["rootDir"]}
*/
export const rootDir = resolve(__dirname, '..')
export const rootDir = fileURLToPath(new URL('.', import.meta.url))
8 changes: 7 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,11 @@
"strict": true,
"target": "ES2020"
},
"include": [".eslintrc.cjs", "bin", "prettier.config.js", "src"]
"include": [
"bin",
"src",
".eslintrc.cjs",
"prettier.config.js",
"tanstack.config.js"
]
}

0 comments on commit 471793a

Please sign in to comment.