@take-out/scripts 0.0.36 → 0.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@take-out/scripts",
3
- "version": "0.0.36",
3
+ "version": "0.0.37",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "sideEffects": false,
@@ -24,7 +24,7 @@
24
24
  "access": "public"
25
25
  },
26
26
  "dependencies": {
27
- "@take-out/helpers": "0.0.36"
27
+ "@take-out/helpers": "0.0.37"
28
28
  },
29
29
  "devDependencies": {
30
30
  "vxrn": "*"
package/src/clean.ts CHANGED
@@ -4,12 +4,26 @@
4
4
  * @description Clean build artifacts and temporary files
5
5
  */
6
6
 
7
- import { execSync } from 'node:child_process'
8
-
9
- try {
10
- execSync('rm -rf dist types .tamagui .vite node_modules/.cache', { stdio: 'inherit' })
11
- console.info('Cleanup complete!')
12
- } catch (error) {
13
- console.error('Error cleaning up')
14
- throw error
7
+ import { $ } from 'bun'
8
+
9
+ const full = process.argv.includes('--full')
10
+ const modules = full || process.argv.includes('--modules')
11
+ const native = full || process.argv.includes('--native')
12
+
13
+ await $`rm -rf dist types .tamagui .vite node_modules/.cache`
14
+
15
+ if (modules) {
16
+ console.info('removing all node_modules...')
17
+ await $`find . -name 'node_modules' -type d -prune -exec rm -rf {} +`
18
+ }
19
+
20
+ if (native) {
21
+ console.info('removing ios and android folders...')
22
+ await $`rm -rf ios android`
23
+ }
24
+
25
+ console.info('cleanup complete!')
26
+
27
+ if (!full) {
28
+ console.info('use --modules, --native, or --full for deeper cleaning')
15
29
  }
@@ -10,17 +10,26 @@ export async function getTestEnv() {
10
10
  const dockerHost = getDockerHost()
11
11
  const serverEnvFallback = await import(join(process.cwd(), 'src/server/env-server'))
12
12
 
13
+ // explicit URLs required since vxrn loadEnv doesn't override existing env vars
14
+ const dockerDbBase = `postgresql://user:password@127.0.0.1:5433`
15
+
13
16
  return {
14
17
  ...serverEnvFallback,
15
18
  ...devEnv,
16
- CI: 'true', // Ensure CI flag is set for test environment
19
+ CI: 'true',
17
20
  ...(!process.env.DEBUG_BACKEND && {
18
21
  ZERO_LOG_LEVEL: 'warn',
19
22
  }),
20
23
  DO_NOT_TRACK: '1',
21
24
  ZERO_VERSION: zeroVersion,
22
- ZERO_AUTH_JWKS_URL: `http://${dockerHost}:8081/api/auth/jwks`,
23
- ZERO_PUSH_URL: `http://${dockerHost}:8081/api/zero/push`,
24
- ZERO_GET_QUERIES_URL: `http://${dockerHost}:8081/api/zero/pull`,
25
+ ZERO_MUTATE_URL: `http://${dockerHost}:8081/api/zero/push`,
26
+ ZERO_QUERY_URL: `http://${dockerHost}:8081/api/zero/pull`,
27
+ ZERO_UPSTREAM_DB: `${dockerDbBase}/postgres`,
28
+ ZERO_CVR_DB: `${dockerDbBase}/zero_cvr`,
29
+ ZERO_CHANGE_DB: `${dockerDbBase}/zero_cdb`,
30
+ CLOUDFLARE_R2_ENDPOINT: 'http://127.0.0.1:9200',
31
+ CLOUDFLARE_R2_PUBLIC_URL: 'http://127.0.0.1:9200',
32
+ CLOUDFLARE_R2_ACCESS_KEY: 'minio',
33
+ CLOUDFLARE_R2_SECRET_KEY: 'minio_password',
25
34
  }
26
35
  }
package/src/run.ts CHANGED
@@ -137,8 +137,10 @@ async function findWorkspaceDirectories(): Promise<string[]> {
137
137
 
138
138
  const allPackageDirs = await findPackageJsonDirs('.')
139
139
 
140
- const normalizePattern = (pattern: string): string => {
141
- return pattern.startsWith('./') ? pattern.substring(2) : pattern
140
+ // normalize path separators to forward slashes for cross-platform support
141
+ const normalizePath = (path: string): string => {
142
+ let normalized = path.replace(/\\/g, '/')
143
+ return normalized.startsWith('./') ? normalized.substring(2) : normalized
142
144
  }
143
145
 
144
146
  const workspaceDirs = allPackageDirs.filter((dir) => {
@@ -146,8 +148,8 @@ async function findWorkspaceDirectories(): Promise<string[]> {
146
148
 
147
149
  const relativePath = relative('.', dir)
148
150
  return patterns.some((pattern) => {
149
- const normalizedPattern = normalizePattern(pattern)
150
- const normalizedPath = normalizePattern(relativePath)
151
+ const normalizedPattern = normalizePath(pattern)
152
+ const normalizedPath = normalizePath(relativePath)
151
153
 
152
154
  if (normalizedPattern.endsWith('/*')) {
153
155
  const prefix = normalizedPattern.slice(0, -1)
package/src/typecheck.ts CHANGED
@@ -18,5 +18,5 @@ if (process.env.LAZY_TYPECHECK) {
18
18
  if (useTsgo) {
19
19
  await run(`bun tsgo --project ./tsconfig.json --noEmit --preserveWatchOutput ${args}`)
20
20
  } else {
21
- await run(`bun x tsc --project ./tsconfig.json --noEmit --preserveWatchOutput ${args}`)
21
+ await run(`bun tsc --project ./tsconfig.json --noEmit --preserveWatchOutput ${args}`)
22
22
  }
package/tsconfig.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "extends": "../tsconfig.base.json",
3
3
  "compilerOptions": {
4
- "outDir": "./dist"
4
+ "outDir": "./dist",
5
+ "moduleDetection": "force"
5
6
  },
6
7
  "include": ["./src/**/*"],
7
8
  "exclude": ["**/test", "**/__tests__", "dist", "node_modules"]