├── test ├── fixtures │ ├── build │ │ ├── ts │ │ │ ├── .eslintignore │ │ │ ├── README.md │ │ │ ├── types.d.ts │ │ │ ├── src │ │ │ │ ├── styles │ │ │ │ │ └── one.css │ │ │ │ ├── two.ts │ │ │ │ └── one.tsx │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── plain │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── src │ │ │ │ └── schemaType.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── valid │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── src │ │ │ │ ├── styles │ │ │ │ │ └── one.css │ │ │ │ ├── two.js │ │ │ │ └── one.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ └── folder-sanity-json │ │ │ ├── sanity.json │ │ │ └── .gitkeep │ │ │ ├── src │ │ │ └── one.js │ │ │ └── package.json │ ├── verify │ │ ├── plain │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── src │ │ │ │ └── schemaType.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── css-import │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── lib │ │ │ │ ├── styles │ │ │ │ │ └── One.css │ │ │ │ ├── two.js │ │ │ │ └── one.js │ │ │ ├── src │ │ │ │ ├── styles │ │ │ │ │ └── One.css │ │ │ │ ├── two.js │ │ │ │ └── one.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── css-part │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── lib │ │ │ │ ├── styles │ │ │ │ │ └── one.css │ │ │ │ ├── two.js │ │ │ │ └── one.js │ │ │ ├── src │ │ │ │ ├── styles │ │ │ │ │ └── one.css │ │ │ │ ├── two.js │ │ │ │ └── one.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── ui-peer-dep │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── sanity.json │ │ │ ├── src │ │ │ │ └── schemaType.js │ │ │ └── package.json │ │ ├── valid-built │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── lib │ │ │ │ ├── styles │ │ │ │ │ └── one.css │ │ │ │ ├── two.js │ │ │ │ └── one.js │ │ │ ├── src │ │ │ │ ├── styles │ │ │ │ │ └── one.css │ │ │ │ ├── two.js │ │ │ │ └── one.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── css-bad-composes │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── lib │ │ │ │ ├── styles │ │ │ │ │ ├── button.css │ │ │ │ │ └── one.css │ │ │ │ ├── two.js │ │ │ │ └── one.js │ │ │ ├── src │ │ │ │ ├── styles │ │ │ │ │ ├── button.css │ │ │ │ │ └── one.css │ │ │ │ ├── two.js │ │ │ │ └── one.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── css-bad-import │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── lib │ │ │ │ ├── styles │ │ │ │ │ ├── button.css │ │ │ │ │ └── one.css │ │ │ │ └── one.js │ │ │ ├── src │ │ │ │ ├── styles │ │ │ │ │ ├── button.css │ │ │ │ │ └── one.css │ │ │ │ └── one.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── css-part-missing │ │ │ ├── LICENSE │ │ │ ├── src │ │ │ │ ├── styles │ │ │ │ │ └── one.css │ │ │ │ ├── two.js │ │ │ │ └── one.js │ │ │ ├── lib │ │ │ │ ├── two.js │ │ │ │ └── one.js │ │ │ ├── README.md │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── css-raw-import │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── lib │ │ │ │ ├── styles │ │ │ │ │ └── One.css │ │ │ │ ├── two.js │ │ │ │ └── one.js │ │ │ ├── src │ │ │ │ ├── styles │ │ │ │ │ └── One.css │ │ │ │ ├── two.js │ │ │ │ └── one.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── icons-peer-dep │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── sanity.json │ │ │ ├── src │ │ │ │ └── schemaType.js │ │ │ └── package.json │ │ ├── missing-license │ │ │ ├── README.md │ │ │ ├── src │ │ │ │ └── one.js │ │ │ ├── lib │ │ │ │ └── one.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── non-spdx-license │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── src │ │ │ │ └── one.js │ │ │ ├── lib │ │ │ │ └── one.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── ui-low-version │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── sanity.json │ │ │ ├── src │ │ │ │ └── schemaType.js │ │ │ └── package.json │ │ ├── useless-files │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── .eslintignore │ │ │ ├── .prettierrc │ │ │ ├── lib │ │ │ │ ├── styles │ │ │ │ │ └── one.css │ │ │ │ ├── two.js │ │ │ │ └── one.js │ │ │ ├── src │ │ │ │ ├── styles │ │ │ │ │ └── one.css │ │ │ │ ├── two.js │ │ │ │ └── one.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── css-raw-import-missing │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── lib │ │ │ │ ├── styles │ │ │ │ │ └── One.css │ │ │ │ ├── two.js │ │ │ │ └── one.js │ │ │ ├── src │ │ │ │ ├── styles │ │ │ │ │ └── One.css │ │ │ │ ├── two.js │ │ │ │ └── one.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── invalid-dist-config │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── config.dist.json │ │ │ ├── src │ │ │ │ └── one.js │ │ │ ├── lib │ │ │ │ └── one.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── missing-license-key │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── src │ │ │ │ └── one.js │ │ │ ├── lib │ │ │ │ └── one.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── npm-ref-ignored-file │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── types.d.ts │ │ │ ├── src │ │ │ │ └── one.js │ │ │ ├── lib │ │ │ │ └── one.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── part-ref-ignored-file │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── src │ │ │ │ └── ignored.js │ │ │ ├── lib │ │ │ │ └── ignored.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── valid-kitchen-sink │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── lib │ │ │ │ ├── styles │ │ │ │ │ ├── button.css │ │ │ │ │ ├── customLeaf.css │ │ │ │ │ ├── leaflet │ │ │ │ │ │ ├── markers │ │ │ │ │ │ │ └── marker.css │ │ │ │ │ │ └── leaflet.css │ │ │ │ │ └── one.css │ │ │ │ ├── two.js │ │ │ │ └── one.js │ │ │ ├── src │ │ │ │ ├── styles │ │ │ │ │ ├── button.css │ │ │ │ │ ├── customLeaf.css │ │ │ │ │ ├── leaflet │ │ │ │ │ │ ├── markers │ │ │ │ │ │ │ └── marker.css │ │ │ │ │ │ └── leaflet.css │ │ │ │ │ └── one.css │ │ │ │ ├── two.js │ │ │ │ └── one.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ └── invalid-dist-config-syntax │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── config.dist.json │ │ │ ├── src │ │ │ └── one.js │ │ │ ├── lib │ │ │ └── one.js │ │ │ ├── sanity.json │ │ │ └── package.json │ ├── build-npm │ │ ├── folder-package-json │ │ │ ├── package.json │ │ │ │ └── .gitkeep │ │ │ ├── src │ │ │ │ └── one.js │ │ │ └── sanity.json │ │ ├── invalid-package-json │ │ │ ├── package.json │ │ │ ├── src │ │ │ │ └── one.js │ │ │ └── sanity.json │ │ ├── no-package-json │ │ │ ├── src │ │ │ │ └── one.js │ │ │ └── sanity.json │ │ ├── misnamed-package-json │ │ │ ├── src │ │ │ │ └── one.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── orphaned-package-json │ │ │ ├── src │ │ │ │ └── one.js │ │ │ ├── out │ │ │ │ └── orphan.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── outscoped-package-json │ │ │ ├── src │ │ │ │ └── one.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── pathless-package-json │ │ │ ├── src │ │ │ │ └── one.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── sourced-package-json │ │ │ ├── src │ │ │ │ └── one.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── disallowed-package-json │ │ │ ├── src │ │ │ │ └── one.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── invalid-package-json-shape │ │ │ ├── src │ │ │ │ └── one.js │ │ │ ├── package.json │ │ │ └── sanity.json │ │ ├── nonstring-main-package-json │ │ │ ├── src │ │ │ │ └── one.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── targetless-package-json │ │ │ ├── src │ │ │ │ └── one.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── unprefixed-package-json │ │ │ ├── src │ │ │ │ └── one.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ └── double-lockfile │ │ │ ├── src │ │ │ ├── styles │ │ │ │ └── one.css │ │ │ ├── two.js │ │ │ └── one.js │ │ │ ├── yarn.lock │ │ │ ├── package-lock.json │ │ │ ├── sanity.json │ │ │ └── package.json │ └── build-sanity │ │ ├── invalid-sanity-json │ │ ├── sanity.json │ │ ├── src │ │ │ ├── styles │ │ │ │ └── one.css │ │ │ ├── two.js │ │ │ └── one.js │ │ └── package.json │ │ ├── no-sanity-json │ │ ├── src │ │ │ └── one.js │ │ └── package.json │ │ ├── nonbool-sanity-json │ │ ├── sanity.json │ │ ├── src │ │ │ ├── styles │ │ │ │ └── one.css │ │ │ ├── two.js │ │ │ └── one.js │ │ └── package.json │ │ ├── nonobject-sanity-json │ │ ├── sanity.json │ │ ├── src │ │ │ ├── styles │ │ │ │ └── one.css │ │ │ ├── two.js │ │ │ └── one.js │ │ └── package.json │ │ ├── disallowed-root-sanity-json │ │ ├── sanity.json │ │ ├── src │ │ │ ├── styles │ │ │ │ └── one.css │ │ │ ├── two.js │ │ │ └── one.js │ │ └── package.json │ │ ├── invalid-sanity-json-shape │ │ ├── sanity.json │ │ ├── src │ │ │ ├── styles │ │ │ │ └── one.css │ │ │ ├── two.js │ │ │ └── one.js │ │ └── package.json │ │ ├── disallowed-sanity-json │ │ ├── src │ │ │ ├── styles │ │ │ │ └── one.css │ │ │ ├── two.js │ │ │ └── one.js │ │ ├── sanity.json │ │ └── package.json │ │ ├── invalid-part-sanity-json │ │ ├── src │ │ │ ├── styles │ │ │ │ └── one.css │ │ │ ├── two.js │ │ │ └── one.js │ │ ├── sanity.json │ │ └── package.json │ │ ├── invalid-part-keys-sanity-json │ │ ├── src │ │ │ ├── styles │ │ │ │ └── one.css │ │ │ ├── two.js │ │ │ └── one.js │ │ ├── package.json │ │ └── sanity.json │ │ ├── nonarray-parts-sanity-json │ │ ├── src │ │ │ ├── styles │ │ │ │ └── one.css │ │ │ ├── two.js │ │ │ └── one.js │ │ ├── sanity.json │ │ └── package.json │ │ ├── nonobject-part-sanity-json │ │ ├── src │ │ │ ├── styles │ │ │ │ └── one.css │ │ │ ├── two.js │ │ │ └── one.js │ │ ├── sanity.json │ │ └── package.json │ │ ├── nonstring-compiled-sanity-json │ │ ├── src │ │ │ ├── styles │ │ │ │ └── one.css │ │ │ ├── two.js │ │ │ └── one.js │ │ ├── sanity.json │ │ └── package.json │ │ ├── nonstring-source-sanity-json │ │ ├── src │ │ │ ├── styles │ │ │ │ └── one.css │ │ │ ├── two.js │ │ │ └── one.js │ │ ├── sanity.json │ │ └── package.json │ │ ├── unprefixed-part-sanity-json │ │ ├── src │ │ │ ├── styles │ │ │ │ └── one.css │ │ │ ├── two.js │ │ │ └── one.js │ │ ├── sanity.json │ │ └── package.json │ │ ├── unprefixed-implementation-sanity-json │ │ ├── src │ │ │ ├── styles │ │ │ │ └── one.css │ │ │ ├── two.js │ │ │ └── one.js │ │ ├── sanity.json │ │ └── package.json │ │ └── dotted-filename-part-sanity-json │ │ ├── src │ │ └── my.schema.js │ │ ├── sanity.json │ │ ├── lib │ │ ├── my.schema.js │ │ └── my.schema.js.map │ │ └── package.json ├── version.test.js ├── cli.test.js ├── build.test.js ├── build-npm.test.js └── build-sanity.test.js ├── src ├── assets │ └── splat │ │ ├── babelrc │ │ ├── prettier.config.js │ │ ├── npmignore │ │ ├── eslint.config.js │ │ ├── editorconfig │ │ ├── gitignore │ │ └── LICENSE ├── configs │ ├── buildExtensions.js │ ├── babelrc.js │ └── uselessFiles.js ├── util │ ├── nullifyError.js │ ├── request.js │ ├── log.js │ ├── prompt.js │ ├── user.js │ ├── readme.js │ └── files.js ├── index.js ├── cmds │ ├── index.js │ ├── verify.js │ ├── version.js │ ├── build.js │ ├── splat.js │ └── init.js ├── sharedFlags.js ├── npm │ ├── publish.js │ ├── resolveLatestVersions.js │ └── manager.js ├── actions │ ├── init.js │ └── build.js ├── dependencies │ └── find.js └── sanity │ └── manifest.js ├── .npmignore ├── babel ├── index.js └── eslint-parser.js ├── .editorconfig ├── .github └── workflows │ └── main.yml ├── .gitignore ├── LICENSE ├── bin └── sanipack.js ├── package.json └── README.md /test/fixtures/build/ts/.eslintignore: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /test/fixtures/build/plain/LICENSE: -------------------------------------------------------------------------------- 1 | some license 2 | -------------------------------------------------------------------------------- /test/fixtures/build/plain/README.md: -------------------------------------------------------------------------------- 1 | # some cool 2 | -------------------------------------------------------------------------------- /test/fixtures/build/ts/README.md: -------------------------------------------------------------------------------- 1 | # just a readme 2 | -------------------------------------------------------------------------------- /test/fixtures/build/ts/types.d.ts: -------------------------------------------------------------------------------- 1 | export = string 2 | -------------------------------------------------------------------------------- /test/fixtures/build/valid/LICENSE: -------------------------------------------------------------------------------- 1 | some license 2 | -------------------------------------------------------------------------------- /test/fixtures/build/valid/README.md: -------------------------------------------------------------------------------- 1 | # some cool 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/plain/LICENSE: -------------------------------------------------------------------------------- 1 | some license 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/plain/README.md: -------------------------------------------------------------------------------- 1 | # some cool 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-import/LICENSE: -------------------------------------------------------------------------------- 1 | some license 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-import/README.md: -------------------------------------------------------------------------------- 1 | # some cool 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-part/LICENSE: -------------------------------------------------------------------------------- 1 | some license 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-part/README.md: -------------------------------------------------------------------------------- 1 | # some cool 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/ui-peer-dep/LICENSE: -------------------------------------------------------------------------------- 1 | some license 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/ui-peer-dep/README.md: -------------------------------------------------------------------------------- 1 | # some cool 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/valid-built/LICENSE: -------------------------------------------------------------------------------- 1 | some license 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/valid-built/README.md: -------------------------------------------------------------------------------- 1 | # some cool 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-bad-composes/LICENSE: -------------------------------------------------------------------------------- 1 | some license 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-bad-composes/README.md: -------------------------------------------------------------------------------- 1 | # some cool 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-bad-import/LICENSE: -------------------------------------------------------------------------------- 1 | some license 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-bad-import/README.md: -------------------------------------------------------------------------------- 1 | # some cool 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-part-missing/LICENSE: -------------------------------------------------------------------------------- 1 | some license 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-raw-import/LICENSE: -------------------------------------------------------------------------------- 1 | some license 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-raw-import/README.md: -------------------------------------------------------------------------------- 1 | # some cool 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/icons-peer-dep/LICENSE: -------------------------------------------------------------------------------- 1 | some license 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/icons-peer-dep/README.md: -------------------------------------------------------------------------------- 1 | # some cool 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/missing-license/README.md: -------------------------------------------------------------------------------- 1 | # so cool 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/non-spdx-license/LICENSE: -------------------------------------------------------------------------------- 1 | some license 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/non-spdx-license/README.md: -------------------------------------------------------------------------------- 1 | # so cool 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/ui-low-version/LICENSE: -------------------------------------------------------------------------------- 1 | some license 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/ui-low-version/README.md: -------------------------------------------------------------------------------- 1 | # some cool 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/useless-files/LICENSE: -------------------------------------------------------------------------------- 1 | some license 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/useless-files/README.md: -------------------------------------------------------------------------------- 1 | # some cool 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-raw-import-missing/LICENSE: -------------------------------------------------------------------------------- 1 | some license 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/invalid-dist-config/LICENSE: -------------------------------------------------------------------------------- 1 | some license 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/invalid-dist-config/README.md: -------------------------------------------------------------------------------- 1 | # some cool 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/invalid-dist-config/config.dist.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/missing-license-key/LICENSE: -------------------------------------------------------------------------------- 1 | some license 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/missing-license-key/README.md: -------------------------------------------------------------------------------- 1 | # so cool 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/npm-ref-ignored-file/LICENSE: -------------------------------------------------------------------------------- 1 | some license 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/npm-ref-ignored-file/README.md: -------------------------------------------------------------------------------- 1 | # so cool 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/part-ref-ignored-file/LICENSE: -------------------------------------------------------------------------------- 1 | some license 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/part-ref-ignored-file/README.md: -------------------------------------------------------------------------------- 1 | # so cool 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/valid-kitchen-sink/LICENSE: -------------------------------------------------------------------------------- 1 | some license 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/valid-kitchen-sink/README.md: -------------------------------------------------------------------------------- 1 | # some cool 2 | -------------------------------------------------------------------------------- /src/assets/splat/babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "sanipack/babel" 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build/folder-sanity-json/sanity.json/.gitkeep: -------------------------------------------------------------------------------- 1 | Keep me 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-raw-import-missing/README.md: -------------------------------------------------------------------------------- 1 | # some cool 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/invalid-dist-config-syntax/LICENSE: -------------------------------------------------------------------------------- 1 | some license 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/invalid-dist-config-syntax/README.md: -------------------------------------------------------------------------------- 1 | # some cool 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/npm-ref-ignored-file/types.d.ts: -------------------------------------------------------------------------------- 1 | exports = {} 2 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/folder-package-json/package.json/.gitkeep: -------------------------------------------------------------------------------- 1 | Keep me 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/useless-files/.eslintignore: -------------------------------------------------------------------------------- 1 | some 2 | files 3 | here 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/useless-files/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/invalid-package-json/package.json: -------------------------------------------------------------------------------- 1 | this aint no json 2 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/no-package-json/src/one.js: -------------------------------------------------------------------------------- 1 | export default () => 'one' 2 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/invalid-sanity-json/sanity.json: -------------------------------------------------------------------------------- 1 | This aint no JSON 2 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/no-sanity-json/src/one.js: -------------------------------------------------------------------------------- 1 | export default () => 'one' 2 | -------------------------------------------------------------------------------- /test/fixtures/build/folder-sanity-json/src/one.js: -------------------------------------------------------------------------------- 1 | export default () => 'one' 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/invalid-dist-config-syntax/config.dist.json: -------------------------------------------------------------------------------- 1 | { 2 | "foo" 3 | -------------------------------------------------------------------------------- /test/fixtures/verify/invalid-dist-config/src/one.js: -------------------------------------------------------------------------------- 1 | module.exports = () => null 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/missing-license-key/src/one.js: -------------------------------------------------------------------------------- 1 | module.exports = () => null 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/missing-license/src/one.js: -------------------------------------------------------------------------------- 1 | module.exports = () => null 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/non-spdx-license/src/one.js: -------------------------------------------------------------------------------- 1 | module.exports = () => null 2 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/folder-package-json/src/one.js: -------------------------------------------------------------------------------- 1 | export default () => 'one' 2 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/invalid-package-json/src/one.js: -------------------------------------------------------------------------------- 1 | export default () => 'one' 2 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/misnamed-package-json/src/one.js: -------------------------------------------------------------------------------- 1 | export default () => 'one' 2 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/orphaned-package-json/src/one.js: -------------------------------------------------------------------------------- 1 | export default () => 'one' 2 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/outscoped-package-json/src/one.js: -------------------------------------------------------------------------------- 1 | export default () => 'one' 2 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/pathless-package-json/src/one.js: -------------------------------------------------------------------------------- 1 | export default () => 'one' 2 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/sourced-package-json/src/one.js: -------------------------------------------------------------------------------- 1 | export default () => 'one' 2 | -------------------------------------------------------------------------------- /test/fixtures/build/ts/src/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/npm-ref-ignored-file/src/one.js: -------------------------------------------------------------------------------- 1 | module.exports = () => null 2 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/disallowed-package-json/src/one.js: -------------------------------------------------------------------------------- 1 | export default () => 'one' 2 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/invalid-package-json-shape/src/one.js: -------------------------------------------------------------------------------- 1 | export default () => 'one' 2 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/nonstring-main-package-json/src/one.js: -------------------------------------------------------------------------------- 1 | export default () => 'one' 2 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/orphaned-package-json/out/orphan.js: -------------------------------------------------------------------------------- 1 | module.exports = 'orphan' 2 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/targetless-package-json/src/one.js: -------------------------------------------------------------------------------- 1 | export default () => 'one' 2 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/unprefixed-package-json/src/one.js: -------------------------------------------------------------------------------- 1 | export default () => 'one' 2 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonbool-sanity-json/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": null 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonobject-sanity-json/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": true 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build/valid/src/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/invalid-dist-config-syntax/src/one.js: -------------------------------------------------------------------------------- 1 | module.exports = () => null 2 | -------------------------------------------------------------------------------- /test/fixtures/verify/part-ref-ignored-file/src/ignored.js: -------------------------------------------------------------------------------- 1 | module.exports = () => null 2 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/disallowed-root-sanity-json/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-import/lib/styles/One.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-import/src/styles/One.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-part/lib/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-part/src/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/missing-license/lib/one.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = () => null; -------------------------------------------------------------------------------- /test/fixtures/verify/valid-built/lib/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/valid-built/src/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-bad-composes/lib/styles/button.css: -------------------------------------------------------------------------------- 1 | .baseButton { 2 | color: #fff; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-bad-composes/src/styles/button.css: -------------------------------------------------------------------------------- 1 | .baseButton { 2 | color: #fff; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-bad-import/lib/styles/button.css: -------------------------------------------------------------------------------- 1 | .baseButton { 2 | color: #fff; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-bad-import/src/styles/button.css: -------------------------------------------------------------------------------- 1 | .baseButton { 2 | color: #fff; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-part-missing/src/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-raw-import/lib/styles/One.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-raw-import/src/styles/One.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/invalid-dist-config/lib/one.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = () => null; -------------------------------------------------------------------------------- /test/fixtures/verify/missing-license-key/lib/one.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = () => null; -------------------------------------------------------------------------------- /test/fixtures/verify/non-spdx-license/lib/one.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = () => null; -------------------------------------------------------------------------------- /test/fixtures/verify/npm-ref-ignored-file/lib/one.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = () => null; -------------------------------------------------------------------------------- /test/fixtures/verify/useless-files/lib/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/useless-files/src/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/double-lockfile/src/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/invalid-sanity-json-shape/sanity.json: -------------------------------------------------------------------------------- 1 | ["json", "but", "not", "an", "object"] 2 | -------------------------------------------------------------------------------- /test/fixtures/build/ts/src/two.ts: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/part-ref-ignored-file/lib/ignored.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = () => null; -------------------------------------------------------------------------------- /test/fixtures/verify/valid-kitchen-sink/lib/styles/button.css: -------------------------------------------------------------------------------- 1 | .baseButton { 2 | color: #fff; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/valid-kitchen-sink/src/styles/button.css: -------------------------------------------------------------------------------- 1 | .baseButton { 2 | color: #fff; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/invalid-sanity-json/src/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonbool-sanity-json/src/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build/valid/src/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-raw-import-missing/lib/styles/One.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-raw-import-missing/src/styles/One.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/invalid-dist-config-syntax/lib/one.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = () => null; -------------------------------------------------------------------------------- /src/configs/buildExtensions.js: -------------------------------------------------------------------------------- 1 | exports.buildExtensions = ['.js', '.jsx', '.es6', '.es', '.mjs', '.ts', '.tsx'] 2 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/disallowed-sanity-json/src/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/invalid-part-sanity-json/src/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/invalid-sanity-json-shape/src/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonobject-sanity-json/src/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-import/lib/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-import/src/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-part/lib/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-part/src/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/valid-built/src/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/valid-kitchen-sink/lib/styles/customLeaf.css: -------------------------------------------------------------------------------- 1 | :global .leaflet { 2 | height: 100%; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/valid-kitchen-sink/src/styles/customLeaf.css: -------------------------------------------------------------------------------- 1 | :global .leaflet { 2 | height: 100%; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/disallowed-root-sanity-json/src/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/invalid-part-keys-sanity-json/src/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonarray-parts-sanity-json/src/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonobject-part-sanity-json/src/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonstring-compiled-sanity-json/src/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonstring-source-sanity-json/src/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/unprefixed-part-sanity-json/src/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-bad-composes/lib/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-bad-composes/src/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-part-missing/lib/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-part-missing/src/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-raw-import/lib/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-raw-import/src/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/useless-files/src/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/double-lockfile/src/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-raw-import-missing/lib/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-raw-import-missing/src/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/valid-kitchen-sink/lib/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/valid-kitchen-sink/src/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/invalid-sanity-json/src/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonbool-sanity-json/src/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonobject-sanity-json/src/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/unprefixed-implementation-sanity-json/src/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/disallowed-sanity-json/src/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/invalid-part-sanity-json/src/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/invalid-sanity-json-shape/src/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonarray-parts-sanity-json/src/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonobject-part-sanity-json/src/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-bad-import/lib/styles/one.css: -------------------------------------------------------------------------------- 1 | @import './Button.css'; 2 | 3 | .button { 4 | background: #bf1942; 5 | } 6 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-bad-import/src/styles/one.css: -------------------------------------------------------------------------------- 1 | @import './Button.css'; 2 | 3 | .button { 4 | background: #bf1942; 5 | } 6 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/invalid-package-json-shape/package.json: -------------------------------------------------------------------------------- 1 | [ 2 | "json", 3 | "but", 4 | "not", 5 | "an", 6 | "object" 7 | ] 8 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/disallowed-root-sanity-json/src/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/invalid-part-keys-sanity-json/src/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonstring-compiled-sanity-json/src/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonstring-source-sanity-json/src/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/unprefixed-part-sanity-json/src/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/build/plain/src/schemaType.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'markdown', 3 | title: 'Markdown', 4 | type: 'string', 5 | } 6 | -------------------------------------------------------------------------------- /test/fixtures/verify/missing-license/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/fixtures/verify/non-spdx-license/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/fixtures/verify/invalid-dist-config/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/fixtures/verify/missing-license-key/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/fixtures/verify/npm-ref-ignored-file/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/fixtures/verify/plain/src/schemaType.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'markdown', 3 | title: 'Markdown', 4 | type: 'string', 5 | } 6 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | /.github 2 | /.editorconfig 3 | /.eslintrc 4 | /.gitignore 5 | /.prettierrc 6 | /.taprc 7 | /coverage 8 | /test 9 | .nyc_output 10 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/double-lockfile/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/unprefixed-implementation-sanity-json/src/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify/invalid-dist-config-syntax/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /babel/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Consumer babel config, eg: 3 | * {"extends": "sanipack/babel"} 4 | */ 5 | module.exports = require('../src/configs/babelrc') 6 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonstring-compiled-sanity-json/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": true 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonstring-source-sanity-json/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": {}, 4 | "compiled": "./lib" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-bad-composes/lib/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | composes: baseButton from './baseButton.css'; 3 | background: #bf1942; 4 | } 5 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-bad-composes/src/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | composes: baseButton from './baseButton.css'; 3 | background: #bf1942; 4 | } 5 | -------------------------------------------------------------------------------- /src/assets/splat/prettier.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | semi: false, 3 | printWidth: 100, 4 | bracketSpacing: false, 5 | singleQuote: true, 6 | } 7 | -------------------------------------------------------------------------------- /src/assets/splat/npmignore: -------------------------------------------------------------------------------- 1 | /test 2 | /coverage 3 | .editorconfig 4 | .eslintrc 5 | .gitignore 6 | .github 7 | .prettierrc 8 | .travis.yml 9 | .nyc_output 10 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/double-lockfile/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-double-lockfile", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1 5 | } 6 | -------------------------------------------------------------------------------- /test/fixtures/verify/valid-kitchen-sink/lib/styles/leaflet/markers/marker.css: -------------------------------------------------------------------------------- 1 | .marker { 2 | composes: baseButton from '../../button.css'; 3 | background: #bf1942; 4 | } 5 | -------------------------------------------------------------------------------- /test/fixtures/verify/valid-kitchen-sink/src/styles/leaflet/markers/marker.css: -------------------------------------------------------------------------------- 1 | .marker { 2 | composes: baseButton from '../../button.css'; 3 | background: #bf1942; 4 | } 5 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/disallowed-sanity-json/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "api": { 3 | "projectId": "abc123" 4 | }, 5 | "project": { 6 | "displayName": "foo" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/pathless-package-json/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "parts": [ 3 | { 4 | "name": "part:pathless/some/thing", 5 | "path": "one.js" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonobject-part-sanity-json/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": ["true"] 8 | } 9 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-part-missing/README.md: -------------------------------------------------------------------------------- 1 | Note how the `src` directory contains the `styles` folder while the `lib` does not. This is what we want to uncover in this fixture. 2 | -------------------------------------------------------------------------------- /test/fixtures/build/plain/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "parts": [ 3 | { 4 | "implements": "part:@sanity/base/schema-type", 5 | "path": "./src/schemaType.js" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /test/fixtures/verify/plain/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "parts": [ 3 | { 4 | "implements": "part:@sanity/base/schema-type", 5 | "path": "./src/schemaType.js" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /src/assets/splat/eslint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | parser: 'sanipack/babel/eslint-parser', 3 | extends: ['sanity', 'sanity/react', 'prettier'], 4 | ignorePatterns: ['lib/**/'], 5 | } 6 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/dotted-filename-part-sanity-json/src/my.schema.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: 'myThing', 3 | type: 'document', 4 | field: [{name: 'title', type: 'string'}], 5 | } 6 | -------------------------------------------------------------------------------- /test/fixtures/verify/ui-peer-dep/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "parts": [ 3 | { 4 | "implements": "part:@sanity/base/schema-type", 5 | "path": "./src/schemaType.js" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /test/fixtures/verify/valid-kitchen-sink/lib/styles/one.css: -------------------------------------------------------------------------------- 1 | @import './leaflet/leaflet.css'; 2 | 3 | .button { 4 | composes: baseButton from './button.css'; 5 | background: #bf1942; 6 | } 7 | -------------------------------------------------------------------------------- /test/fixtures/verify/valid-kitchen-sink/src/styles/one.css: -------------------------------------------------------------------------------- 1 | @import './leaflet/leaflet.css'; 2 | 3 | .button { 4 | composes: baseButton from './button.css'; 5 | background: #bf1942; 6 | } 7 | -------------------------------------------------------------------------------- /src/util/nullifyError.js: -------------------------------------------------------------------------------- 1 | module.exports = {nullifyError} 2 | 3 | function nullifyError(err) { 4 | if (err instanceof TypeError) { 5 | throw err 6 | } 7 | 8 | return null 9 | } 10 | -------------------------------------------------------------------------------- /test/fixtures/verify/icons-peer-dep/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "parts": [ 3 | { 4 | "implements": "part:@sanity/base/schema-type", 5 | "path": "./src/schemaType.js" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /test/fixtures/verify/ui-low-version/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "parts": [ 3 | { 4 | "implements": "part:@sanity/base/schema-type", 5 | "path": "./src/schemaType.js" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /babel/eslint-parser.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Re-exported eslint parser for consumers, eg (.eslintrc): 3 | * {"parser": "sanipack/babel/eslint-parser"} 4 | */ 5 | module.exports = require('@babel/eslint-parser') 6 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonarray-parts-sanity-json/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": { 8 | "foo": "bar" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/fixtures/verify/valid-built/lib/two.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.default = two; 7 | 8 | function two() {// do something important 9 | } -------------------------------------------------------------------------------- /test/fixtures/verify/useless-files/lib/two.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.default = two; 7 | 8 | function two() {// do something important 9 | } -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | const build = require('./actions/build') 2 | const verify = require('./actions/verify') 3 | const splat = require('./actions/splat') 4 | 5 | module.exports = { 6 | build, 7 | verify, 8 | splat, 9 | } 10 | -------------------------------------------------------------------------------- /src/cmds/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | init: require.resolve('./init'), 3 | build: require.resolve('./build'), 4 | splat: require.resolve('./splat'), 5 | verify: require.resolve('./verify'), 6 | version: require.resolve('./version'), 7 | } 8 | -------------------------------------------------------------------------------- /test/fixtures/build/ts/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:ts/some/thing", 10 | "path": "one" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/invalid-part-sanity-json/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": 13, 10 | "path": 14 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/build/valid/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:valid/some/thing", 10 | "path": "one.js" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-import/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:css-part/some/thing", 10 | "path": "one.js" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/verify/useless-files/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:valid/some/thing", 10 | "path": "one.js" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/verify/valid-built/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:valid/some/thing", 10 | "path": "one.js" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/double-lockfile/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:valid/some/thing", 10 | "path": "one.js" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-bad-import/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:css-part/some/thing", 10 | "path": "one.js" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-raw-import/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:css-part/some/thing", 10 | "path": "one.js" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/verify/valid-kitchen-sink/lib/styles/leaflet/leaflet.css: -------------------------------------------------------------------------------- 1 | @import '../customLeaf.css'; 2 | 3 | :global .leaflet { 4 | width: 100%; 5 | } 6 | 7 | .localLeaf { 8 | composes: marker from './markers/marker.css'; 9 | 10 | font-size: 2em; 11 | } 12 | -------------------------------------------------------------------------------- /test/fixtures/verify/valid-kitchen-sink/src/styles/leaflet/leaflet.css: -------------------------------------------------------------------------------- 1 | @import '../customLeaf.css'; 2 | 3 | :global .leaflet { 4 | width: 100%; 5 | } 6 | 7 | .localLeaf { 8 | composes: marker from './markers/marker.css'; 9 | 10 | font-size: 2em; 11 | } 12 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-bad-composes/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:css-part/some/thing", 10 | "path": "one.js" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/verify/valid-kitchen-sink/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:css-part/some/thing", 10 | "path": "one.js" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | ; editorconfig.org 2 | root = true 3 | charset= utf8 4 | 5 | [*] 6 | end_of_line = lf 7 | insert_final_newline = true 8 | trim_trailing_whitespace = true 9 | indent_style = space 10 | indent_size = 2 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /src/sharedFlags.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | debug: { 3 | default: false, 4 | type: 'boolean', 5 | }, 6 | silent: { 7 | type: 'boolean', 8 | default: false, 9 | }, 10 | verbose: { 11 | type: 'boolean', 12 | default: false, 13 | }, 14 | } 15 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/no-package-json/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:no-package-json/some/thing", 10 | "path": "one.js" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/orphaned-package-json/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./out" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:orphaned/some/thing", 10 | "path": "one.js" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/sourced-package-json/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:sourced/some/thing", 10 | "path": "one.js" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/unprefixed-part-sanity-json/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "some-part-name", 10 | "path": "one.js" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-raw-import-missing/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:css-part/some/thing", 10 | "path": "one.js" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/nonstring-main-package-json/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:foobar/some/thing", 10 | "path": "one.js" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/outscoped-package-json/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:outscoped/some/thing", 10 | "path": "one.js" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/targetless-package-json/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:targetless/some/thing", 10 | "path": "one.js" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /src/npm/publish.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | const npmPacklist = require('npm-packlist') 3 | 4 | module.exports = {getPublishableFiles} 5 | 6 | function getPublishableFiles(basePath) { 7 | return npmPacklist({basePath}).then(files => files.map(file => path.normalize(file))) 8 | } 9 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/folder-package-json/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:folder-package-json/some/thing", 10 | "path": "one.js" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/invalid-package-json/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:invalid-package-json/some/thing", 10 | "path": "one.js" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /src/assets/splat/editorconfig: -------------------------------------------------------------------------------- 1 | ; editorconfig.org 2 | root = true 3 | charset= utf8 4 | 5 | [*] 6 | end_of_line = lf 7 | insert_final_newline = true 8 | trim_trailing_whitespace = true 9 | indent_style = space 10 | indent_size = 2 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/disallowed-package-json/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:invalid-package-json/some/thing", 10 | "path": "one.js" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/misnamed-package-json/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:invalid-package-json/some/thing", 10 | "path": "one.js" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/unprefixed-package-json/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:invalid-package-json/some/thing", 10 | "path": "one.js" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/unprefixed-implementation-sanity-json/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "implements": "some-part-name", 10 | "path": "one.js" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/verify/part-ref-ignored-file/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:part-ref-ignored-file/some/thing", 10 | "path": "ignored.js" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/invalid-package-json-shape/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:invalid-package-json/some/thing", 10 | "path": "one.js" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/verify/ui-peer-dep/src/schemaType.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import {Button} from '@sanity/ui' 3 | 4 | module.exports = { 5 | name: 'button', 6 | title: 'Button', 7 | type: 'string', 8 | inputComponent: () => React.createElement(Button, {text: 'Click me'}), 9 | } 10 | -------------------------------------------------------------------------------- /test/fixtures/verify/icons-peer-dep/src/schemaType.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import {Button} from '@sanity/ui' 3 | 4 | module.exports = { 5 | name: 'button', 6 | title: 'Button', 7 | type: 'string', 8 | inputComponent: () => React.createElement(Button, {text: 'Click me'}), 9 | } 10 | -------------------------------------------------------------------------------- /test/fixtures/verify/ui-low-version/src/schemaType.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import {Button} from '@sanity/ui' 3 | 4 | module.exports = { 5 | name: 'button', 6 | title: 'Button', 7 | type: 'string', 8 | inputComponent: () => React.createElement(Button, {text: 'Click me'}), 9 | } 10 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/dotted-filename-part-sanity-json/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "implements": "part:@sanity/base/schema-type", 10 | "path": "my.schema" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/build/plain/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-plain", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Just a fixture", 6 | "main": "./src/schemaType.js", 7 | "keywords": [ 8 | "sanity", 9 | "sanity-plugin" 10 | ], 11 | "author": "Some person", 12 | "license": "MIT" 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/verify/plain/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-plain", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Just a fixture", 6 | "main": "./src/schemaType.js", 7 | "keywords": [ 8 | "sanity", 9 | "sanity-plugin" 10 | ], 11 | "author": "Some person", 12 | "license": "MIT" 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/misnamed-package-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": 123, 3 | "private": true, 4 | "version": "1.0.0", 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [], 11 | "author": "Some person", 12 | "license": "ISC" 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-import/src/one.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import two from './two' 3 | import styles from './styles/one.css' 4 | 5 | export default class One extends React.PureComponent { 6 | componentDidMount() { 7 | two() 8 | } 9 | 10 | render() { 11 | return 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-part/src/one.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import two from './two' 3 | import styles from './styles/one.css' 4 | 5 | export default class One extends React.PureComponent { 6 | componentDidMount() { 7 | two() 8 | } 9 | 10 | render() { 11 | return 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-part/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:css-part/some/thing", 10 | "path": "one.js" 11 | }, 12 | { 13 | "name": "part:css-part/some/style", 14 | "path": "styles/one.css" 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-bad-composes/src/one.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import two from './two' 3 | import styles from './styles/one.css' 4 | 5 | export default class One extends React.PureComponent { 6 | componentDidMount() { 7 | two() 8 | } 9 | 10 | render() { 11 | return 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-part-missing/src/one.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import two from './two' 3 | import styles from './styles/one.css' 4 | 5 | export default class One extends React.PureComponent { 6 | componentDidMount() { 7 | two() 8 | } 9 | 10 | render() { 11 | return 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-raw-import/src/one.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import two from './two' 3 | import styles from './styles/One.css?raw' 4 | 5 | export default class One extends React.PureComponent { 6 | componentDidMount() { 7 | two() 8 | } 9 | 10 | render() { 11 | return 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/verify/valid-kitchen-sink/src/one.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import two from './two' 3 | import styles from './styles/one.css' 4 | 5 | export default class One extends React.PureComponent { 6 | componentDidMount() { 7 | two() 8 | } 9 | 10 | render() { 11 | return 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/nonstring-main-package-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-foobar", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "", 6 | "main": 123, 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [], 11 | "author": "Some person", 12 | "license": "ISC" 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/unprefixed-package-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "missing-prefix", 3 | "private": true, 4 | "version": "1.0.0", 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [], 11 | "author": "Some person", 12 | "license": "ISC" 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-part-missing/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:css-part/some/thing", 10 | "path": "one.js" 11 | }, 12 | { 13 | "name": "part:css-part/some/style", 14 | "path": "styles/one.css" 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/disallowed-package-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "This is not allowed", 3 | "private": true, 4 | "version": "1.0.0", 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [], 11 | "author": "Some person", 12 | "license": "ISC" 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/sourced-package-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-sourced", 3 | "private": true, 4 | "version": "1.0.0", 5 | "description": "", 6 | "main": "./src/one.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [], 11 | "author": "Some person", 12 | "license": "ISC" 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-raw-import-missing/src/one.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import two from './two' 3 | import styles from './styles/one.css?raw' 4 | 5 | export default class One extends React.PureComponent { 6 | componentDidMount() { 7 | two() 8 | } 9 | 10 | render() { 11 | return 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/orphaned-package-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-orphaned", 3 | "private": true, 4 | "version": "1.0.0", 5 | "description": "", 6 | "main": "./out/orphan.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [], 11 | "author": "Some person", 12 | "license": "ISC" 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/outscoped-package-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-outscoped", 3 | "private": true, 4 | "version": "1.0.0", 5 | "description": "", 6 | "main": "./foo/one.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [], 11 | "author": "Some person", 12 | "license": "ISC" 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/pathless-package-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-pathless", 3 | "private": true, 4 | "version": "1.0.0", 5 | "description": "", 6 | "main": "./source/one.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [], 11 | "author": "Some person", 12 | "license": "ISC" 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/targetless-package-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-targetless", 3 | "private": true, 4 | "version": "1.0.0", 5 | "description": "", 6 | "main": "./lib/1.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [], 11 | "author": "Some person", 12 | "license": "ISC" 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/no-sanity-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-no-sanity-json", 3 | "private": true, 4 | "version": "1.0.0", 5 | "description": "", 6 | "main": "src/one.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [], 11 | "author": "Some person", 12 | "license": "ISC" 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/invalid-sanity-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-invalid-sanity-json", 3 | "version": "1.0.0", 4 | "private": true, 5 | "main": "./src/one.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "sanity", 11 | "sanity-plugin" 12 | ], 13 | "author": "Some person", 14 | "license": "MIT" 15 | } 16 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonbool-sanity-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-nonbool-sanity-json", 3 | "version": "1.0.0", 4 | "private": true, 5 | "main": "./lib/one.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "sanity", 11 | "sanity-plugin" 12 | ], 13 | "author": "Some person", 14 | "license": "MIT" 15 | } 16 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/disallowed-sanity-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-disallowed-sanity-json", 3 | "version": "1.0.0", 4 | "private": true, 5 | "main": "./src/one.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "sanity", 11 | "sanity-plugin" 12 | ], 13 | "author": "Some person", 14 | "license": "MIT" 15 | } 16 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/dotted-filename-part-sanity-json/lib/my.schema.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.default = void 0; 7 | var _default = { 8 | name: 'myThing', 9 | type: 'document', 10 | field: [{ 11 | name: 'title', 12 | type: 'string' 13 | }] 14 | }; 15 | exports.default = _default; 16 | //# sourceMappingURL=my.schema.js.map -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonobject-sanity-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-nonobject-sanity-json", 3 | "version": "1.0.0", 4 | "private": true, 5 | "main": "./src/one.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "sanity", 11 | "sanity-plugin" 12 | ], 13 | "author": "Some person", 14 | "license": "MIT" 15 | } 16 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/invalid-part-sanity-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-invalid-part-sanity-json", 3 | "version": "1.0.0", 4 | "private": true, 5 | "main": "./lib/one.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "sanity", 11 | "sanity-plugin" 12 | ], 13 | "author": "Some person", 14 | "license": "MIT" 15 | } 16 | -------------------------------------------------------------------------------- /test/fixtures/verify/missing-license-key/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-missing-license-key", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Just a fixture", 6 | "main": "./lib/one.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [ 11 | "sanity", 12 | "sanity-plugin" 13 | ], 14 | "author": "Some person" 15 | } 16 | -------------------------------------------------------------------------------- /src/util/request.js: -------------------------------------------------------------------------------- 1 | const getIt = require('get-it') 2 | const {jsonRequest, jsonResponse, httpErrors, headers, promise} = require('get-it/middleware') 3 | const pkg = require('../../package.json') 4 | 5 | const request = getIt([ 6 | promise({onlyBody: true}), 7 | jsonRequest(), 8 | jsonResponse(), 9 | httpErrors(), 10 | headers({'User-Agent': `${pkg.name}@${pkg.version}`}), 11 | ]) 12 | 13 | module.exports = {request} 14 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/disallowed-root-sanity-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-disallowed-root-sanity-json", 3 | "version": "1.0.0", 4 | "private": true, 5 | "main": "./src/one.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "sanity", 11 | "sanity-plugin" 12 | ], 13 | "author": "Some person", 14 | "license": "MIT" 15 | } 16 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/invalid-sanity-json-shape/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-invalid-sanity-json-shape", 3 | "version": "1.0.0", 4 | "private": true, 5 | "main": "./lib/one.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "sanity", 11 | "sanity-plugin" 12 | ], 13 | "author": "Some person", 14 | "license": "MIT" 15 | } 16 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonarray-parts-sanity-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-nonarray-parts-sanity-json", 3 | "version": "1.0.0", 4 | "private": true, 5 | "main": "./lib/one.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "sanity", 11 | "sanity-plugin" 12 | ], 13 | "author": "Some person", 14 | "license": "MIT" 15 | } 16 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonobject-part-sanity-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-nonobject-part-sanity-json", 3 | "version": "1.0.0", 4 | "private": true, 5 | "main": "./lib/one.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "sanity", 11 | "sanity-plugin" 12 | ], 13 | "author": "Some person", 14 | "license": "MIT" 15 | } 16 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/unprefixed-part-sanity-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-unprefixed-part-sanity-json", 3 | "version": "1.0.0", 4 | "private": true, 5 | "main": "./lib/one.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "sanity", 11 | "sanity-plugin" 12 | ], 13 | "author": "Some person", 14 | "license": "MIT" 15 | } 16 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/invalid-part-keys-sanity-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-invalid-part-keys-sanity-json", 3 | "version": "1.0.0", 4 | "private": true, 5 | "main": "./lib/one.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "sanity", 11 | "sanity-plugin" 12 | ], 13 | "author": "Some person", 14 | "license": "MIT" 15 | } 16 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonstring-source-sanity-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-nonstring-source-sanity-json", 3 | "version": "1.0.0", 4 | "private": true, 5 | "main": "./lib/one.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "sanity", 11 | "sanity-plugin" 12 | ], 13 | "author": "Some person", 14 | "license": "MIT" 15 | } 16 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonstring-compiled-sanity-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-nonstring-compiled-sanity-json", 3 | "version": "1.0.0", 4 | "private": true, 5 | "main": "./lib/one.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "sanity", 11 | "sanity-plugin" 12 | ], 13 | "author": "Some person", 14 | "license": "MIT" 15 | } 16 | -------------------------------------------------------------------------------- /test/fixtures/verify/missing-license/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-missing-license", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Just a fixture", 6 | "main": "./lib/one.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [ 11 | "sanity", 12 | "sanity-plugin" 13 | ], 14 | "author": "Some person", 15 | "license": "MIT" 16 | } 17 | -------------------------------------------------------------------------------- /test/fixtures/verify/ui-peer-dep/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-ui", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Just a fixture", 6 | "main": "./src/schemaType.js", 7 | "keywords": [ 8 | "sanity", 9 | "sanity-plugin" 10 | ], 11 | "author": "Some person", 12 | "license": "MIT", 13 | "peerDependencies": { 14 | "@sanity/ui": "^0.33.11", 15 | "react": "^17.0.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/dotted-filename-part-sanity-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-unprefixed-part-sanity-json", 3 | "version": "1.0.0", 4 | "private": true, 5 | "main": "./lib/my.schema.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "sanity", 11 | "sanity-plugin" 12 | ], 13 | "author": "Some person", 14 | "license": "MIT" 15 | } 16 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/invalid-part-keys-sanity-json/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "source": "./src", 4 | "compiled": "./lib" 5 | }, 6 | 7 | "parts": [ 8 | { 9 | "name": "part:invalid-part-keys-sanity-json/foo/bar", 10 | "path": "one.js" 11 | }, 12 | { 13 | "name": "part:invalid-part-keys-sanity-json/foo/other", 14 | "path": "two.js", 15 | "unknown": "key" 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /test/fixtures/verify/icons-peer-dep/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-ui", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Just a fixture", 6 | "main": "./src/schemaType.js", 7 | "keywords": [ 8 | "sanity", 9 | "sanity-plugin" 10 | ], 11 | "author": "Some person", 12 | "license": "MIT", 13 | "peerDependencies": { 14 | "@sanity/icons": "^1.0.6", 15 | "react": "^17.0.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/fixtures/verify/non-spdx-license/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-non-spdx-license", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Just a fixture", 6 | "main": "./lib/one.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [ 11 | "sanity", 12 | "sanity-plugin" 13 | ], 14 | "author": "Some person", 15 | "license": "lol" 16 | } 17 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/unprefixed-implementation-sanity-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-unprefixed-implementation-sanity-json", 3 | "version": "1.0.0", 4 | "private": true, 5 | "main": "./lib/one.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "sanity", 11 | "sanity-plugin" 12 | ], 13 | "author": "Some person", 14 | "license": "MIT" 15 | } 16 | -------------------------------------------------------------------------------- /test/fixtures/verify/invalid-dist-config/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-invalid-dist-config", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Just a fixture", 6 | "main": "./lib/one.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [ 11 | "sanity", 12 | "sanity-plugin" 13 | ], 14 | "author": "Some person", 15 | "license": "MIT" 16 | } 17 | -------------------------------------------------------------------------------- /test/fixtures/build/folder-sanity-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-folder-sanity-json", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Just an invalid thing", 6 | "main": "./src/one.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [ 11 | "sanity", 12 | "sanity-plugin" 13 | ], 14 | "author": "Some person", 15 | "license": "MIT" 16 | } 17 | -------------------------------------------------------------------------------- /test/fixtures/verify/invalid-dist-config-syntax/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-invalid-dist-config", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Just a fixture", 6 | "main": "./lib/one.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [ 11 | "sanity", 12 | "sanity-plugin" 13 | ], 14 | "author": "Some person", 15 | "license": "MIT" 16 | } 17 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/dotted-filename-part-sanity-json/lib/my.schema.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../src/my.schema.js"],"names":["name","type","field"],"mappings":";;;;;;eAAe;AACbA,EAAAA,IAAI,EAAE,SADO;AAEbC,EAAAA,IAAI,EAAE,UAFO;AAGbC,EAAAA,KAAK,EAAE,CAAC;AAACF,IAAAA,IAAI,EAAE,OAAP;AAAgBC,IAAAA,IAAI,EAAE;AAAtB,GAAD;AAHM,C","sourcesContent":["export default {\n name: 'myThing',\n type: 'document',\n field: [{name: 'title', type: 'string'}],\n}\n"],"file":"my.schema.js"} -------------------------------------------------------------------------------- /test/fixtures/verify/ui-low-version/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-ui", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Just a fixture", 6 | "main": "./src/schemaType.js", 7 | "keywords": [ 8 | "sanity", 9 | "sanity-plugin" 10 | ], 11 | "author": "Some person", 12 | "license": "MIT", 13 | "peerDependencies": { 14 | "react": "^17.0.0" 15 | }, 16 | "dependencies": { 17 | "@sanity/ui": "^0.33.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/double-lockfile/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-valid", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Just a valid Sanity plugin fixture. Do not publish.", 6 | "main": "./lib/one.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [ 11 | "sanity", 12 | "sanity-plugin" 13 | ], 14 | "author": "Espen Hovlandsdal", 15 | "license": "MIT" 16 | } 17 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-import/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-css-part", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Just a fixture", 6 | "main": "./lib/one.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [ 11 | "sanity", 12 | "sanity-plugin" 13 | ], 14 | "peerDependencies": { 15 | "react": "*" 16 | }, 17 | "author": "Some person", 18 | "license": "MIT" 19 | } 20 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-part/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-css-part", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Just a fixture", 6 | "main": "./lib/one.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [ 11 | "sanity", 12 | "sanity-plugin" 13 | ], 14 | "peerDependencies": { 15 | "react": "*" 16 | }, 17 | "author": "Some person", 18 | "license": "MIT" 19 | } 20 | -------------------------------------------------------------------------------- /src/configs/babelrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@babel/preset-typescript', 4 | '@babel/preset-react', 5 | [ 6 | '@babel/preset-env', 7 | { 8 | targets: { 9 | node: '10', 10 | chrome: '59', 11 | safari: '10', 12 | firefox: '56', 13 | edge: '14', 14 | }, 15 | modules: 'commonjs', 16 | }, 17 | ], 18 | ], 19 | plugins: ['@babel/plugin-proposal-class-properties'], 20 | } 21 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-bad-composes/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-css-part", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Just a fixture", 6 | "main": "./lib/one.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [ 11 | "sanity", 12 | "sanity-plugin" 13 | ], 14 | "peerDependencies": { 15 | "react": "*" 16 | }, 17 | "author": "Some person", 18 | "license": "MIT" 19 | } 20 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-bad-import/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-css-part", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Just a fixture", 6 | "main": "./lib/one.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [ 11 | "sanity", 12 | "sanity-plugin" 13 | ], 14 | "peerDependencies": { 15 | "react": "*" 16 | }, 17 | "author": "Some person", 18 | "license": "MIT" 19 | } 20 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-part-missing/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-css-part", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Just a fixture", 6 | "main": "./lib/one.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [ 11 | "sanity", 12 | "sanity-plugin" 13 | ], 14 | "peerDependencies": { 15 | "react": "*" 16 | }, 17 | "author": "Some person", 18 | "license": "MIT" 19 | } 20 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-raw-import/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-css-part", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Just a fixture", 6 | "main": "./lib/one.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [ 11 | "sanity", 12 | "sanity-plugin" 13 | ], 14 | "peerDependencies": { 15 | "react": "*" 16 | }, 17 | "author": "Some person", 18 | "license": "MIT" 19 | } 20 | -------------------------------------------------------------------------------- /test/fixtures/verify/valid-kitchen-sink/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-css-part", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Just a fixture", 6 | "main": "./lib/one.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [ 11 | "sanity", 12 | "sanity-plugin" 13 | ], 14 | "peerDependencies": { 15 | "react": "*" 16 | }, 17 | "author": "Some person", 18 | "license": "MIT" 19 | } 20 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-raw-import-missing/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-css-part", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Just a fixture", 6 | "main": "./lib/one.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [ 11 | "sanity", 12 | "sanity-plugin" 13 | ], 14 | "peerDependencies": { 15 | "react": "*" 16 | }, 17 | "author": "Some person", 18 | "license": "MIT" 19 | } 20 | -------------------------------------------------------------------------------- /test/fixtures/build/valid/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-valid", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Just a valid Sanity plugin fixture. Do not publish.", 6 | "main": "./lib/one.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [ 11 | "sanity", 12 | "sanity-plugin" 13 | ], 14 | "peerDependencies": { 15 | "react": "^16.2.0" 16 | }, 17 | "author": "Some person", 18 | "license": "MIT" 19 | } 20 | -------------------------------------------------------------------------------- /test/fixtures/verify/npm-ref-ignored-file/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-missing-license-key", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Just a fixture", 6 | "main": "./lib/one.js", 7 | "types": "./types.d.ts", 8 | "files": [ 9 | "lib" 10 | ], 11 | "scripts": { 12 | "test": "echo \"Error: no test specified\" && exit 1" 13 | }, 14 | "keywords": [ 15 | "sanity", 16 | "sanity-plugin" 17 | ], 18 | "author": "Some person", 19 | "license": "MIT" 20 | } 21 | -------------------------------------------------------------------------------- /test/fixtures/verify/part-ref-ignored-file/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-part-ref-ignored-file", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Just a fixture", 6 | "main": "./lib/ignored.js", 7 | "files": [ 8 | "lib", 9 | "!lib/ignored.js" 10 | ], 11 | "scripts": { 12 | "test": "echo \"Error: no test specified\" && exit 1" 13 | }, 14 | "keywords": [ 15 | "sanity", 16 | "sanity-plugin" 17 | ], 18 | "author": "Some person", 19 | "license": "MIT" 20 | } 21 | -------------------------------------------------------------------------------- /test/fixtures/verify/useless-files/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-valid", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Just a valid Sanity plugin fixture. Do not publish.", 6 | "main": "./lib/one.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [ 11 | "sanity", 12 | "sanity-plugin" 13 | ], 14 | "peerDependencies": { 15 | "react": "*" 16 | }, 17 | "author": "Some person", 18 | "license": "MIT" 19 | } 20 | -------------------------------------------------------------------------------- /test/fixtures/verify/valid-built/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-valid", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Just a valid Sanity plugin fixture. Do not publish.", 6 | "main": "./lib/one.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [ 11 | "sanity", 12 | "sanity-plugin" 13 | ], 14 | "peerDependencies": { 15 | "react": "^16.2.0" 16 | }, 17 | "author": "Some person", 18 | "license": "MIT" 19 | } 20 | -------------------------------------------------------------------------------- /test/fixtures/build/ts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sanity-plugin-ts", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Just a valid typescript Sanity plugin fixture. Do not publish.", 6 | "main": "./lib/one.js", 7 | "types": "types.d.ts", 8 | "scripts": { 9 | "test": "echo \"Error: no test specified\" && exit 1" 10 | }, 11 | "keywords": [ 12 | "sanity", 13 | "sanity-plugin" 14 | ], 15 | "files": [ 16 | "lib", 17 | ".eslintignore" 18 | ], 19 | "author": "Some person", 20 | "license": "MIT" 21 | } 22 | -------------------------------------------------------------------------------- /test/fixtures/build/ts/src/one.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import two from './two' 3 | import styles from './styles/one.css' 4 | 5 | export default class One extends React.PureComponent { 6 | state = {i: 0} 7 | 8 | handleClick = () => { 9 | this.setState((prev) => ({i: prev.i + 1})) 10 | } 11 | 12 | componentDidMount() { 13 | two() 14 | } 15 | 16 | render() { 17 | const {i} = this.state 18 | return ( 19 | 22 | ) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | - push 4 | - pull_request 5 | jobs: 6 | test: 7 | runs-on: ${{ matrix.platform }} 8 | name: Node.js ${{ matrix.node-version }} / ${{ matrix.platform }} 9 | strategy: 10 | fail-fast: false 11 | matrix: 12 | platform: [ubuntu-latest, macos-latest, windows-latest] 13 | node-version: 14 | - 16 15 | - 14 16 | - 12 17 | steps: 18 | - uses: actions/checkout@v2 19 | - uses: actions/setup-node@v1 20 | with: 21 | node-version: ${{ matrix.node-version }} 22 | - run: npm install 23 | - run: npm test 24 | -------------------------------------------------------------------------------- /test/fixtures/build/valid/src/one.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import two from './two' 3 | import styles from './styles/one.css' 4 | 5 | export default class One extends React.PureComponent { 6 | // plugin-proposal-class-properties 7 | state = {i: 0} 8 | 9 | // plugin-proposal-class-properties 10 | handleClick = () => { 11 | this.setState((prev) => ({i: prev.i + 1})) 12 | } 13 | 14 | componentDidMount() { 15 | two() 16 | } 17 | 18 | render() { 19 | const {i} = this.state 20 | return ( 21 | 24 | ) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/fixtures/verify/useless-files/src/one.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import two from './two' 3 | import styles from './styles/one.css' 4 | 5 | export default class One extends React.PureComponent { 6 | // plugin-proposal-class-properties 7 | state = {i: 0} 8 | 9 | // plugin-proposal-class-properties 10 | handleClick = () => { 11 | this.setState((prev) => ({i: prev.i + 1})) 12 | } 13 | 14 | componentDidMount() { 15 | two() 16 | } 17 | 18 | render() { 19 | const {i} = this.state 20 | return ( 21 | 24 | ) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/fixtures/verify/valid-built/src/one.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import two from './two' 3 | import styles from './styles/one.css' 4 | 5 | export default class One extends React.PureComponent { 6 | // plugin-proposal-class-properties 7 | state = {i: 0} 8 | 9 | // plugin-proposal-class-properties 10 | handleClick = () => { 11 | this.setState((prev) => ({i: prev.i + 1})) 12 | } 13 | 14 | componentDidMount() { 15 | two() 16 | } 17 | 18 | render() { 19 | const {i} = this.state 20 | return ( 21 | 24 | ) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/fixtures/build-npm/double-lockfile/src/one.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import two from './two' 3 | import styles from './styles/one.css' 4 | 5 | export default class One extends React.PureComponent { 6 | // plugin-proposal-class-properties 7 | state = {i: 0} 8 | 9 | // plugin-proposal-class-properties 10 | handleClick = () => { 11 | this.setState((prev) => ({i: prev.i + 1})) 12 | } 13 | 14 | componentDidMount() { 15 | two() 16 | } 17 | 18 | render() { 19 | const {i} = this.state 20 | return ( 21 | 24 | ) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/disallowed-sanity-json/src/one.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import two from './two' 3 | import styles from './styles/one.css' 4 | 5 | export default class One extends React.PureComponent { 6 | // plugin-proposal-class-properties 7 | state = {i: 0} 8 | 9 | // plugin-proposal-class-properties 10 | handleClick = () => { 11 | this.setState((prev) => ({i: prev.i + 1})) 12 | } 13 | 14 | componentDidMount() { 15 | two() 16 | } 17 | 18 | render() { 19 | const {i} = this.state 20 | return ( 21 | 24 | ) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/invalid-sanity-json/src/one.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import two from './two' 3 | import styles from './styles/one.css' 4 | 5 | export default class One extends React.PureComponent { 6 | // plugin-proposal-class-properties 7 | state = {i: 0} 8 | 9 | // plugin-proposal-class-properties 10 | handleClick = () => { 11 | this.setState((prev) => ({i: prev.i + 1})) 12 | } 13 | 14 | componentDidMount() { 15 | two() 16 | } 17 | 18 | render() { 19 | const {i} = this.state 20 | return ( 21 | 24 | ) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonbool-sanity-json/src/one.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import two from './two' 3 | import styles from './styles/one.css' 4 | 5 | export default class One extends React.PureComponent { 6 | // plugin-proposal-class-properties 7 | state = {i: 0} 8 | 9 | // plugin-proposal-class-properties 10 | handleClick = () => { 11 | this.setState((prev) => ({i: prev.i + 1})) 12 | } 13 | 14 | componentDidMount() { 15 | two() 16 | } 17 | 18 | render() { 19 | const {i} = this.state 20 | return ( 21 | 24 | ) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonobject-sanity-json/src/one.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import two from './two' 3 | import styles from './styles/one.css' 4 | 5 | export default class One extends React.PureComponent { 6 | // plugin-proposal-class-properties 7 | state = {i: 0} 8 | 9 | // plugin-proposal-class-properties 10 | handleClick = () => { 11 | this.setState((prev) => ({i: prev.i + 1})) 12 | } 13 | 14 | componentDidMount() { 15 | two() 16 | } 17 | 18 | render() { 19 | const {i} = this.state 20 | return ( 21 | 24 | ) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/disallowed-root-sanity-json/src/one.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import two from './two' 3 | import styles from './styles/one.css' 4 | 5 | export default class One extends React.PureComponent { 6 | // plugin-proposal-class-properties 7 | state = {i: 0} 8 | 9 | // plugin-proposal-class-properties 10 | handleClick = () => { 11 | this.setState((prev) => ({i: prev.i + 1})) 12 | } 13 | 14 | componentDidMount() { 15 | two() 16 | } 17 | 18 | render() { 19 | const {i} = this.state 20 | return ( 21 | 24 | ) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/invalid-part-sanity-json/src/one.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import two from './two' 3 | import styles from './styles/one.css' 4 | 5 | export default class One extends React.PureComponent { 6 | // plugin-proposal-class-properties 7 | state = {i: 0} 8 | 9 | // plugin-proposal-class-properties 10 | handleClick = () => { 11 | this.setState((prev) => ({i: prev.i + 1})) 12 | } 13 | 14 | componentDidMount() { 15 | two() 16 | } 17 | 18 | render() { 19 | const {i} = this.state 20 | return ( 21 | 24 | ) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/invalid-sanity-json-shape/src/one.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import two from './two' 3 | import styles from './styles/one.css' 4 | 5 | export default class One extends React.PureComponent { 6 | // plugin-proposal-class-properties 7 | state = {i: 0} 8 | 9 | // plugin-proposal-class-properties 10 | handleClick = () => { 11 | this.setState((prev) => ({i: prev.i + 1})) 12 | } 13 | 14 | componentDidMount() { 15 | two() 16 | } 17 | 18 | render() { 19 | const {i} = this.state 20 | return ( 21 | 24 | ) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonarray-parts-sanity-json/src/one.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import two from './two' 3 | import styles from './styles/one.css' 4 | 5 | export default class One extends React.PureComponent { 6 | // plugin-proposal-class-properties 7 | state = {i: 0} 8 | 9 | // plugin-proposal-class-properties 10 | handleClick = () => { 11 | this.setState((prev) => ({i: prev.i + 1})) 12 | } 13 | 14 | componentDidMount() { 15 | two() 16 | } 17 | 18 | render() { 19 | const {i} = this.state 20 | return ( 21 | 24 | ) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonobject-part-sanity-json/src/one.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import two from './two' 3 | import styles from './styles/one.css' 4 | 5 | export default class One extends React.PureComponent { 6 | // plugin-proposal-class-properties 7 | state = {i: 0} 8 | 9 | // plugin-proposal-class-properties 10 | handleClick = () => { 11 | this.setState((prev) => ({i: prev.i + 1})) 12 | } 13 | 14 | componentDidMount() { 15 | two() 16 | } 17 | 18 | render() { 19 | const {i} = this.state 20 | return ( 21 | 24 | ) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/unprefixed-part-sanity-json/src/one.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import two from './two' 3 | import styles from './styles/one.css' 4 | 5 | export default class One extends React.PureComponent { 6 | // plugin-proposal-class-properties 7 | state = {i: 0} 8 | 9 | // plugin-proposal-class-properties 10 | handleClick = () => { 11 | this.setState((prev) => ({i: prev.i + 1})) 12 | } 13 | 14 | componentDidMount() { 15 | two() 16 | } 17 | 18 | render() { 19 | const {i} = this.state 20 | return ( 21 | 24 | ) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/invalid-part-keys-sanity-json/src/one.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import two from './two' 3 | import styles from './styles/one.css' 4 | 5 | export default class One extends React.PureComponent { 6 | // plugin-proposal-class-properties 7 | state = {i: 0} 8 | 9 | // plugin-proposal-class-properties 10 | handleClick = () => { 11 | this.setState((prev) => ({i: prev.i + 1})) 12 | } 13 | 14 | componentDidMount() { 15 | two() 16 | } 17 | 18 | render() { 19 | const {i} = this.state 20 | return ( 21 | 24 | ) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonstring-compiled-sanity-json/src/one.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import two from './two' 3 | import styles from './styles/one.css' 4 | 5 | export default class One extends React.PureComponent { 6 | // plugin-proposal-class-properties 7 | state = {i: 0} 8 | 9 | // plugin-proposal-class-properties 10 | handleClick = () => { 11 | this.setState((prev) => ({i: prev.i + 1})) 12 | } 13 | 14 | componentDidMount() { 15 | two() 16 | } 17 | 18 | render() { 19 | const {i} = this.state 20 | return ( 21 | 24 | ) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/nonstring-source-sanity-json/src/one.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import two from './two' 3 | import styles from './styles/one.css' 4 | 5 | export default class One extends React.PureComponent { 6 | // plugin-proposal-class-properties 7 | state = {i: 0} 8 | 9 | // plugin-proposal-class-properties 10 | handleClick = () => { 11 | this.setState((prev) => ({i: prev.i + 1})) 12 | } 13 | 14 | componentDidMount() { 15 | two() 16 | } 17 | 18 | render() { 19 | const {i} = this.state 20 | return ( 21 | 24 | ) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/fixtures/build-sanity/unprefixed-implementation-sanity-json/src/one.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import two from './two' 3 | import styles from './styles/one.css' 4 | 5 | export default class One extends React.PureComponent { 6 | // plugin-proposal-class-properties 7 | state = {i: 0} 8 | 9 | // plugin-proposal-class-properties 10 | handleClick = () => { 11 | this.setState((prev) => ({i: prev.i + 1})) 12 | } 13 | 14 | componentDidMount() { 15 | two() 16 | } 17 | 18 | render() { 19 | const {i} = this.state 20 | return ( 21 | 24 | ) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-bad-import/lib/one.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | Object.defineProperty(exports, '__esModule', { 4 | value: true, 5 | }) 6 | exports.default = void 0 7 | 8 | var _react = _interopRequireDefault(require('react')) 9 | 10 | var _one = _interopRequireDefault(require('./styles/one.css')) 11 | 12 | function _interopRequireDefault(obj) { 13 | return obj && obj.__esModule ? obj : {default: obj} 14 | } 15 | 16 | class One extends _react.default.PureComponent { 17 | render() { 18 | return /*#__PURE__*/ _react.default.createElement( 19 | 'button', 20 | { 21 | className: _one.default.button, 22 | }, 23 | 'Click me' 24 | ) 25 | } 26 | } 27 | 28 | exports.default = One 29 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-bad-import/src/one.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | Object.defineProperty(exports, '__esModule', { 4 | value: true, 5 | }) 6 | exports.default = void 0 7 | 8 | var _react = _interopRequireDefault(require('react')) 9 | 10 | var _one = _interopRequireDefault(require('./styles/one.css')) 11 | 12 | function _interopRequireDefault(obj) { 13 | return obj && obj.__esModule ? obj : {default: obj} 14 | } 15 | 16 | class One extends _react.default.PureComponent { 17 | render() { 18 | return /*#__PURE__*/ _react.default.createElement( 19 | 'button', 20 | { 21 | className: _one.default.button, 22 | }, 23 | 'Click me' 24 | ) 25 | } 26 | } 27 | 28 | exports.default = One 29 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-import/lib/one.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.default = void 0; 7 | 8 | var _react = _interopRequireDefault(require("react")); 9 | 10 | var _two = _interopRequireDefault(require("./two")); 11 | 12 | var _one = _interopRequireDefault(require("./styles/one.css")); 13 | 14 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 15 | 16 | class One extends _react.default.PureComponent { 17 | componentDidMount() { 18 | (0, _two.default)(); 19 | } 20 | 21 | render() { 22 | return /*#__PURE__*/_react.default.createElement("button", { 23 | className: _one.default.button 24 | }, 'Click me'); 25 | } 26 | 27 | } 28 | 29 | exports.default = One; 30 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-part/lib/one.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.default = void 0; 7 | 8 | var _react = _interopRequireDefault(require("react")); 9 | 10 | var _two = _interopRequireDefault(require("./two")); 11 | 12 | var _one = _interopRequireDefault(require("./styles/one.css")); 13 | 14 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 15 | 16 | class One extends _react.default.PureComponent { 17 | componentDidMount() { 18 | (0, _two.default)(); 19 | } 20 | 21 | render() { 22 | return /*#__PURE__*/_react.default.createElement("button", { 23 | className: _one.default.button 24 | }, 'Click me'); 25 | } 26 | 27 | } 28 | 29 | exports.default = One; 30 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-bad-composes/lib/one.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.default = void 0; 7 | 8 | var _react = _interopRequireDefault(require("react")); 9 | 10 | var _two = _interopRequireDefault(require("./two")); 11 | 12 | var _one = _interopRequireDefault(require("./styles/one.css")); 13 | 14 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 15 | 16 | class One extends _react.default.PureComponent { 17 | componentDidMount() { 18 | (0, _two.default)(); 19 | } 20 | 21 | render() { 22 | return /*#__PURE__*/_react.default.createElement("button", { 23 | className: _one.default.button 24 | }, 'Click me'); 25 | } 26 | 27 | } 28 | 29 | exports.default = One; 30 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-part-missing/lib/one.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.default = void 0; 7 | 8 | var _react = _interopRequireDefault(require("react")); 9 | 10 | var _two = _interopRequireDefault(require("./two")); 11 | 12 | var _one = _interopRequireDefault(require("./styles/one.css")); 13 | 14 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 15 | 16 | class One extends _react.default.PureComponent { 17 | componentDidMount() { 18 | (0, _two.default)(); 19 | } 20 | 21 | render() { 22 | return /*#__PURE__*/_react.default.createElement("button", { 23 | className: _one.default.button 24 | }, 'Click me'); 25 | } 26 | 27 | } 28 | 29 | exports.default = One; 30 | -------------------------------------------------------------------------------- /test/fixtures/verify/valid-kitchen-sink/lib/one.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.default = void 0; 7 | 8 | var _react = _interopRequireDefault(require("react")); 9 | 10 | var _two = _interopRequireDefault(require("./two")); 11 | 12 | var _one = _interopRequireDefault(require("./styles/one.css")); 13 | 14 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 15 | 16 | class One extends _react.default.PureComponent { 17 | componentDidMount() { 18 | (0, _two.default)(); 19 | } 20 | 21 | render() { 22 | return /*#__PURE__*/_react.default.createElement("button", { 23 | className: _one.default.button 24 | }, 'Click me'); 25 | } 26 | 27 | } 28 | 29 | exports.default = One; 30 | -------------------------------------------------------------------------------- /src/configs/uselessFiles.js: -------------------------------------------------------------------------------- 1 | // USELESS IN THE CONTEXT OF A _PUBLISHED_ PACKAGE, OK!!?!?! 2 | // THEY'RE NOT USELESS. PLEASE DONT TAKE OFFENSE, 3 | // I LOVE ALL YOUR ESLINT CONFIGS, CODE COVERAGE AND WHATNOT <3 4 | exports.uselessFiles = [ 5 | '.babel.config.js', 6 | '.babelrc', 7 | '.drone.yml', 8 | '.editorconfig', 9 | '.eslintignore', 10 | '.eslintrc-ts.js', 11 | '.eslintrc-ts', 12 | '.eslintrc', 13 | '.gitignore', 14 | '.github', 15 | '.nyc_output', 16 | '.prettierrc', 17 | '.stylelintignore', 18 | '.stylelintrc.json', 19 | '.stylelintrc', 20 | '.travis.yaml', 21 | '.travis.yml', 22 | 'babel.config.js', 23 | 'coverage', 24 | 'gulpfile.js', 25 | 'lcov-report', 26 | 'lerna.json', 27 | 'now.json', 28 | 'vercel.json', 29 | 'netlify.toml', 30 | 'postcss.config.js', 31 | 'tsconfig.json', 32 | ] 33 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-raw-import/lib/one.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | Object.defineProperty(exports, '__esModule', { 4 | value: true, 5 | }) 6 | exports.default = void 0 7 | 8 | var _react = _interopRequireDefault(require('react')) 9 | 10 | var _two = _interopRequireDefault(require('./two')) 11 | 12 | var _one = _interopRequireDefault(require('./styles/One.css?raw')) 13 | 14 | function _interopRequireDefault(obj) { 15 | return obj && obj.__esModule ? obj : {default: obj} 16 | } 17 | 18 | class One extends _react.default.PureComponent { 19 | componentDidMount() { 20 | ;(0, _two.default)() 21 | } 22 | 23 | render() { 24 | return /*#__PURE__*/ _react.default.createElement( 25 | 'button', 26 | { 27 | className: _one.default.button, 28 | }, 29 | 'Click me' 30 | ) 31 | } 32 | } 33 | 34 | exports.default = One 35 | -------------------------------------------------------------------------------- /test/fixtures/verify/css-raw-import-missing/lib/one.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | Object.defineProperty(exports, '__esModule', { 4 | value: true, 5 | }) 6 | exports.default = void 0 7 | 8 | var _react = _interopRequireDefault(require('react')) 9 | 10 | var _two = _interopRequireDefault(require('./two')) 11 | 12 | var _one = _interopRequireDefault(require('./styles/one.css?raw')) 13 | 14 | function _interopRequireDefault(obj) { 15 | return obj && obj.__esModule ? obj : {default: obj} 16 | } 17 | 18 | class One extends _react.default.PureComponent { 19 | componentDidMount() { 20 | ;(0, _two.default)() 21 | } 22 | 23 | render() { 24 | return /*#__PURE__*/ _react.default.createElement( 25 | 'button', 26 | { 27 | className: _one.default.button, 28 | }, 29 | 'Click me' 30 | ) 31 | } 32 | } 33 | 34 | exports.default = One 35 | -------------------------------------------------------------------------------- /src/npm/resolveLatestVersions.js: -------------------------------------------------------------------------------- 1 | const pProps = require('p-props') 2 | const getLatestVersion = require('get-latest-version') 3 | 4 | // We may want to lock certain dependencies to specific versions 5 | const lockedDependencies = { 6 | eslint: '^7.0.0', // Because eslint-plugin-react does not work with v8 yet 7 | } 8 | 9 | module.exports = {resolveLatestVersions} 10 | 11 | function resolveLatestVersions(packages) { 12 | const versions = {} 13 | for (const pkgName of packages) { 14 | versions[pkgName] = pkgName in lockedDependencies ? lockedDependencies[pkgName] : 'latest' 15 | } 16 | 17 | return pProps( 18 | versions, 19 | async (range, pkgName) => { 20 | const version = await getLatestVersion(pkgName, {range}) 21 | return rangeify(version) 22 | }, 23 | {concurrency: 8} 24 | ) 25 | } 26 | 27 | function rangeify(version) { 28 | return `^${version}` 29 | } 30 | -------------------------------------------------------------------------------- /src/assets/splat/gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # nyc test coverage 18 | .nyc_output 19 | 20 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 21 | .grunt 22 | 23 | # node-waf configuration 24 | .lock-wscript 25 | 26 | # Compiled binary addons (http://nodejs.org/api/addons.html) 27 | build/Release 28 | 29 | # Dependency directories 30 | node_modules 31 | jspm_packages 32 | 33 | # Optional npm cache directory 34 | .npm 35 | 36 | # Optional REPL history 37 | .node_repl_history 38 | 39 | # macOS finder cache file 40 | .DS_Store 41 | 42 | # VS Code settings 43 | .vscode 44 | 45 | # Lockfiles 46 | yarn.lock 47 | package-lock.json 48 | 49 | # Cache 50 | .cache 51 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # nyc test coverage 18 | .nyc_output 19 | 20 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 21 | .grunt 22 | 23 | # node-waf configuration 24 | .lock-wscript 25 | 26 | # Compiled binary addons (http://nodejs.org/api/addons.html) 27 | build/Release 28 | 29 | # Dependency directories 30 | node_modules 31 | jspm_packages 32 | 33 | # Optional npm cache directory 34 | .npm 35 | 36 | # Optional REPL history 37 | .node_repl_history 38 | 39 | # macOS finder cache file 40 | .DS_Store 41 | 42 | # VS Code settings 43 | .vscode 44 | 45 | # Lockfiles 46 | /yarn.lock 47 | /package-lock.json 48 | 49 | # Cache 50 | .cache 51 | 52 | # Fixtures for tests, but only for the `build` command - 53 | # we expect `verify` to have precompiled results to verify 54 | test/fixtures/build/lib 55 | -------------------------------------------------------------------------------- /src/cmds/verify.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | const meow = require('meow') 3 | const pkg = require('../../package.json') 4 | const verify = require('../actions/verify') 5 | const sharedFlags = require('../sharedFlags') 6 | 7 | const description = `Verify that a Sanity plugin is ready for publishing` 8 | 9 | const help = ` 10 | Usage 11 | $ ${pkg.binname} verify [