Skip to content

Commit e5c6182

Browse files
committed
[development] Separate example-studio and test-studio and organize test cases according to type (#131)
1 parent b991d9b commit e5c6182

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+3788
-682
lines changed

gulpfile.js

+21
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,27 @@ gulp.task('dev', ['watch-js', 'watch-assets'], cb => {
114114
gulp.start('watch-assets')
115115
})
116116

117+
const projectPath = path.join(__dirname, 'packages', 'test-studio')
118+
const npmPath = path.join(projectPath, 'node_modules', '.bin')
119+
const proc = childProcess.spawn('sanity', ['start', '--host', '0.0.0.0'], {
120+
cwd: projectPath,
121+
env: Object.assign({}, process.env, {
122+
PATH: [npmPath].concat(process.env.PATH.split(path.delimiter)).join(path.delimiter)
123+
})
124+
})
125+
126+
proc.stdout.pipe(process.stdout)
127+
proc.stderr.pipe(process.stderr)
128+
})
129+
gulp.task('example', ['watch-js', 'watch-assets'], cb => {
130+
watch(scripts, {debounceDelay: 200}, () => {
131+
gulp.start('watch-js')
132+
})
133+
134+
watch(assets, {debounceDelay: 200}, () => {
135+
gulp.start('watch-assets')
136+
})
137+
117138
const projectPath = path.join(__dirname, 'packages', 'example-studio')
118139
const npmPath = path.join(projectPath, 'node_modules', '.bin')
119140
const proc = childProcess.spawn('sanity', ['start', '--host', '0.0.0.0'], {

lerna.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"packages": [
55
"packages/@sanity/*",
66
"packages/example-studio",
7+
"packages/test-studio",
78
"packages/sanity-plugin-vision",
89
"packages/storybook"
910
],

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"init": "lerna clean --yes && yarn run bootstrap && yarn run build",
1111
"start": "gulp dev",
1212
"storybook": "gulp storybook",
13+
"example": "gulp example",
1314
"stylelint": "stylelint \"**/*.css\"",
1415
"stylelint:fix": "stylelint \"**/*.css\" --fix",
1516
"test": "echo 'Run `npm run test-all` to run `npm test` for every package'",

packages/example-studio/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# sanitytest
1+
# Example Studio
22

3-
Just a sample Sanity studio project
3+
A sanity studio with instructional examples and useful patterns

packages/example-studio/components/LocaleStringInput/LocaleStringInput.css

-7
This file was deleted.

packages/example-studio/components/LocaleStringInput/LocaleStringInput.js

-52
This file was deleted.

packages/example-studio/components/LocaleStringInput/index.js

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"hiddenTypes": ["block", "span", "mark", "link", "address"],
2+
"hiddenTypes": ["block", "span", "mark", "link", "address", "code", "localeString", "localeSlug", "videoEmbed", "protein"],
33
"listOptions": {}
44
}

packages/example-studio/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "example-studio",
3-
"private": "true",
3+
"private": true,
44
"version": "0.108.13",
5-
"description": "Just a sample Sanity studio project",
5+
"description": "A sanity studio with instructional examples and useful patterns",
66
"author": "Sanity.io <[email protected]>",
77
"license": "MIT",
88
"scripts": {

packages/example-studio/sanity.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
},
66
"api": {
77
"projectId": "q2r21cu7",
8-
"dataset": "playground"
8+
"dataset": "example"
99
},
1010
"plugins": [
1111
"@sanity/base",

packages/example-studio/schemas/arrays.js

-64
This file was deleted.

0 commit comments

Comments
 (0)