Skip to content

Commit

Permalink
fix: change ordering for import and require
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Aug 15, 2023
1 parent 1f132e3 commit 88bf94f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/npm/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ export async function writePackageJson(data: PackageData, options: InjectOptions
'.': {
...(flags.typescript ? {types: `./${outDir}/index.d.ts`} : {}),
source,
require: `./${outDir}/index.js`,
import: `./${outDir}/index.esm.js`,
require: `./${outDir}/index.js`,
default: `./${outDir}/index.esm.js`,
},
'./package.json': './package.json',
Expand Down
38 changes: 19 additions & 19 deletions tap-snapshots/test/verify-package.test.ts.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Suggested next steps:
`

exports[`test/verify-package.test.ts TAP plugin-kit verify-package in package with all checks failing > stderr should match snapshot 1`] = `
[error]
[error]
Invalid package.json: "name" should be prefixed with "sanity-plugin-" (or scoped - @your-company/plugin-name)
To skip this validation add the following to your package.json:
Expand All @@ -25,7 +25,7 @@ To skip this validation add the following to your package.json:
}
}
----------------------------------------------------------
[error]
[error]
package.json does not list @sanity/pkg-utils as a devDependency.
@sanity/pkg-utils replaced parcel as the recommended build tool in @sanity/plugin-kit 2.0.0
Expand All @@ -38,7 +38,7 @@ To skip this validation add the following to your package.json:
}
}
----------------------------------------------------------
[error]
[error]
Expected one of [src/index.js, src/index.ts] to exist.
@sanity/pkg-utils expects a non-jsx file to be the source entry-point for the plugin.
Expand All @@ -51,7 +51,7 @@ To skip this validation add the following to your package.json:
}
}
----------------------------------------------------------
[error]
[error]
The following script commands did not contain expected defaults: build, watch, link-watch, prepublishOnly
This checks for that the commands-strings includes these terms.
Expand All @@ -70,7 +70,7 @@ To skip this validation add the following to your package.json:
}
}
----------------------------------------------------------
[error]
[error]
Expected source, exports, main, module and files entries in package.json, but source, exports, main, module where missing.
Example:
Expand All @@ -83,8 +83,8 @@ package.json should contain the following entries to ensure that commonjs and es
".": {
"types": "./dist/index.d.ts",
"source": "./src/index.ts",
"require": "./dist/index.js",
"import": "./dist/index.esm.js",
"require": "./dist/index.js",
"default": "./dist/index.js"
}
},
Expand All @@ -105,7 +105,7 @@ To skip this validation add the following to your package.json:
}
}
----------------------------------------------------------
[error]
[error]
Expected package.json to contain engines.node: ">=14" to ensure Studio compatible builds,
but it was: undefined
Expand All @@ -122,7 +122,7 @@ To skip this validation add the following to your package.json:
}
}
----------------------------------------------------------
[error]
[error]
Found multiple config files that serve the same purpose: [.eslintrc, .eslintrc.json].
There should be at most one of these files. Delete the rest.
Expand All @@ -134,7 +134,7 @@ To skip this validation add the following to your package.json:
}
}
----------------------------------------------------------
[error]
[error]
package.json contains prettier, but there also exists a config file that serves the same purpose.
Config file: .prettierrc]
Expand All @@ -147,7 +147,7 @@ To skip this validation add the following to your package.json:
}
}
----------------------------------------------------------
[error]
[error]
Recommended tsconfig.json compilerOptions missing:
The following fields had unexpected values: [moduleResolution, target, module, emitDeclarationOnly, esModuleInterop, skipLibCheck, isolatedModules, downlevelIteration, declaration, allowSyntheticDefaultImports, rootDir, outDir]
Expand All @@ -174,7 +174,7 @@ To skip this validation add the following to your package.json:
}
}
----------------------------------------------------------
[error]
[error]
Invalid sanity.json. It is used for compatibility checking in V2 studios:
- The part should implement part:@sanity/base/sanity-root, but did not.
Expand All @@ -194,7 +194,7 @@ To skip this validation add the following to your package.json:
}
}
----------------------------------------------------------
[error]
[error]
Found babel-config file: [babel.config.js]. When using default @sanity/plugin-kit build command,
this is probably not needed.
Expand All @@ -207,7 +207,7 @@ To skip this validation add the following to your package.json:
}
}
----------------------------------------------------------
[error]
[error]
package.json depends on "@sanity/*" packages that have moved into "sanity" package.
The following dependencies should be replaced with "sanity":
Expand All @@ -223,7 +223,7 @@ To skip this validation add the following to your package.json:
}
}
----------------------------------------------------------
[error]
[error]
package.json contains deprecated dependencies that should be removed:
- parcel
Expand All @@ -234,7 +234,7 @@ To skip this validation add the following to your package.json:
}
}
----------------------------------------------------------
[error]
[error]
root/src/index.tsx
1:1 error '@sanity/base' import is restricted from being used by a pattern. Use sanity instead of @sanity/base no-restricted-imports
Expand Down Expand Up @@ -296,7 +296,7 @@ Referenced from: root/.eslintrc
importerName: root/.eslintrc'
}
}
[error]
[error]
Failed to run ESLint. Is ESLint configured?
If the package does not use eslint, disable this check.
Expand Down Expand Up @@ -324,7 +324,7 @@ npx @sanity/plugin-kit verify-package' --single
`

exports[`test/verify-package.test.ts TAP plugin-kit verify-studio in fresh v2 studio > stderr should match snapshot 1`] = `
[error]
[error]
Found sanity.json. This file is not used by Sanity Studio V3.
Please consult the Studio V3 migration guide:
Expand Down Expand Up @@ -386,7 +386,7 @@ To skip this validation add the following to your package.json:
}
}
----------------------------------------------------------
[error]
[error]
package.json depends on "@sanity/*" packages that have moved into "sanity" package.
The following dependencies should be replaced with "sanity":
Expand All @@ -406,7 +406,7 @@ To skip this validation add the following to your package.json:
}
}
----------------------------------------------------------
[error]
[error]
root/schemas/schema.js
2:1 error 'part:@sanity/base/schema-creator' import is restricted from being used by a pattern. part: imports where removed in Sanity v3. Please refer to the migration guide: https://beta.sanity.io/docs/platform/v2-to-v3, or new API-reference docs: https://beta.sanity.io/docs/reference no-restricted-imports
Expand Down

0 comments on commit 88bf94f

Please sign in to comment.