Skip to content

Commit

Permalink
feat: add new @sanity/insert-menu package (#1630)
Browse files Browse the repository at this point in the history
* feat: add new @sanity/insert-menu package

In order to expose this menu to both `@sanity/visual-editing` and `sanity`.

This repository might not be the best permanent resident for this package, but
that's OK for now.

* fixup! feat: add new @sanity/insert-menu package

* fixup! feat: add new @sanity/insert-menu package
  • Loading branch information
christianhg authored Jun 7, 2024
1 parent 9134258 commit a3afc03
Show file tree
Hide file tree
Showing 16 changed files with 1,198 additions and 31 deletions.
9 changes: 9 additions & 0 deletions packages/insert-menu/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
1 change: 1 addition & 0 deletions packages/insert-menu/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
53 changes: 53 additions & 0 deletions packages/insert-menu/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
'use strict'

/** @type import('eslint').Linter.Config */
module.exports = {
root: true,
env: {
browser: true,
es6: true,
node: true,
},
extends: ['eslint:recommended'],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
plugins: ['import', 'simple-import-sort'],
rules: {
'no-console': 'error',
'no-shadow': 'error',
'no-warning-comments': [
'warn',
{
location: 'start',
terms: ['todo', 'fixme'],
},
],
'quote-props': ['warn', 'consistent-as-needed'],
'simple-import-sort/exports': 'warn',
'simple-import-sort/imports': 'warn',
'strict': ['warn', 'global'],
},
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./tsconfig.json'],
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
],
plugins: ['import', '@typescript-eslint', 'simple-import-sort'],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'error',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/member-delimiter-style': 'off',
'@typescript-eslint/no-empty-interface': 'off',
},
},
],
}
8 changes: 8 additions & 0 deletions packages/insert-menu/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.local
*.log
*.tgz

.DS_Store
dist
etc
node_modules
1 change: 1 addition & 0 deletions packages/insert-menu/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# `@sanity/insert-menu`
7 changes: 7 additions & 0 deletions packages/insert-menu/package.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {defineConfig} from '@sanity/pkg-utils'

// https://github.com/sanity-io/pkg-utils#configuration
export default defineConfig({
// the path to the tsconfig file for distributed builds
tsconfig: 'tsconfig.dist.json',
})
66 changes: 66 additions & 0 deletions packages/insert-menu/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"name": "@sanity/insert-menu",
"version": "0.0.0",
"description": "",
"keywords": [],
"homepage": "https://github.com/sanity-io/visual-editing/tree/main/packages/insert-menu#readme",
"bugs": {
"url": "https://github.com/sanity-io/visual-editing/issues"
},
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/sanity-io/visual-editing.git",
"directory": "packages/insert-menu"
},
"license": "MIT",
"author": "Sanity.io <[email protected]>",
"sideEffects": false,
"type": "module",
"exports": {
".": {
"source": "./src/index.ts",
"require": "./dist/index.cjs",
"default": "./dist/index.js"
},
"./package.json": "./package.json"
},
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist",
"src"
],
"scripts": {
"build": "pkg build --strict --clean --check",
"lint": "eslint .",
"ts:check": "tsc --noEmit"
},
"browserslist": "extends @sanity/browserslist-config",
"dependencies": {
"@sanity/icons": "^3.0.0",
"@sanity/ui": "^2.3.0"
},
"devDependencies": {
"@sanity/pkg-utils": "^6.9.1",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
"eslint": "^8.57.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-simple-import-sort": "^12.1.0",
"lint-staged": "^15.2.5",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-is": "^18.3.1",
"sanity": "3.45.0",
"typescript": "^5.4.5"
},
"peerDependencies": {
"react": "^18.3 || >=19.0.0-rc",
"react-dom": "^18.3 || >=19.0.0-rc",
"react-is": "^18.3 || >=19.0.0-rc"
},
"engines": {
"node": ">=18.0.0"
}
}
Loading

0 comments on commit a3afc03

Please sign in to comment.