index
int64
0
0
repo_id
stringlengths
16
181
file_path
stringlengths
28
270
content
stringlengths
1
11.6M
__index_level_0__
int64
0
10k
0
petrpan-code/juliencrn/usehooks-ts/packages/usehooks-ts/src
petrpan-code/juliencrn/usehooks-ts/packages/usehooks-ts/src/useWindowSize/useWindowSize.test.ts
import { act, renderHook } from '@testing-library/react-hooks' import { useWindowSize } from './useWindowSize' const setupHook = () => renderHook(() => useWindowSize()) const windowResize = (dimension: 'width' | 'height', value: number): void => { if (dimension === 'width') { window.innerWidth = value } i...
1,100
0
petrpan-code/juliencrn/usehooks-ts/packages/usehooks-ts/src
petrpan-code/juliencrn/usehooks-ts/packages/usehooks-ts/src/useWindowSize/useWindowSize.ts
import { useState } from 'react' import { useEventListener, useIsomorphicLayoutEffect } from '..' interface WindowSize { width: number height: number } export function useWindowSize(): WindowSize { const [windowSize, setWindowSize] = useState<WindowSize>({ width: 0, height: 0, }) const handleSize ...
1,101
0
petrpan-code/juliencrn/usehooks-ts/packages/usehooks-ts/turbo
petrpan-code/juliencrn/usehooks-ts/packages/usehooks-ts/turbo/generators/config.ts
import { PlopTypes } from '@turbo/gen' import format from 'date-fns/format' export default function generator(plop: PlopTypes.NodePlopAPI): void { plop.setGenerator('hook', { description: 'Create a post', prompts: [ { type: 'input', name: 'name', message: 'post name please (eg: ...
1,102
0
petrpan-code/juliencrn/usehooks-ts/packages/usehooks-ts/turbo/generators
petrpan-code/juliencrn/usehooks-ts/packages/usehooks-ts/turbo/generators/templates/index.ts.hbs
export * from './{{camelCase name}}/{{camelCase name}}'
1,103
0
petrpan-code/juliencrn/usehooks-ts/packages/usehooks-ts/turbo/generators/templates
petrpan-code/juliencrn/usehooks-ts/packages/usehooks-ts/turbo/generators/templates/hook/hook.demo.tsx.hbs
import { {{camelCase name}} } from '..' export default function Component() { const [two] = {{camelCase name}}() return <div>Hello {two}</div> }
1,104
0
petrpan-code/juliencrn/usehooks-ts/packages/usehooks-ts/turbo/generators/templates
petrpan-code/juliencrn/usehooks-ts/packages/usehooks-ts/turbo/generators/templates/hook/hook.mdx.hbs
This hook description markdown text.
1,105
0
petrpan-code/juliencrn/usehooks-ts/packages/usehooks-ts/turbo/generators/templates
petrpan-code/juliencrn/usehooks-ts/packages/usehooks-ts/turbo/generators/templates/hook/hook.test.ts.hbs
import { act, renderHook } from '@testing-library/react-hooks/dom' import { {{camelCase name}} } from './{{camelCase name}}' describe('{{name}}()', () => { test('should {{name}} be ok', () => { const { result } = renderHook(() => {{camelCase name}}()) const [value, method] = result.current expect(value).toBe(2) expec...
1,106
0
petrpan-code/juliencrn/usehooks-ts/packages/usehooks-ts/turbo/generators/templates
petrpan-code/juliencrn/usehooks-ts/packages/usehooks-ts/turbo/generators/templates/hook/hook.ts.hbs
export function {{camelCase name}}(): [number, () => number] { const value = 2 const method = () => 2 return [value, method] }
1,107
0
petrpan-code/juliencrn/usehooks-ts
petrpan-code/juliencrn/usehooks-ts/scripts/copyHooks.mjs
#!/usr/bin/env zx import { path, fs } from 'zx' import { isHookFile } from './utils.mjs' const hooksDir = path.resolve('./packages/usehooks-ts/src') const outputDir = path.resolve('./apps/www/generated') //////////////////////////////////////////////////////////////////////// // 1. Imperative script that copy hooks...
1,108
0
petrpan-code/juliencrn/usehooks-ts
petrpan-code/juliencrn/usehooks-ts/scripts/coverage.mjs
#!/usr/bin/env zx import { path, fs } from 'zx' import { isHookFile } from './utils.mjs' const hookDir = path.resolve('./packages/usehooks-ts/src') const hooks = fs.readdirSync(hookDir).filter(isHookFile) const testFileRegex = new RegExp(`\.test\.ts$`) let hasTestCount = 0 console.log(`Hook with unit tests: \n`) f...
1,109
0
petrpan-code/juliencrn/usehooks-ts
petrpan-code/juliencrn/usehooks-ts/scripts/updateReadme.mjs
#!/usr/bin/env zx import { path, fs } from 'zx' import { camelToKebabCase, isDemoFile, isHookFile } from './utils.mjs' //////////////////////////////////////////////////////////////////////// // 1. Imperative script that updates the hook list in the README file. //////////////////////////////////////////////////////...
1,110
0
petrpan-code/juliencrn/usehooks-ts
petrpan-code/juliencrn/usehooks-ts/scripts/utils.mjs
export function isHookFile(filename) { const hookRegex = new RegExp('^use[A-Z][a-zA-Z]*$') return hookRegex.test(filename) } export function isDemoFile(filename) { const hookDemoRegex = new RegExp('^use[A-Z][a-zA-Z]*.demo.tsx$') return hookDemoRegex.test(filename) } export function camelToKebabCase(str) { r...
1,111
0
petrpan-code/Blazity
petrpan-code/Blazity/next-enterprise/.all-contributorsrc
{ "projectName": "next-enterprise", "projectOwner": "Blazity", "repoType": "github", "repoHost": "https://github.com", "files": [ "README.md" ], "imageSize": 100, "commit": true, "commitConvention": "angular", "contributors": [ { "login": "bmstefanski", "name": "Bart Stefanski", ...
1,112
0
petrpan-code/Blazity
petrpan-code/Blazity/next-enterprise/.eslintignore
.next node_modules
1,113
0
petrpan-code/Blazity
petrpan-code/Blazity/next-enterprise/.eslintrc.js
// eslint-disable-next-line @typescript-eslint/no-var-requires const fs = require("fs") module.exports = { extends: [ "next", "prettier", "react-app", "react-app/jest", "plugin:storybook/recommended", "plugin:tailwindcss/recommended", ], parserOptions: { babelOptions: { presets:...
1,114
0
petrpan-code/Blazity
petrpan-code/Blazity/next-enterprise/.pre-commit-config.yaml
repos: - repo: https://github.com/qoomon/git-conventional-commits rev: v2.6.3 hooks: - id: conventional-commits
1,115
0
petrpan-code/Blazity
petrpan-code/Blazity/next-enterprise/.prettierignore
.next node_modules
1,116
0
petrpan-code/Blazity
petrpan-code/Blazity/next-enterprise/.releaserc
{ branches: ["main"], "plugins": [ ["@semantic-release/npm", { "npmPublish": false }], "@semantic-release/release-notes-generator", "@semantic-release/github", "@semantic-release/commit-analyzer", "@semantic-release/git", "@semantic-release/changelog", ], }
1,117
0
petrpan-code/Blazity
petrpan-code/Blazity/next-enterprise/LICENSE
MIT License Copyright (c) 2023 Blazity Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribut...
1,118
0
petrpan-code/Blazity
petrpan-code/Blazity/next-enterprise/README.md
# Next.js Enterprise Boilerplate ![Project intro image](./project-logo.png) Welcome to the _Next.js Enterprise Boilerplate_, an open-source template for enterprise projects! It's loaded with features that'll help you build a high-performance, maintainable, and enjoyable app. We've done all the heavy lifting for you, ...
1,119
0
petrpan-code/Blazity
petrpan-code/Blazity/next-enterprise/env.mjs
import { createEnv } from "@t3-oss/env-nextjs" import { z } from "zod" export const env = createEnv({ server: { ANALYZE: z .enum(["true", "false"]) .optional() .transform((value) => value === "true"), }, client: {}, runtimeEnv: { ANALYZE: process.env.ANALYZE, }, })
1,120
0
petrpan-code/Blazity
petrpan-code/Blazity/next-enterprise/git-conventional-commits.yaml
--- convention: commitTypes: - feat - fix - perf - refactor - style - test - build - ops - docs - chore - merge - revert commitScopes: [] releaseTagGlobPattern: v[0-9]*.[0-9]*.[0-9]* changelog: commitTypes: - feat - fix - perf - merge includeInvalidCommits: true commitIgnoreR...
1,121
0
petrpan-code/Blazity
petrpan-code/Blazity/next-enterprise/graph.svg
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <!-- Generated by graphviz version 8.0.2 (20230410.1723) --> <!-- Title: G Pages: 1 --> <svg width="677pt" height="230pt" viewBox="0.00 0.00 677.20 230.20" xmlns="...
1,122
0
petrpan-code/Blazity
petrpan-code/Blazity/next-enterprise/instrumentation.ts
import { registerOTel } from "@vercel/otel" export function register() { registerOTel("next-app") }
1,123
0
petrpan-code/Blazity
petrpan-code/Blazity/next-enterprise/jest.config.js
const nextJest = require("next/jest") const createJestConfig = nextJest({ dir: "./", }) const customJestConfig = { setupFilesAfterEnv: ["<rootDir>/jest.setup.js"], testEnvironment: "jest-environment-jsdom", modulePathIgnorePatterns: ["<rootDir>/dist/"], testPathIgnorePatterns: ["<rootDir>/e2e"], } module.e...
1,124
0
petrpan-code/Blazity
petrpan-code/Blazity/next-enterprise/jest.setup.js
// Learn more: https://github.com/testing-library/jest-dom import "@testing-library/jest-dom"
1,125
0
petrpan-code/Blazity
petrpan-code/Blazity/next-enterprise/lp-items.tsx
export const LP_GRID_ITEMS = [ { title: "Next.js", description: "Fast by default, with config optimized for performance.", icon: ( <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor" className...
1,126
0
petrpan-code/Blazity
petrpan-code/Blazity/next-enterprise/next-env.d.ts
/// <reference types="next" /> /// <reference types="next/image-types/global" /> // NOTE: This file should not be edited // see https://nextjs.org/docs/basic-features/typescript for more information.
1,127
0
petrpan-code/Blazity
petrpan-code/Blazity/next-enterprise/next.config.mjs
import withBundleAnalyzer from "@next/bundle-analyzer" import withPlugins from "next-compose-plugins" import { env } from "./env.mjs" /** * @type {import('next').NextConfig} */ const config = withPlugins([[withBundleAnalyzer({ enabled: env.ANALYZE })]], { reactStrictMode: true, experimental: { instrumentationHoo...
1,128
0
petrpan-code/Blazity
petrpan-code/Blazity/next-enterprise/package.json
{ "name": "next-enterprise", "version": "0.0.0", "private": true, "scripts": { "dev": "cross-env FORCE_COLOR=1 next dev", "build": "next build", "start": "next start", "lint": "next lint", "lint:fix": "next lint --fix", "prettier": "prettier --check \"**/*.{js,jsx,ts,tsx}\"", "pretti...
1,129
0
petrpan-code/Blazity
petrpan-code/Blazity/next-enterprise/playwright.config.ts
import { defineConfig, devices } from "@playwright/test" /** * Read environment variables from file. * https://github.com/motdotla/dotenv */ // require('dotenv').config(); /** * See https://playwright.dev/docs/test-configuration. */ export default defineConfig({ testDir: "./e2e", /* Run tests in files in par...
1,130
0
petrpan-code/Blazity
petrpan-code/Blazity/next-enterprise/postcss.config.js
module.exports = { plugins: { tailwindcss: {}, autoprefixer: {}, }, }
1,131
0
petrpan-code/Blazity
petrpan-code/Blazity/next-enterprise/prettier.config.js
module.exports = { plugins: ["prettier-plugin-tailwindcss"], trailingComma: "es5", tabWidth: 2, printWidth: 120, semi: false, }
1,132
0
petrpan-code/Blazity
petrpan-code/Blazity/next-enterprise/renovate.json
{ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ "config:base" ], "packageRules": [ { "enabled": false, "matchPackagePatterns": ["*"] } ], "vulnerabilityAlerts": { "enabled": true }, "osvVulnerabilityAlerts": true }
1,133
0
petrpan-code/Blazity
petrpan-code/Blazity/next-enterprise/reset.d.ts
// Do not add any other lines of code to this file! import "@total-typescript/ts-reset"
1,134
0
petrpan-code/Blazity
petrpan-code/Blazity/next-enterprise/tailwind.config.js
/* eslint-disable @typescript-eslint/no-var-requires */ const { pick, omit } = require("lodash") const colors = require("tailwindcss/colors") const defaultTheme = require("tailwindcss/defaultTheme") /** @type {import('tailwindcss').Config} */ module.exports = { darkMode: "class", content: [ "./index.html", ...
1,135
0
petrpan-code/Blazity
petrpan-code/Blazity/next-enterprise/tsconfig.json
{ "$schema": "https://json.schemastore.org/tsconfig", "display": "Next.js", "compilerOptions": { "target": "es5", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "strict": true, "forceConsistentCasingInFileNames": true, "noEmit": true, "esModuleInte...
1,136
0
petrpan-code/Blazity
petrpan-code/Blazity/next-enterprise/yarn.lock
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 "@aashutoshrathi/word-wrap@^1.2.3": version "1.2.6" resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A...
1,137
0
petrpan-code/Blazity/next-enterprise
petrpan-code/Blazity/next-enterprise/.storybook/main.ts
import type { StorybookConfig } from "@storybook/nextjs" const config: StorybookConfig = { stories: ["../components/**/*.stories.mdx", "../components/**/*.stories.@(js|jsx|ts|tsx)"], addons: ["@storybook/addon-links", "@storybook/addon-essentials", "@storybook/addon-interactions"], framework: { name: "@storyb...
1,138
0
petrpan-code/Blazity/next-enterprise
petrpan-code/Blazity/next-enterprise/.storybook/preview.ts
import type { Preview } from "@storybook/react" import "../styles/tailwind.css" const preview: Preview = { parameters: { actions: { argTypesRegex: "^on[A-Z].*" }, controls: { matchers: { color: /(background|color)$/i, date: /Date$/, }, }, }, } export default preview
1,139
0
petrpan-code/Blazity/next-enterprise
petrpan-code/Blazity/next-enterprise/.vscode/settings.json
{ "tailwindCSS.experimental.classRegex": [ ["cva(?:<[^>]*>)?(([^)]*))", "[\"'`]([^\"'`]*).*?[\"'`]", "(?:twMerge|twJoin)\\(([^\\);]*)[\\);]"] ] }
1,140
0
petrpan-code/Blazity/next-enterprise/components
petrpan-code/Blazity/next-enterprise/components/Button/Button.stories.tsx
import type { Meta, StoryObj } from "@storybook/react" import { Button } from "./Button" const meta: Meta<typeof Button> = { title: "Button", component: Button, args: { intent: "primary", underline: false, children: "Button", size: "lg", }, argTypes: { intent: { options: ["primary",...
1,141
0
petrpan-code/Blazity/next-enterprise/components
petrpan-code/Blazity/next-enterprise/components/Button/Button.tsx
import { cva, type VariantProps } from "class-variance-authority" import { twMerge } from "tailwind-merge" const button = cva( [ "justify-center", "inline-flex", "items-center", "rounded-xl", "text-center", "border", "border-blue-400", "transition-colors", "delay-50", ], { ...
1,142
0
petrpan-code/Blazity/next-enterprise/components
petrpan-code/Blazity/next-enterprise/components/Tooltip/Tooltip.tsx
import * as RadixTooltip from "@radix-ui/react-tooltip" import { cva, VariantProps } from "class-variance-authority" import React from "react" import { twMerge } from "tailwind-merge" const tooltipContent = cva([], { variants: { intent: { primary: ["rounded-0.5md", "bg-zinc-700", "font-open-sans", "text-wh...
1,143
0
petrpan-code/Blazity/next-enterprise
petrpan-code/Blazity/next-enterprise/e2e/example.spec.ts
import { expect, test } from "@playwright/test" test("has title", async ({ page }) => { await page.goto("./") await expect(page).toHaveTitle(/Next.js Enterprise Boilerplate/) })
1,144
0
petrpan-code/Blazity/next-enterprise
petrpan-code/Blazity/next-enterprise/pages/_app.test.tsx
import { render } from "@testing-library/react" import { AppProps } from "next/app" import MyApp from "./_app" // Mock router object with required properties const router = { basePath: "", pathname: "/", query: {}, asPath: "/", } describe("MyApp", () => { it("should render a component with page props", () =...
1,145
0
petrpan-code/Blazity/next-enterprise
petrpan-code/Blazity/next-enterprise/pages/_app.tsx
import "../styles/tailwind.css" import { AppProps } from "next/app" function MyApp({ Component, pageProps }: AppProps) { return <Component {...pageProps} /> } export default MyApp
1,146
0
petrpan-code/Blazity/next-enterprise
petrpan-code/Blazity/next-enterprise/pages/index.tsx
import { GetServerSidePropsContext } from "next" import Head from "next/head" import { Button } from "components/Button/Button" import { LP_GRID_ITEMS } from "../lp-items" export default function Web() { return ( <> <Head> <meta property="og:url" content="https://next-enterprise.vercel.app/" /> ...
1,147
0
petrpan-code/Blazity/next-enterprise/pages
petrpan-code/Blazity/next-enterprise/pages/api/health.ts
import { NextApiRequest, NextApiResponse } from "next" export default function handler(req: NextApiRequest, res: NextApiResponse) { res.status(200).json({ status: "ok" }) }
1,148
0
petrpan-code/Blazity/next-enterprise
petrpan-code/Blazity/next-enterprise/styles/tailwind.css
@tailwind base; @tailwind components; @tailwind utilities;
1,149
0
petrpan-code/sanity-io
petrpan-code/sanity-io/sanity/.babelrc
{ "presets": [ [ "@babel/preset-env", { "targets": { "node": "14", "chrome": "61", "safari": "11.3", "firefox": "60", "edge": "79" } } ], "@babel/preset-typescript", "@babel/preset-react" ], "plugins": ["@babel/plu...
1,150
0
petrpan-code/sanity-io
petrpan-code/sanity-io/sanity/.editorconfig
; editorconfig.org root = true charset= utf8 [*] end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true indent_style = space indent_size = 2 [*.md] trim_trailing_whitespace = false [*.snap] trim_trailing_whitespace = false
1,151
0
petrpan-code/sanity-io
petrpan-code/sanity-io/sanity/.env.example
# Example .env file for setting environment variables needed by e2e tests locally. # # Copy this file to `.env.local` (`cp .env.example .env.local`) and fill inn the values there # (`.env.local` is ignored by git) # This is a write token that allows playwright to interact with the studio as an authenticated user # You...
1,152
0
petrpan-code/sanity-io
petrpan-code/sanity-io/sanity/.eslintrc.cjs
'use strict' const baseConfig = { env: { node: true, browser: true, }, extends: [ 'sanity', 'sanity/react', 'sanity/import', 'plugin:react-hooks/recommended', 'prettier', ], parser: '@typescript-eslint/parser', plugins: ['import', '@typescript-eslint', 'prettier', 'react', 'tsdo...
1,153
0
petrpan-code/sanity-io
petrpan-code/sanity-io/sanity/.prettierignore
/.vscode /dev/*/.next /dev/*/.sanity /dev/*/build /dev/*/dist /dev/*/node_modules /dev/*/public /dev/*/static /dev/test-studio/sanity.theme.mjs /etc /examples/*/.sanity /examples/*/dist /examples/*/node_modules /examples/*/static /packages/*/coverage /packages/*/lib /packages/*/node_modules /packages/@sanity/*/cov...
1,154
0
petrpan-code/sanity-io
petrpan-code/sanity-io/sanity/.prettierrc
{ "semi": false, "printWidth": 100, "bracketSpacing": false, "singleQuote": true }
1,155
0
petrpan-code/sanity-io
petrpan-code/sanity-io/sanity/CODE_OF_CONDUCT.md
# Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender...
1,156
0
petrpan-code/sanity-io
petrpan-code/sanity-io/sanity/CONTRIBUTING.md
Want to file an issue? [Jump to _How to file an issue_ ⏬](#how-to-file-an-issue) # Contributing Contributions are always welcome, no matter how large or small. ## Getting started Before contributing, please read our [code of conduct](https://github.com/sanity-io/sanity/blob/current/CODE_OF_CONDUCT.md). Then make s...
1,157
0
petrpan-code/sanity-io
petrpan-code/sanity-io/sanity/LICENSE
MIT License Copyright (c) 2016 - 2023 Sanity.io Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, ...
1,158
0
petrpan-code/sanity-io
petrpan-code/sanity-io/sanity/README.md
<p align="center"> <a href="https://sanity.io"> <img src="https://cdn.sanity.io/images/3do82whm/next/1dfce9dde7a62ccaa8e8377254a1e919f6c07ad3-128x128.svg" /> </a> <h1 align="center">Sanity</h1> <h4 align="center"> <a href="https://www.sanity.io/get-started?ref=gh">Get Started</a> | <a href="https://...
1,159
0
petrpan-code/sanity-io
petrpan-code/sanity-io/sanity/babel.config.cjs
'use strict' /* eslint-disable no-sync */ const fs = require('fs') const path = require('path') const babelrc = JSON.parse(fs.readFileSync(path.join(__dirname, '.babelrc'), 'utf8')) module.exports = { ...babelrc, babelrcRoots: ['.', ...require('./lerna.json').packages], }
1,160
0
petrpan-code/sanity-io
petrpan-code/sanity-io/sanity/jest.config.cjs
'use strict' const path = require('path') const globby = require('globby') const pkg = require('./package.json') const jestConfigFiles = globby.sync( pkg.workspaces.map((workspace) => path.join(__dirname, workspace, '/jest.config.cjs')), ) const IGNORE_PROJECTS = [] module.exports = { projects: jestConfigFiles ...
1,161
0
petrpan-code/sanity-io
petrpan-code/sanity-io/sanity/lerna.json
{ "npmClient": "yarn", "useWorkspaces": true, "packages": [ "dev/*", "perf", "perf/studio", "examples/*", "packages/@sanity/*", "packages/create-sanity", "packages/groq", "packages/sanity" ], "version": "3.20.1" }
1,162
0
petrpan-code/sanity-io
petrpan-code/sanity-io/sanity/package.config.ts
import {optimizeLodashImports} from '@optimize-lodash/rollup-plugin' import {defineConfig} from '@sanity/pkg-utils' export default defineConfig({ define: { __DEV__: false, }, dist: 'lib', extract: { customTags: [ { name: 'hidden', allowMultiple: true, syntaxKind: 'block', ...
1,163
0
petrpan-code/sanity-io
petrpan-code/sanity-io/sanity/package.json
{ "name": "sanity-root", "version": "0.0.0", "private": true, "workspaces": [ "dev/*", "perf", "perf/studio", "examples/*", "packages/@sanity/*", "packages/create-sanity", "packages/groq", "packages/sanity" ], "scripts": { "bootstrap": "yarn install && yarn build:dts && y...
1,164
0
petrpan-code/sanity-io
petrpan-code/sanity-io/sanity/playwright.config.ts
// NOTE: load env files before other imports // eslint-disable-next-line import/order import {SANITY_E2E_SESSION_TOKEN} from './test/e2e/env' import os from 'os' import path from 'path' import {defineConfig, devices} from '@playwright/test' // Paths const TESTS_PATH = path.join(__dirname, 'test', 'e2e', 'tests') cons...
1,165
0
petrpan-code/sanity-io
petrpan-code/sanity-io/sanity/renovate.json
{ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": ["github>sanity-io/renovate-config", ":dependencyDashboardApproval"], "ignorePresets": ["github>sanity-io/renovate-config:group-non-major"], "packageRules": [ { "description": "Dependency updates to examples and the root shou...
1,166
0
petrpan-code/sanity-io
petrpan-code/sanity-io/sanity/tsconfig.json
{ "extends": "./tsconfig.settings", "include": ["**/*/package.config.ts", "./dev/aliases.cjs", "./scripts", "./test"], "compilerOptions": { "emitDeclarationOnly": true, "outDir": "./node_modules/.sanity-monorepo/dts", "allowJs": true }, "references": [ {"path": "./packages/@sanity/block-tools"...
1,167
0
petrpan-code/sanity-io
petrpan-code/sanity-io/sanity/tsconfig.lib.json
{ "extends": "./tsconfig.settings", "include": [], "compilerOptions": { "emitDeclarationOnly": true, "outDir": "./node_modules/.sanity-monorepo/dts" }, "references": [ {"path": "./packages/@sanity/block-tools/tsconfig.lib.json"}, {"path": "./packages/@sanity/cli/tsconfig.lib.json"}, {"path...
1,168
0
petrpan-code/sanity-io
petrpan-code/sanity-io/sanity/tsconfig.settings.json
{ "compilerOptions": { "lib": ["dom", "es2020"], // Output settings "module": "ES2020", "target": "ES2017", "declaration": true, "declarationMap": true, "sourceMap": true, // Settings "preserveConstEnums": true, "useUnknownInCatchVariables": false, "isolatedModules": true...
1,169
0
petrpan-code/sanity-io
petrpan-code/sanity-io/sanity/turbo.json
{ "$schema": "https://turbo.build/schema.json", // This is probably overkill, this will segment between GH actions and everything else for now. "globalEnv": ["OS", "RUNNER_OS"], // These root workspace files are reused in workspaces and may affect their build output "globalDependencies": [ ".babelrc", ...
1,170
0
petrpan-code/sanity-io
petrpan-code/sanity-io/sanity/vercel.json
{ "version": 2, "routes": [ { "handle": "filesystem" }, { "src": "/workshop/frame/(.*)", "dest": "/workshop/frame/index.html" }, { "src": "/(.*)", "dest": "/index.html" } ] }
1,171
0
petrpan-code/sanity-io
petrpan-code/sanity-io/sanity/yarn.lock
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 "@aashutoshrathi/word-wrap@^1.2.3": version "1.2.6" resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A...
1,172
0
petrpan-code/sanity-io/sanity
petrpan-code/sanity-io/sanity/.husky/pre-commit
#!/bin/sh . "$(dirname "$0")/_/husky.sh" yarn lint-staged
1,173
0
petrpan-code/sanity-io/sanity
petrpan-code/sanity-io/sanity/dev/aliases.cjs
'use strict' /* eslint-disable tsdoc/syntax */ /** * The path mappings/aliases used by various tools in the monorepo to map imported modules to * source files in order to speed up rebuilding and avoid having a separate watcher process to build * from `src` to `lib`. * * This file is currently read by: * - Vite ...
1,174
0
petrpan-code/sanity-io/sanity
petrpan-code/sanity-io/sanity/dev/tsconfig.dev.json
{ "extends": "../tsconfig.settings", "include": ["../packages/@sanity/util/src"], "compilerOptions": { "rootDir": "..", "baseUrl": "..", "outDir": "./.cache/ts", "paths": { // Alias to paths required for Sanity CLI to run in dev-mode "@sanity/mutator": ["./packages/@sanity/mutator/src...
1,175
0
petrpan-code/sanity-io/sanity/dev
petrpan-code/sanity-io/sanity/dev/.bin/sanity
#!/usr/bin/env node const path = require('path') require('esbuild-register/dist/node').register({ target: `node${process.version.slice(1)}`, }) // Define the global `__DEV__` flag which is used to // - determine when to use `esbuild-register` in the Sanity development server // - determine when to use `esbuild-reg...
1,176
0
petrpan-code/sanity-io/sanity/dev
petrpan-code/sanity-io/sanity/dev/depcheck-test/package.json
{ "name": "depcheck-test", "version": "3.20.1", "private": true, "license": "MIT", "author": "Sanity.io <hello@sanity.io>" }
1,177
0
petrpan-code/sanity-io/sanity/dev
petrpan-code/sanity-io/sanity/dev/design-studio/.eslintrc
{ "rules": { "@typescript-eslint/explicit-module-boundary-types": "off" } }
1,178
0
petrpan-code/sanity-io/sanity/dev
petrpan-code/sanity-io/sanity/dev/design-studio/LICENSE
MIT License Copyright (c) 2016 - 2023 Sanity.io Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, ...
1,179
0
petrpan-code/sanity-io/sanity/dev
petrpan-code/sanity-io/sanity/dev/design-studio/README.md
# design-studio
1,180
0
petrpan-code/sanity-io/sanity/dev
petrpan-code/sanity-io/sanity/dev/design-studio/package.json
{ "name": "design-studio", "version": "3.20.1", "private": true, "description": "Sanity Design Studio", "keywords": [ "sanity", "cms", "headless", "realtime", "content", "design-studio" ], "homepage": "https://www.sanity.io/", "bugs": { "url": "https://github.com/sanity-io/sa...
1,181
0
petrpan-code/sanity-io/sanity/dev
petrpan-code/sanity-io/sanity/dev/design-studio/sanity.config.ts
import {defineConfig} from 'sanity' import {deskTool} from 'sanity/desk' import {templates} from './templates' import {themePreviewTool} from './plugins/theme-preview-tool' import {schemaTypes} from './schemaTypes' import {structure} from './structure' export default defineConfig({ plugins: [ deskTool({structure...
1,182
0
petrpan-code/sanity-io/sanity/dev
petrpan-code/sanity-io/sanity/dev/design-studio/structure.ts
import {StructureResolver, DefaultDocumentNodeResolver} from 'sanity' import {CogIcon} from '@sanity/icons' import {CustomPane} from './components/CustomPane' import {IFrameView} from './components/IframeView' import {JSONPreviewDocumentView} from './components/jsonPreview' import {StyledTestView} from './schemaTypes/d...
1,183
0
petrpan-code/sanity-io/sanity/dev
petrpan-code/sanity-io/sanity/dev/design-studio/templates.ts
import {Template} from 'sanity' export const templates: Template[] = [ { id: 'author-developer', title: 'Developer', schemaType: 'author', value: { role: 'developer', }, }, { id: 'author-designer', title: 'Designer', schemaType: 'author', value: { role: 'designer',...
1,184
0
petrpan-code/sanity-io/sanity/dev
petrpan-code/sanity-io/sanity/dev/design-studio/tsconfig.json
{ "extends": "../tsconfig.dev", "include": ["**/*.ts", "**/*.tsx"], "compilerOptions": { "jsx": "preserve" }, "references": [{"path": "../../packages/sanity/tsconfig.lib.json"}] }
1,185
0
petrpan-code/sanity-io/sanity/dev/design-studio
petrpan-code/sanity-io/sanity/dev/design-studio/components/IframeView.tsx
import React from 'react' import styled from 'styled-components' const IFrame = styled.iframe` display: block; width: 100%; height: 100%; border: 0; ` export function IFrameView() { return <IFrame src="https://www.sanity.io/" /> }
1,186
0
petrpan-code/sanity-io/sanity/dev/design-studio
petrpan-code/sanity-io/sanity/dev/design-studio/components/jsonPreview.tsx
import {Card, Code} from '@sanity/ui' import React from 'react' export function JSONPreviewDocumentView(props: any) { return ( <Card padding={4} sizing="border" style={{minHeight: '100%'}} tone="transparent"> <Code language="json">{JSON.stringify(props.document.displayed, null, 2)}</Code> </Card> ) }...
1,187
0
petrpan-code/sanity-io/sanity/dev/design-studio/components
petrpan-code/sanity-io/sanity/dev/design-studio/components/CustomPane/CustomPane.tsx
import React, {useCallback} from 'react' import {Button, Card, Code, Stack} from '@sanity/ui' import {usePaneRouter} from 'sanity/desk' export function CustomPane(props: any) { return ( <Card height="fill" tone="transparent"> <Stack padding={2} space={1}> <Code language="json">{JSON.stringify(props...
1,188
0
petrpan-code/sanity-io/sanity/dev/design-studio/components
petrpan-code/sanity-io/sanity/dev/design-studio/components/CustomPane/index.ts
export * from './CustomPane'
1,189
0
petrpan-code/sanity-io/sanity/dev/design-studio/plugins
petrpan-code/sanity-io/sanity/dev/design-studio/plugins/theme-preview-tool/ColorCanvas.tsx
import {Tool} from 'sanity' import { Box, Card, CardTone, Flex, Grid, Stack, Text, ThemeColor, ThemeColorButton, ThemeColorButtonState, ThemeColorButtonStates, ThemeColorButtonTones, ThemeColorMuted, ThemeColorMutedTone, ThemeColorProvider, ThemeColorScheme, ThemeColorSelectable, The...
1,190
0
petrpan-code/sanity-io/sanity/dev/design-studio/plugins
petrpan-code/sanity-io/sanity/dev/design-studio/plugins/theme-preview-tool/index.ts
import {definePlugin} from 'sanity' import {IceCreamIcon} from '@sanity/icons' import {ColorCanvas} from './ColorCanvas' export function themePreviewTool() { return definePlugin({ name: 'design-studio/theme-preview-tool', tools: [ { icon: IceCreamIcon, name: 'theme-preview', tit...
1,191
0
petrpan-code/sanity-io/sanity/dev/design-studio/plugins
petrpan-code/sanity-io/sanity/dev/design-studio/plugins/theme-preview-tool/sanity.json
{ "parts": [ { "implements": "part:@sanity/base/tool", "path": "tool" } ] }
1,192
0
petrpan-code/sanity-io/sanity/dev/design-studio
petrpan-code/sanity-io/sanity/dev/design-studio/schemaTypes/allInputs.ts
import {Rule} from 'sanity' // import author from './author' const title = { type: 'string', name: 'title', title: 'Title', } // example fields const arrayOfNestedArrays = { type: 'array', name: 'arrayOfNestedArrays', title: 'Array (0)', of: [ { type: 'object', name: 'level1', ti...
1,193
0
petrpan-code/sanity-io/sanity/dev/design-studio
petrpan-code/sanity-io/sanity/dev/design-studio/schemaTypes/arrayInArray.ts
const nestedItemTypeA = { type: 'object', name: 'itemA', title: 'Item A', fields: [ { type: 'string', name: 'title', title: 'Title', }, ], } const nestedItemTypeB = { type: 'object', name: 'itemB', title: 'Item B', fields: [ { type: 'string', name: 'title', ...
1,194
0
petrpan-code/sanity-io/sanity/dev/design-studio
petrpan-code/sanity-io/sanity/dev/design-studio/schemaTypes/author.ts
import {UserIcon} from '@sanity/icons' import {Rule} from 'sanity' export default { type: 'document', name: 'author', title: 'Author', icon: UserIcon, fields: [ { type: 'string', name: 'name', title: 'Name', validation: (rule: Rule) => rule.required().min(10).max(80), }, {...
1,195
0
petrpan-code/sanity-io/sanity/dev/design-studio
petrpan-code/sanity-io/sanity/dev/design-studio/schemaTypes/index.ts
import allInputs from './allInputs' import arrayInArray from './arrayInArray' import author from './author' import complexArrays from './complexArrays' import documentWithViews from './documentWithViews' import live from './live' import pt from './pt' import radioInputs from './radioInputs' import selectInputs from './...
1,196
0
petrpan-code/sanity-io/sanity/dev/design-studio
petrpan-code/sanity-io/sanity/dev/design-studio/schemaTypes/live.ts
import {Rule} from 'sanity' export default { type: 'document', name: 'live', title: 'Live Document', liveEdit: true, fields: [ { type: 'string', name: 'name', title: 'Name', validation: (rule: Rule) => rule.required().min(10).max(80), }, ], }
1,197
0
petrpan-code/sanity-io/sanity/dev/design-studio
petrpan-code/sanity-io/sanity/dev/design-studio/schemaTypes/pt.ts
import {Rule} from 'sanity' const objectExample = { type: 'object', name: 'objectExample', title: 'Object (1)', fields: [ {type: 'string', name: 'title', title: 'Title'}, {type: 'reference', name: 'author', to: {type: 'author'}}, ], } const imageExample = { type: 'image', name: 'imageExample', ...
1,198
0
petrpan-code/sanity-io/sanity/dev/design-studio
petrpan-code/sanity-io/sanity/dev/design-studio/schemaTypes/radioInputs.ts
export default { type: 'document', name: 'radioInputs', title: 'Radio inputs', fields: [ { type: 'string', name: 'title', title: 'Title', }, { type: 'string', name: 'stringObjects', title: 'String (objects)', options: { layout: 'radio', list...
1,199