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

Get questions fail on empty dir #168

Open
molleweide opened this issue Jan 6, 2025 · 3 comments
Open

Get questions fail on empty dir #168

molleweide opened this issue Jan 6, 2025 · 3 comments

Comments

@molleweide
Copy link

molleweide commented Jan 6, 2025

I am running boundation on empty dir and an error occurs which I am debugging now.

This question:

		{
			name: 'repoUrl',
			message: 'What will the git URL be?',
			validate: isGitUrl,
			default:
				getRepoUrl(await getGitOriginUrl()) || getPackageRepoUrl(packageData),
		},

fails because getRepoUrl

export function getRepoUrl(input = '') {
        // this is where github-api is called.
        // the github-api func sais it must only recieve type string.
        // >>>> Therefore, there should be a null check here
        // if input then return getRep.. or null
	return getRepositoryUrlFromUrlOrGitHubSlug(input) || null
}

is being supplied null which causes an error in in github-api func:

/Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation/node_modules/@bevry/github-api/source/index.ts

with signature

export function getGitHubSlugFromUrl(url: string): string | null {

when it recieves null:

Specific chunk that fails is:

	// Extract the slug a GitHub URL
	const match = url.match(
		/^(?:github:|git@github[.]com:|(?:(?:git|ssh|https?)[+]?)+:[/][/]github[.]com[/])?([^:/]+[/][^:/]+?)(?:[.]git)?(?:#.*)?$/,
	)

with the error being:

Boundation v1.91.0 [/Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation]
Running on [/Users/hjalmarjakobsson/TEST/boundation_proj_1]
reading the now.json file...
...missing the /Users/hjalmarjakobsson/TEST/boundation_proj_1/now.json file...
reading the vercel.json file...
...missing the /Users/hjalmarjakobsson/TEST/boundation_proj_1/vercel.json file...
getQuestions / getGitOriginUrl: null
getRepoUrl / input: null
getGitHubSlugFromUrl / url: null
TypeError: Cannot read properties of null (reading 'match')
    at getGitHubSlugFromUrl (file:///Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation/node_modules/@bevry/github-api/edition-es2022-esm/index.js:95:23)
    at getRepositoryUrlFromGitHubSlugOrUrl (file:///Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation/node_modules/@bevry/github-api/edition-es2022-esm/index.js:119:20)
    at getRepositoryUrlFromUrlOrGitHubSlug (file:///Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation/node_modules/@bevry/github-api/edition-es2022-esm/index.js:128:12)
    at getRepoUrl (file:///Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation/source/package.js:72:9)
    at getQuestions (file:///Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation/source/questions.js:100:5)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async getAnswers (file:///Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation/source/questions.js:947:3)
    at async init (file:///Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation/source/index.js:22:2)
    at async main (file:///Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation/source/bin.js:33:2)
@molleweide
Copy link
Author

molleweide commented Jan 6, 2025

I fixed the issues and now a new error that occurs is the following:

> [email protected] our:compile:edition-es2023-esm seems to be the failing command.

> bound                                                                                                                                                                                       $(vi_mode_prompt_info)
Boundation v1.91.0 [/Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation]
Running on [/Users/hjalmarjakobsson/TEST/boundation_proj_1]
reading the package.json file...
...read the package.json file...
reading the now.json file...
...missing the /Users/hjalmarjakobsson/TEST/boundation_proj_1/now.json file...
reading the vercel.json file...
...missing the /Users/hjalmarjakobsson/TEST/boundation_proj_1/vercel.json file...
getGitHubSlugFromUrl / url: bound.git
? What will be the package name? boundation_proj_1
? and the package description? asd jasdfld;asdf jioenf 
Automated keywords via skip to beginner, es2023, export-default, typed, types, typescript
? What will the git URL be? bound.git
Automated defaultBranch via skip to molleweide
getGitHubSlugFromUrl / url: bound.git
Automated githubSlug via skip to null
getGitHubSlugFromUrl / url: bound.git
Automated githubUsername via skip to null
? Who will the package author be? hjalmar jakobsson <[email protected]>
? What type of project will this be? package
Automated website via when to undefined
Automated docpadWebsite via when to undefined
Automated staticWebsite via when to undefined
Automated staticDirectory via when to undefined
Automated deployTarget via when to undefined
Automated vercelWebsite via when to undefined
Automated vercelName via when to undefined
Automated vercelAliases via when to undefined
Automated nextWebsite via when to undefined
Automated docpadPlugin via skip to false
? Which package manager to use? npm
? What programming languages will the source code be written in? typescript
Automated language via skip to typescript
? What should the path of the tsconfig file be? tsconfig.json
Automated sourceModule via skip to true
Automated flowtype via skip to false
Automated npm via skip to false
? Will it be used on the client-side inside web browsers? No
Automated browsersTargeted via ignore to undefined
Automated dom via when to undefined
Automated compileNode via skip to true
? Which compiler to use for Node.js? typescript
Automated compileBrowser via when to undefined
Automated compilerBrowser via when to undefined
? Which module formats should we target? require, import
? Which directory will the source code be located in? source
Automated indexEntry via skip to index
Automated nodeEntry via skip to index
Automated browserEntry via when to undefined
Automated testEntry via skip to test
Automated bin via when to undefined
Automated binEntry via when to undefined
? What range (if any) do you wish to restrict the Node.js versions to? 
Automated nodeVersions via skip to ["4","6","8","10","12","14","16","18","20","22","23"]
? What is the desired Node.js version? 23
? Should we only support the desired Node.js version? Yes
Automated maintainedNodeVersions via skip to false
Automated expandNodeVersions via skip to false
Automated shrinkNodeVersions via skip to false
Automated nodeVersionsSupportedRange via skip to null
? Which Node.js versions must your package support? 23
Automated nodeVersionSupportedMinimum via skip to 23
Automated nodeVersionSupportedMaximum via skip to 23
Automated nodeVersionsTestedRange via skip to undefined
? Which Node.js versions must your package test against? 23
Automated nodeVersionTestedMinimum via skip to 23
Automated nodeVersionTestedMaximum via skip to 23
Automated nodeVersionsTargetedRange via skip to undefined
? Which Node.js versions must your package target compilation against? 23
Automated nodeVersionsTargetedImportRange via skip to undefined
Automated nodeVersionsTargetedRequireRange via skip to undefined
Automated editionsAutoloader via when to undefined
? Use Bevry's testing tools? Yes
Automated docs via skip to true
? Which deployment strategy should be used for the project and its documentation? surge
customising package data...
...customised package data
updating editions...
editions: source, edition-es2023, edition-es2023-esm, edition-types
...updated editions
removing old files...
...removed old files
renaming old files...
...renamed old files
downloading files...
...downloaded files
updating readme file...
...updated readme file
updating history file...
...updated history file
updating runtime...
scaffolding edition files...
...scaffolded edition files
writing the package.json file...
...wrote the package.json file
writing the package.json file...
...wrote the package.json file
reading the tsconfig.json file...
...read the tsconfig.json file...
writing tsconfig file...
...wrote tsconfig file
upgrading the installed dependencies...
(node:69540) ExperimentalWarning: CommonJS module /usr/local/lib/node_modules/npm/node_modules/debug/src/node.js is loading ES Module /usr/local/lib/node_modules/npm/node_modules/supports-color/index.js using requ
ire().
Support for loading ES Module in require() is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
Upgrading /Users/hjalmarjakobsson/TEST/boundation_proj_1/package.json
[====================] 11/11 100%

All dependencies match the latest package versions :)
...upgraded the installed dependencies
adding the development dependencies...
npm install --no-fund --no-audit --save-dev projectz@latest assert-helpers@latest kava@latest @typescript-eslint/parser@latest prettier@latest eslint@latest eslint-config-bevry@latest eslint-config-prettier@latest
 eslint-plugin-prettier@latest @typescript-eslint/eslint-plugin@latest typedoc@latest
(node:69688) ExperimentalWarning: CommonJS module /usr/local/lib/node_modules/npm/node_modules/debug/src/node.js is loading ES Module /usr/local/lib/node_modules/npm/node_modules/supports-color/index.js using requ
ire().
Support for loading ES Module in require() is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

added 202 packages in 3s
npm install --no-fund --no-audit --save-exact --save-dev typescript@~5.3
(node:69847) ExperimentalWarning: CommonJS module /usr/local/lib/node_modules/npm/node_modules/debug/src/node.js is loading ES Module /usr/local/lib/node_modules/npm/node_modules/supports-color/index.js using requ
ire().
Support for loading ES Module in require() is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

changed 1 package in 741ms
...added the development dependencies
running setup...

> [email protected] our:setup
> npm run our:setup:install


> [email protected] our:setup:install
> npm install

(node:70053) ExperimentalWarning: CommonJS module /usr/local/lib/node_modules/npm/node_modules/debug/src/node.js is loading ES Module /usr/local/lib/node_modules/npm/node_modules/supports-color/index.js using requ
ire().
Support for loading ES Module in require() is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

up to date, audited 203 packages in 701ms

81 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
...ran setup
reading the package.json file...
...read the package.json file...
running clean...

> [email protected] our:clean
> rm -rf ./docs ./edition* ./es2015 ./es5 ./out ./.next

...ran clean
update engines...
determining engines for edition [edition-es2023-esm]...

> [email protected] our:compile:edition-es2023-esm
> tsc --module ESNext --target ES2023 --outDir ./edition-es2023-esm --project tsconfig.json && ( test ! -d edition-es2023-esm/source || ( mv edition-es2023-esm/source edition-temp && rm -rf edition-es2023-esm && m
v edition-temp edition-es2023-esm ) ) && printf '%s' '{"type": "module"}' > edition-es2023-esm/package.json

error TS6046: Argument for '--target' option must be: 'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'esnext'.
Errlop [Error]: spawn failed: /usr/local/Cellar/node/23.1.0/bin/npm run our:compile:edition-es2023-esm
    at file:///Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation/source/fs.js:96:19
    at TaskGroup.<anonymous> (/Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation/node_modules/safeps/source/index.js:557:5)
    at Object.onceWrapper (node:events:622:26)
    at TaskGroup.emit (node:events:507:28)
    at TaskGroup.emit (node:domain:552:15)
    at TaskGroup.listener (/Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation/node_modules/taskgroup/source/interface.js:45:10)
    at TaskGroup.emit (node:events:507:28)
    at TaskGroup.emit (node:domain:552:15)
    at TaskGroup.finish (/Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation/node_modules/taskgroup/source/taskgroup.js:992:8)
    at TaskGroup.fire (/Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation/node_modules/taskgroup/source/taskgroup.js:1057:10)
↳ Error: Command exited with a non-zero status code.
    at Object.updateExecutableResult (/Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation/node_modules/safeps/source/index.js:343:19)
    at ChildProcess.<anonymous> (/Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation/node_modules/safeps/source/index.js:639:13)
    at ChildProcess.emit (node:events:507:28)
    at ChildProcess.emit (node:domain:552:15)
    at maybeClose (node:internal/child_process:1101:16)
    at ChildProcess._handle.onexit (node:internal/child_process:305:5)
    at Process.callbackTrampoline (node:internal/async_hooks:130:17) {
  parent: Error: Command exited with a non-zero status code.
      at Object.updateExecutableResult (/Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation/node_modules/safeps/source/index.js:343:19)
      at ChildProcess.<anonymous> (/Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation/node_modules/safeps/source/index.js:639:13)
      at ChildProcess.emit (node:events:507:28)
      at ChildProcess.emit (node:domain:552:15)
      at maybeClose (node:internal/child_process:1101:16)
      at ChildProcess._handle.onexit (node:internal/child_process:305:5)
      at Process.callbackTrampoline (node:internal/async_hooks:130:17),
  ancestors: [
    Error: Command exited with a non-zero status code.
        at Object.updateExecutableResult (/Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation/node_modules/safeps/source/index.js:343:19)
        at ChildProcess.<anonymous> (/Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation/node_modules/safeps/source/index.js:639:13)
        at ChildProcess.emit (node:events:507:28)
        at ChildProcess.emit (node:domain:552:15)
        at maybeClose (node:internal/child_process:1101:16)
        at ChildProcess._handle.onexit (node:internal/child_process:305:5)
        at Process.callbackTrampoline (node:internal/async_hooks:130:17)
  ],
  exitCode: null,
  orphanStack: 'Error: spawn failed: /usr/local/Cellar/node/23.1.0/bin/npm run our:compile:edition-es2023-esm\n' +
    '    at file:///Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation/source/fs.js:96:19\n' +
    '    at TaskGroup.<anonymous> (/Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation/node_modules/safeps/source/index.js:557:5)\n' +
    '    at Object.onceWrapper (node:events:622:26)\n' +
    '    at TaskGroup.emit (node:events:507:28)\n' +
    '    at TaskGroup.emit (node:domain:552:15)\n' +
    '    at TaskGroup.listener (/Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation/node_modules/taskgroup/source/interface.js:45:10)\n' +
    '    at TaskGroup.emit (node:events:507:28)\n' +
    '    at TaskGroup.emit (node:domain:552:15)\n' +
    '    at TaskGroup.finish (/Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation/node_modules/taskgroup/source/taskgroup.js:992:8)\n' +
    '    at TaskGroup.fire (/Users/hjalmarjakobsson/code/repos/github.com/bevry/boundation/node_modules/taskgroup/source/taskgroup.js:1057:10)',
  code: '',
  level: '',
  klass: [class Errlop extends Error] { stackSeparator: '\n' }
}
[1]:10:05:56:/Users/hjalmarjakobsson/TEST/boundation_proj_1

@balupton
Copy link
Member

balupton commented Jan 6, 2025

yeah, some packages need to be updated for the latest node and ecmascript versions... it's been a year since I've published anything

right now my priority is with getting dorothy shared and my raspi servers back up

@molleweide
Copy link
Author

yeah, some packages need to be updated for the latest node and ecmascript versions... it's been a year since I've published anything

right now my priority is with getting dorothy shared and my raspi servers back up

cool. yeah im just documenting the errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants