sanity-io / pkg-utils Goto Github PK
View Code? Open in Web Editor NEWSimple utilities for modern npm packages.
License: MIT License
Simple utilities for modern npm packages.
License: MIT License
Currently, errors that may happen during doExtract
when running pkg watch --strict
(not sure if --strict
matters) are currently logged as-is without any sort of formatting, which leads to output like this:
[error] DtsError: encountered 2 errors when extracting types
at doExtract (./node_modules/@sanity/pkg-utils/dist/_chunks/index-c12a2784.cjs:2156:2098) {
messages: [
ExtractorMessage {
category: 'Extractor',
messageId: 'ae-forgotten-export',
text: '(…)',
sourceFilePath: './src/types.ts',
sourceFileLine: 23,
sourceFileColumn: 1,
properties: {},
_handled: true,
_logLevel: 'error'
},
ExtractorMessage {
category: 'Extractor',
messageId: 'ae-forgotten-export',
text: '(…)',
sourceFilePath: './types.ts',
sourceFileLine: 139,
sourceFileColumn: 1,
properties: {},
_handled: true,
_logLevel: 'error'
}
]
}
ERROR: "pkg:watch" exited with 1.
Not a super big deal, but it would be nice if these errors could be formatted the same way as they are when error occurs during pkg build
:
[error] 1638ms
[error] encountered 2 errors when extracting types
types.ts:23:1 - error ae-forgotten-export
(The error message)
types.ts:139:1 - error ae-forgotten-export
(The error message)
If you find a security vulnerability, do NOT open an issue. Email [email protected] instead.
Describe the bug
Initialization prompt will error with:
error Cannot find package 'prettier-plugin-packagejson' imported from [.]/noop.js
([.]
is the absolute path to the current working directory)
To Reproduce
Steps to reproduce the behavior:
npx @sanity/pkg-utils@latest init [path]
and answer promptsExpected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Which versions of Sanity are you using?
Run sanity versions
in the terminal and copy-paste the result here.
What operating system are you using?
Which versions of Node.js / npm are you running?
[email protected]
[email protected]
Additional context
Add any other context about the problem here.
Security issue?
Any security issues should be submitted directly to [email protected]. In order to determine whether you are dealing with a security issue, ask yourself these two questions:
main
branch failed. 🚨I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can fix this 💪.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the main
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here are some links that can help you:
If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.
The npm token configured in the NPM_TOKEN
environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/
.
If you are using Two Factor Authentication for your account, set its level to "Authorization only" in your account settings. semantic-release cannot publish with the default "
Authorization and writes" level.
Please make sure to set the NPM_TOKEN
environment variable in your CI with the exact value of the npm token.
Good luck with your project ✨
Your semantic-release bot 📦🚀
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Error type: Cannot find preset's package (config:recommended). Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.
Dependency globby only accepts forward slashes as parameters. As a result, Windows paths will always fail. This currently makes it impossible to use plugin-kit's link-watch on Windows,
The solution is to change src/node/globFiles.ts from:
import globby from 'globby'
export function globFiles(patterns: string[]): Promise<string[]> {
return globby(patterns)
}
To:
import path from 'path'
import globby from 'globby'
export function globFiles(patterns: string[]): Promise<string[]> {
return globby(patterns.map(pattern => pattern.split(path.sep).join(path.posix.sep))
}
If no one can get to this soon, I'll make a PR when time permits.
Hi everyone,
We are currently updating our Sanity Studio plugin to V3 and I would like to ask if it is possible to also copy or output the whole src
folder into the outDir
so that we can import specific files from this src/schemas
folder into another plugin or project:
Currently when we build the plugin, it only outputs index files into the target output directory lib
This is the relevant config from the package.json
:
This is the package.config.ts
:
This is the tsconfig.json
:
This is the tsconfig.lib.json
:
This is the tsconfig.settings.json
:
I would really appreciate your help on this. Thanks a lot! :)
If you find a security vulnerability, do NOT open an issue. Email [email protected] instead.
Describe the bug
When using npm
to initialize a new package:
npx @sanity/pkg-utils@latest init <pkg-name>
The installation will throw a peer dependency error:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/typescript
npm ERR! dev typescript@"^5.4.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer typescript@"5.4.2" from @sanity/[email protected]
npm ERR! node_modules/@sanity/pkg-utils
npm ERR! dev @sanity/pkg-utils@"^5.1.7" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
Which versions of Node.js / npm are you running?
Node v20.12.0
NPM v10.5.0
Additional context
@sanity/pkg-utils
specifies an exact version of typescript
as a peer dependency:
Line 156 in 3495263
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
Using a curated preset maintained by
Warning
These dependencies are deprecated:
Datasource | Name | Replacement PR? |
---|---|---|
npm | @types/rimraf |
|
npm | cpx |
|
npm | pkg-up |
These branches will be created by Renovate only once you click their checkbox below.
astro
, eslint-plugin-svelte
)These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.
actions/download-artifact
, actions/upload-artifact
)uuid
, @types/uuid
).github/workflows/browserslist.yml
actions/checkout v4
pnpm/action-setup v3
actions/setup-node v4
actions/create-github-app-token v1
peter-evans/create-pull-request v6@6d6857d36972b65feb161a90e484f2984215f83e
.github/workflows/format-if-needed.yml
actions/checkout v4
pnpm/action-setup v3
actions/setup-node v4
actions/create-github-app-token v1
peter-evans/create-pull-request v6@6d6857d36972b65feb161a90e484f2984215f83e
.github/workflows/main.yml
actions/checkout v4
pnpm/action-setup v3
actions/setup-node v4
actions/upload-artifact v3
actions/checkout v4
pnpm/action-setup v3
actions/setup-node v4
actions/download-artifact v3
actions/upload-artifact v3
actions/checkout v4
pnpm/action-setup v3
actions/setup-node v4
actions/download-artifact v3
.github/workflows/release-please.yml
actions/create-github-app-token v1
google-github-actions/release-please-action v4
actions/checkout v4
pnpm/action-setup v2
actions/setup-node v4
package.json
@babel/core ^7.24.7
@babel/preset-typescript ^7.24.7
@babel/types ^7.24.7
@microsoft/api-extractor 7.47.0
@microsoft/tsdoc-config 0.17.0
@optimize-lodash/rollup-plugin 4.0.4
@rollup/plugin-alias ^5.1.0
@rollup/plugin-babel ^6.0.4
@rollup/plugin-commonjs ^26.0.1
@rollup/plugin-json ^6.1.0
@rollup/plugin-node-resolve ^15.2.3
@rollup/plugin-replace ^5.0.7
@rollup/plugin-terser ^0.4.4
@sanity/browserslist-config ^1.0.3
babel-plugin-react-compiler 0.0.0-experimental-938cd9a-20240601
browserslist ^4.23.1
cac ^6.7.14
chalk ^4.1.2
chokidar ^3.6.0
esbuild ^0.21.5
esbuild-register ^3.5.0
find-config ^1.0.0
get-latest-version ^5.1.0
git-url-parse ^14.0.0
jsonc-parser ^3.2.1
mkdirp ^3.0.1
outdent ^0.8.0
parse-git-config ^3.0.0
pkg-up ^3.1.0
prettier ^3.3.2
pretty-bytes ^5.6.0
prompts ^2.4.2
recast 0.23.9
rimraf ^4.4.1
rollup ^4.18.0
rollup-plugin-esbuild ^6.1.1
rxjs ^7.8.1
treeify ^1.1.0
uuid ^9.0.1
zod 3.23.8
zod-validation-error 3.3.0
@commitlint/cli ^19.3.0
@commitlint/config-conventional ^19.2.2
@sanity/prettier-config ^1.0.2
@types/babel__core ^7.20.5
@types/cpx ^1.5.5
@types/find-config ^1.0.4
@types/git-url-parse ^9.0.3
@types/parse-git-config ^3.0.4
@types/prompts ^2.4.9
@types/rimraf ^3.0.2
@types/treeify ^1.0.3
@types/uuid ^9.0.8
@typescript-eslint/eslint-plugin ^7.13.1
@typescript-eslint/parser ^7.13.1
browserslist-to-esbuild 2.1.1
commitizen ^4.3.0
cpx ^1.5.0
cz-conventional-changelog ^3.3.0
eslint ^8.57.0
eslint-config-prettier ^9.1.0
eslint-plugin-import ^2.29.1
eslint-plugin-prettier ^5.1.3
eslint-plugin-simple-import-sort ^12.1.0
npm-run-all2 ^6.2.0
outdent ^0.8.0
rollup-plugin-visualizer ^5.12.0
ts-node ^10.9.2
typescript 5.4.5
vitest ^1.6.0
vitest-github-actions-reporter ^0.11.1
typescript 5.4.x
node >=18.17.0
pnpm 9.4.0
playground/babel-plugin/package.json
@babel/core ^7.24.7
@babel/plugin-transform-object-rest-spread ^7.24.7
playground/browser-bundle/package.json
playground/custom-dist/package.json
playground/default-export/package.json
playground/dummy-commonjs/package.json
playground/dummy-lodash-es/package.json
lodash ^4.17.21
lodash-es ^4.17.21
@types/lodash ^4.17.5
@types/lodash-es ^4.17.12
playground/dummy-lodash/package.json
lodash ^4.17.21
@types/lodash ^4.17.5
playground/dummy-module/package.json
playground/dummy-side-effects/package.json
playground/extra-bundles/package.json
playground/js/package.json
playground/multi-export/package.json
@sanity/visual-editing ^2.1.5
@sveltejs/adapter-auto ^3.2.2
@sveltejs/kit ^2.5.16
@sveltejs/package ^2.3.2
@sveltejs/vite-plugin-svelte ^3.1.1
svelte ^4.2.18
vite ^5.3.1
@sveltejs/kit ^2.0.0
svelte ^4.0.0
playground/multi-exports-commonjs/package.json
playground/node-api/package.json
playground/reference-cjs-legacy/package.json
playground/reference-cjs-only/package.json
playground/reference-cjs/package.json
@tsconfig/node-lts 20.1.3
typescript 5.4.5
playground/reference-esm-legacy/package.json
playground/reference-esm-only/package.json
@tsconfig/node-lts 20.1.3
typescript 5.4.5
playground/reference-esm/package.json
@tsconfig/node-lts 20.1.3
typescript 5.4.5
playground/runtime-astro/package.json
astro ^4.10.3
playground/runtime-next-js/package.json
@types/react ^18.3.3
next 15.0.0-rc.0
react 19.0.0-rc-fb9a90fa48-20240614
react-dom 19.0.0-rc-fb9a90fa48-20240614
playground/runtime-node-commonjs/package.json
playground/runtime-node-module/package.json
playground/runtime-svelte/package.json
@fontsource/fira-mono ^5.0.13
@neoconfetti/svelte ^1.0.0
@sveltejs/adapter-auto ^3.2.2
@sveltejs/kit ^2.5.16
@sveltejs/vite-plugin-svelte ^3.1.1
@types/eslint ^8.56.10
@typescript-eslint/eslint-plugin ^7.13.1
@typescript-eslint/parser ^7.13.1
eslint ^9.0.0
eslint-config-prettier ^9.1.0
eslint-plugin-svelte ^2.40.0
prettier ^3.3.2
prettier-plugin-svelte ^3.2.4
svelte ^4.2.18
svelte-check ^3.8.1
tslib ^2.6.3
typescript 5.4.5
vite ^5.3.1
playground/runtime-vite/package.json
typescript 5.4.5
vite ^5.3.1
playground/runtime-webpack-v3/package.json
webpack ^3.12.0
playground/sanity/package.json
playground/styled-components-module/package.json
@rollup/plugin-commonjs ^26.0.1
@rollup/plugin-node-resolve ^15.2.3
@rollup/plugin-swc ^0.3.1
@swc/plugin-styled-components ^2.0.8
@types/react ^18.3.3
babel-plugin-styled-components ^2.1.4
react ^18.3.1
rollup ^4.18.0
rollup-plugin-esbuild ^6.1.1
styled-components ^6.1.11
playground/ts-bundler/package.json
playground/ts-node16/package.json
playground/ts/package.json
playground/use-client-directive/package.json
babel-plugin-react-compiler 0.0.0-experimental-938cd9a-20240601
@types/react ^18.3.3
react ^18.3.1
react ^18.2.0
playground/vision/package.json
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.