Skip to content

Commit

Permalink
chore: Migrate scripts to ESM (#5486)
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlancollins committed May 29, 2023
1 parent 92545cc commit 02f5581
Show file tree
Hide file tree
Showing 7 changed files with 153 additions and 213 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"dev": "pnpm run watch",
"prettier": "prettier --plugin-search-dir . \"{packages,examples}/**/src/**/*.{md,js,jsx,cjs,ts,tsx,json,vue,svelte}\"",
"prettier:write": "pnpm run prettier --write",
"cipublish": "ts-node scripts/publish.ts",
"validatePackages": "ts-node scripts/validate-packages.ts"
"cipublish": "node scripts/publish.mjs",
"validatePackages": "node scripts/validate-packages.mjs"
},
"nx": {
"includedScripts": [
Expand Down Expand Up @@ -87,7 +87,7 @@
"semver": "^7.5.1",
"solid-js": "^1.6.13",
"stream-to-array": "^2.3.0",
"ts-node": "^10.9.1",
"type-fest": "^3.11.0",
"typescript": "^5.0.4",
"vitest": "^0.27.1",
"vue": "^3.2.47"
Expand Down
124 changes: 20 additions & 104 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 13 additions & 6 deletions scripts/config.ts → scripts/config.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import path from 'path'
import type { BranchConfig, Package } from './types'
// @ts-check

// TODO: List your npm packages here. The first package will be used as the versioner.
export const packages: Package[] = [
import { resolve } from 'node:path'
import { fileURLToPath } from "node:url";

/**
* List your npm packages here. The first package will be used as the versioner.
* @type {import('./types').Package[]}
*/
export const packages = [
{
name: '@tanstack/query-core',
packageDir: 'query-core',
Expand Down Expand Up @@ -91,7 +96,8 @@ export const packages: Package[] = [

export const latestBranch = 'main'

export const branchConfigs: Record<string, BranchConfig> = {
/** @type {Record<string, import('./types').BranchConfig>} */
export const branchConfigs = {
main: {
prerelease: false,
ghRelease: true,
Expand All @@ -110,4 +116,5 @@ export const branchConfigs: Record<string, BranchConfig> = {
},
}

export const rootDir = path.resolve(__dirname, '..')
const __dirname = fileURLToPath(new URL(".", import.meta.url));
export const rootDir = resolve(__dirname, '..')

0 comments on commit 02f5581

Please sign in to comment.