Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Migrate scripts to ESM #5486

Merged
merged 6 commits into from
May 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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, '..')
Loading