Skip to content

Commit e94c02f

Browse files
authoredMar 19, 2024··
feat(codegen): add codegen skeleton package (#5979)
contains just the infrastructure for a new package for codegen application
1 parent 1dd2ccc commit e94c02f

13 files changed

+174
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"ignores": ["@sanity/pkg-utils"]
3+
}
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use strict'
2+
3+
const path = require('path')
4+
5+
const ROOT_PATH = path.resolve(__dirname, '../../..')
6+
7+
module.exports = {
8+
rules: {
9+
'import/no-extraneous-dependencies': ['error', {packageDir: [ROOT_PATH, __dirname]}],
10+
},
11+
}

‎packages/@sanity/codegen/.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Logs
2+
/logs
3+
*.log
4+
5+
# Coverage directory used by tools like istanbul
6+
/coverage
7+
8+
# Dependency directories
9+
/node_modules
10+
11+
# Compiled code
12+
/lib

‎packages/@sanity/codegen/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# @sanity/codegen
2+
3+
Codegen toolkit for Sanity.io. This package is currently in an experimental state, and subject to change.
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'use strict'
2+
3+
const {createJestConfig} = require('../../../test/config.cjs')
4+
5+
module.exports = createJestConfig({
6+
displayName: require('./package.json').name,
7+
testEnvironment: 'node',
8+
})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import {defineConfig} from '@sanity/pkg-utils'
2+
3+
import baseConfig from '../../../package.config'
4+
5+
export default defineConfig(baseConfig)

‎packages/@sanity/codegen/package.json

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"name": "@sanity/codegen",
3+
"version": "3.33.0",
4+
"description": "Codegen toolkit for Sanity.io",
5+
"keywords": [
6+
"sanity",
7+
"cms",
8+
"headless",
9+
"realtime",
10+
"content",
11+
"codegen"
12+
],
13+
"homepage": "https://www.sanity.io/",
14+
"bugs": {
15+
"url": "https://github.com/sanity-io/sanity/issues"
16+
},
17+
"publishConfig": {
18+
"access": "public"
19+
},
20+
"repository": {
21+
"type": "git",
22+
"url": "git+https://github.com/sanity-io/sanity.git",
23+
"directory": "packages/@sanity/codegen"
24+
},
25+
"license": "MIT",
26+
"author": "Sanity.io <hello@sanity.io>",
27+
"exports": {
28+
".": {
29+
"types": "./lib/dts/src/_exports/index.d.ts",
30+
"source": "./src/_exports/index.ts",
31+
"require": "./lib/_exports/index.js",
32+
"node": {
33+
"module": "./lib/_exports/index.esm.js",
34+
"import": "./lib/_exports/index.cjs.mjs"
35+
},
36+
"import": "./lib/_exports/index.esm.js",
37+
"default": "./lib/_exports/index.esm.js"
38+
},
39+
"./package.json": "./package.json"
40+
},
41+
"main": "./lib/_exports/index.js",
42+
"module": "./lib/_exports/index.esm.js",
43+
"source": "./src/_exports/index.ts",
44+
"types": "./lib/dts/src/_exports/index.d.ts",
45+
"files": [
46+
"lib",
47+
"src",
48+
"!**/__tests__/**"
49+
],
50+
"scripts": {
51+
"prebuild": "run-s clean",
52+
"build": "pkg-utils build --tsconfig tsconfig.lib.json",
53+
"postbuild": "run-s check:package",
54+
"check:package": "pkg-utils --strict --tsconfig tsconfig.lib.json",
55+
"clean": "rimraf lib coverage",
56+
"lint": "eslint .",
57+
"watch": "pkg-utils watch --tsconfig tsconfig.lib.json",
58+
"test": "jest"
59+
},
60+
"dependencies": {},
61+
"devDependencies": {
62+
"rimraf": "^3.0.2"
63+
},
64+
"engines": {
65+
"node": ">=18"
66+
}
67+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const TODO = 1
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "../../../tsconfig.settings",
3+
"include": ["./src/**/*"],
4+
"compilerOptions": {
5+
"composite": true,
6+
"lib": ["ES2022.Error"],
7+
"rootDir": ".",
8+
"outDir": "./lib/dts",
9+
"declarationDir": "./lib/dts"
10+
},
11+
"references": [{"path": "../types/tsconfig.lib.json"}, {"path": "../../groq/tsconfig.lib.json"}]
12+
}
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "../../../tsconfig.settings",
3+
"include": ["./src/**/*"],
4+
"compilerOptions": {
5+
"composite": true,
6+
"lib": ["ES2022.Error"],
7+
"rootDir": ".",
8+
"outDir": "./lib/dts",
9+
"declarationDir": "./lib/dts"
10+
},
11+
"references": [{"path": "../types/tsconfig.lib.json"}, {"path": "../../groq/tsconfig.lib.json"}]
12+
}

‎packages/@sanity/codegen/tsdoc.json

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
3+
"tagDefinitions": [
4+
{
5+
"tagName": "@hidden",
6+
"syntaxKind": "block",
7+
"allowMultiple": true
8+
},
9+
{
10+
"tagName": "@todo",
11+
"syntaxKind": "block",
12+
"allowMultiple": true
13+
}
14+
],
15+
"supportForTags": {
16+
"@hidden": true,
17+
"@beta": true,
18+
"@internal": true,
19+
"@public": true,
20+
"@experimental": true,
21+
"@see": true,
22+
"@link": true,
23+
"@example": true,
24+
"@deprecated": true,
25+
"@alpha": true,
26+
"@param": true,
27+
"@returns": true,
28+
"@remarks": true,
29+
"@throws": true,
30+
"@defaultValue": true,
31+
"@todo": true
32+
}
33+
}

‎pnpm-lock.yaml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
{"path": "./packages/@sanity/mutator"},
1414
{"path": "./packages/@sanity/portable-text-editor"},
1515
{"path": "./packages/@sanity/schema"},
16+
{"path": "./packages/@sanity/codegen"},
1617
{"path": "./packages/@sanity/types"},
1718
{"path": "./packages/@sanity/util"},
1819
{"path": "./packages/@sanity/vision"},

0 commit comments

Comments
 (0)
Please sign in to comment.