Giter VIP home page Giter VIP logo

plugin-kit's Issues

Fresh install doesn't work

I have tried multiple times using npx @sanity/plugin-kit init pluginname, following the wizard, and then when running yarn build it instantly fails (see screenshot below)

Screenshot 2024-03-21 at 12 29 18

All your plugin docs suggest using this but it doesn't work out of the box, so its not a great starting point! Please could someone take a look?

npm run link-watch produces "`type` in `./package.json` must be of type 'commonjs' | 'module' (received undefined)"

When running the README.md quick run steps, the package.json doesn't seem to be properly configured.

# Initialize a new plugin (outside of your Sanity studio folder)
npx @sanity/plugin-kit init sanity-plugin-testing-it-out

# Make your plugin linkable, and compile an initial version
cd sanity-plugin-testing-it-out
npm run link-watch

npm run link-watch produces

[error] `type` in `./package.json` must be of type 'commonjs' | 'module' (received undefined)

To fix this

  1. The plugin template package.json needs "type": "module" added
  2. "exports": {
     ".": {
       "types": "./lib/src/index.d.ts",
       "source": "./src/index.ts",
       "import": "./lib/index.esm.js",
       "require": "./lib/index.js", // Update to .cjs
       "default": "./lib/index.esm.js"
     },
     "main": "./lib/index.js", //update to .cjs

Fresh install ESLintIgnoreWarning

Describe the bug

ESLintIgnoreWarning: The ".eslintignore" file is no longer supported. Switch to using the "ignores" property in "eslint.config.js": https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files
(Use `node --trace-warnings ...` to show where the warning was created)

To Reproduce

Steps to reproduce the behavior:

  1. Initialize
  2. Verify pnpx @sanity/plugin-kit@latest verify-package

Expected behavior

No warnings. No .eslintignore file should be generated.

Screenshots
image

Which versions of Sanity are you using?

@sanity/cli (global) 3.14.4 (latest: 3.44.0)
@sanity/incompatible-plugin 1.0.4 (up to date)
@sanity/pkg-utils 6.8.18 (up to date)
@sanity/plugin-kit 4.0.16 (up to date)
sanity 3.44.0 (up to date)

What operating system are you using?

Mac

Which versions of Node.js / npm are you running?

pnpm 9.0.5

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:

  • Can I access something that's not mine, or something I shouldn't have access to?
  • Can I disable something for other people? If the answer to either of those two questions are "yes", then you're probably dealing with a security issue. Note that even if you answer "no" to both questions, you may still be dealing with a security issue, so if you're unsure, just email us at [[email protected]](mailto:[email protected].

Missing package.json

[0] Error: missing package.json
[0] at D:\repos\sanity-smartling\sanity-plugin-smartling\node_modules@sanity\pkg-utils\dist_chunks\watch-86ed07a5.cjs:186:13

[0]
[0] D:\repos\sanity-plugin\sanity-plugin-smartling\node_modules\rxjs\dist\cjs\internal\util\reportUnhandledError.js:13
[0] throw err;
[0] ^
[0]
[0] Error: missing package.json
[0] at D:\repos\sanity-plugin\sanity-plugin-smartling\node_modules@sanity\pkg-utils\dist_chunks\watch-86ed07a5.cjs:186:13
[0] at D:\repos\net-sanity-plugin\sanity-plugin-smartling\node_modules\rxjs\dist\cjs\internal\operators\switchMap.js:17:35

Following the exact steps in the readme end up in error.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.


Using a curated preset maintained by


Sanity: The Composable Content Cloud

Pending Approval

These branches will be created by Renovate only once you click their checkbox below.

  • chore(deps): update dependency sanity to v3.47.1
  • fix(deps): Update dependency nodemon to v3.1.4
  • chore(deps): lock file maintenance
  • ๐Ÿ” Create all pending approval PRs at once ๐Ÿ”

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

github-actions
.github/workflows/format-if-needed.yml
  • actions/checkout v4
  • actions/setup-node v4
  • actions/cache v4
  • actions/create-github-app-token v1
  • peter-evans/create-pull-request v6@c5a7806660adbe173f04e3e038b0ccdcd758773c
.github/workflows/main.yml
  • actions/checkout v4
  • actions/setup-node v4
  • actions/checkout v4
  • actions/setup-node v4
  • actions/create-github-app-token v1
  • actions/checkout v4
  • actions/setup-node v4
assets/inject/semver-workflow/.github/workflows/main.yml
  • actions/checkout v4
  • actions/setup-node v4
  • actions/checkout v4
  • actions/setup-node v4
  • actions/checkout v4
  • actions/setup-node v4
npm
package.json
  • @rexxars/choosealicense-list 1.1.2
  • @sanity/pkg-utils 6.10.0
  • chalk 4.1.2
  • concurrently 8.2.2
  • discover-path 1.0.0
  • email-validator 2.0.4
  • get-it 8.6.1
  • get-latest-version 5.1.0
  • git-remote-origin-url 3.1.0
  • git-user-info 2.0.3
  • github-url-to-object 4.0.6
  • meow 9.0.0
  • nodemon 3.1.0
  • npm-packlist 8.0.2
  • npm-run-path 4.0.1
  • outdent 0.8.0
  • p-any 3.0.0
  • p-props 4.0.0
  • postcss 8.4.38
  • spdx-license-ids 3.0.18
  • xdg-basedir 4.0.0
  • yalc 1.0.0-pre.53
  • @commitlint/cli 19.3.0
  • @commitlint/config-conventional 19.2.2
  • @sanity/semantic-release-preset 5.0.0
  • @sanity/ui-workshop ^2.0.15
  • @types/eslint ^8.56.10
  • @types/fs-extra ^11.0.4
  • @types/nodemon ^1.19.6
  • @types/tap ^15.0.11
  • @typescript-eslint/eslint-plugin ^7.13.1
  • @typescript-eslint/parser ^7.13.1
  • eslint ^8.57.0
  • eslint-config-prettier ^9.1.0
  • eslint-config-sanity ^7.1.2
  • eslint-plugin-prettier ^5.1.3
  • eslint-plugin-react-hooks ^4.6.2
  • fs-extra ^11.2.0
  • json5 2.2.3
  • prettier ^3.3.2
  • prettier-plugin-packagejson ^2.5.0
  • readdirp ^3.6.0
  • rimraf ^4.4.1
  • sanity 3.47.0
  • sinon ^17.0.2
  • tap ^16.3.10
  • ts-node ^10.9.2
  • typescript 5.4.5
  • eslint >=8.0.0
  • node >=18

  • Check this box to trigger a request for Renovate to run again on this repository

verifyPackage.eslintImports don't detect `.eslintrc.js` conf

When a .eslintrc is used the plugin-kit correctly detects that I have @sanity/no-v2-imports in my extends array.
But when using .eslintrc.js I get this error:

โœ– 4 problems (3 errors, 1 warning)
ESLint detected Studio V2 imports that are no longer available.
It is recommended configure @sanity/eslint-config-no-v2-imports for ESLint.

Run:
npm install --save-dev @sanity/eslint-config-no-v2-imports

In .eslintrc add:
"extends": ["@sanity/no-v2-imports"]

This way, V2-imports can be identified directly in the IDE, or using eslint CLI.
For more, see https://github.com/sanity-io/eslint-config-no-v2-imports

If the plugin package does not use eslint, disable this check.

To skip this validation add the following to your package.json:
"sanityPlugin": {
   "verifyPackage": {
      "eslintImports": false
   }
}

Repro: https://github.com/sanity-io/sanity-plugin-mux-input

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.