@tscircuit/fake-snippets 0.0.32 → 0.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bun-tests/fake-snippets-api/routes/package_releases/create.test.ts +3 -3
- package/bun-tests/fake-snippets-api/routes/package_releases/list.test.ts +2 -2
- package/bun-tests/fake-snippets-api/routes/package_releases/update.test.ts +4 -4
- package/bun-tests/fake-snippets-api/routes/packages/add_star.test.ts +3 -3
- package/bun-tests/fake-snippets-api/routes/packages/create.test.ts +4 -3
- package/bun-tests/fake-snippets-api/routes/packages/get.test.ts +3 -3
- package/bun-tests/fake-snippets-api/routes/packages/remove_star.test.ts +3 -3
- package/bun-tests/fake-snippets-api/routes/packages/update.test.ts +3 -3
- package/dist/bundle.js +10 -3
- package/dist/index.d.ts +5 -0
- package/dist/index.js +2 -0
- package/fake-snippets-api/lib/db/db-client.ts +1 -0
- package/fake-snippets-api/lib/db/schema.ts +1 -0
- package/fake-snippets-api/lib/public-mapping/public-map-package.ts +2 -0
- package/fake-snippets-api/routes/api/packages/create.ts +4 -1
- package/fake-snippets-api/routes/api/packages/update.ts +3 -1
- package/package.json +1 -1
- package/src/components/ViewPackagePage/components/mobile-sidebar.tsx +122 -43
- package/src/components/ViewPackagePage/components/preview-image-squares.tsx +23 -35
- package/src/components/ViewPackagePage/components/sidebar-about-section.tsx +116 -51
- package/src/components/ViewPackagePage/components/tab-views/files-view.tsx +31 -19
- package/src/components/ViewPackagePage/utils/is-hidden-file.ts +52 -0
- package/src/components/dialogs/edit-package-details-dialog.tsx +191 -0
- package/src/hooks/use-fork-package-mutation.ts +1 -1
- package/src/hooks/use-preview-images.ts +66 -0
- package/src/pages/dashboard.tsx +4 -0
- package/src/pages/user-profile.tsx +4 -4
- package/src/pages/view-package.tsx +19 -13
|
@@ -8,7 +8,7 @@ test("create package release", async () => {
|
|
|
8
8
|
const packageResponse = await axios.post(
|
|
9
9
|
"/api/packages/create",
|
|
10
10
|
{
|
|
11
|
-
name: "test-package",
|
|
11
|
+
name: "testuser/test-package",
|
|
12
12
|
description: "Test Description",
|
|
13
13
|
},
|
|
14
14
|
{
|
|
@@ -45,7 +45,7 @@ test("create package release using package_name_with_version", async () => {
|
|
|
45
45
|
const packageResponse = await axios.post(
|
|
46
46
|
"/api/packages/create",
|
|
47
47
|
{
|
|
48
|
-
name: "test-package-2",
|
|
48
|
+
name: "testuser/test-package-2",
|
|
49
49
|
description: "Test Description",
|
|
50
50
|
},
|
|
51
51
|
{
|
|
@@ -79,7 +79,7 @@ test("create package release - version already exists", async () => {
|
|
|
79
79
|
const packageResponse = await axios.post(
|
|
80
80
|
"/api/packages/create",
|
|
81
81
|
{
|
|
82
|
-
name: "test-package-3",
|
|
82
|
+
name: "testuser/test-package-3",
|
|
83
83
|
description: "Test Description",
|
|
84
84
|
},
|
|
85
85
|
{
|
|
@@ -8,7 +8,7 @@ test("list package releases", async () => {
|
|
|
8
8
|
const packageResponse = await axios.post(
|
|
9
9
|
"/api/packages/create",
|
|
10
10
|
{
|
|
11
|
-
name: "test-package",
|
|
11
|
+
name: "testuser/test-package",
|
|
12
12
|
description: "Test Description",
|
|
13
13
|
},
|
|
14
14
|
{
|
|
@@ -66,7 +66,7 @@ test("list package releases", async () => {
|
|
|
66
66
|
const { data: packageNameData } = await axios.post(
|
|
67
67
|
"/api/package_releases/list",
|
|
68
68
|
{
|
|
69
|
-
package_name: "test-package",
|
|
69
|
+
package_name: "testuser/test-package",
|
|
70
70
|
},
|
|
71
71
|
)
|
|
72
72
|
expect(packageNameData.ok).toBe(true)
|
|
@@ -8,7 +8,7 @@ test("update package release", async () => {
|
|
|
8
8
|
const packageResponse = await axios.post(
|
|
9
9
|
"/api/packages/create",
|
|
10
10
|
{
|
|
11
|
-
name: "test-package",
|
|
11
|
+
name: "testuser/test-package",
|
|
12
12
|
description: "Test Description",
|
|
13
13
|
},
|
|
14
14
|
{
|
|
@@ -52,7 +52,7 @@ test("update package release using package_name_with_version", async () => {
|
|
|
52
52
|
const packageResponse = await axios.post(
|
|
53
53
|
"/api/packages/create",
|
|
54
54
|
{
|
|
55
|
-
name: "test-package-2",
|
|
55
|
+
name: "testuser/test-package-2",
|
|
56
56
|
description: "Test Description",
|
|
57
57
|
},
|
|
58
58
|
{
|
|
@@ -92,7 +92,7 @@ test("update package release - handle is_latest flag", async () => {
|
|
|
92
92
|
const packageResponse = await axios.post(
|
|
93
93
|
"/api/packages/create",
|
|
94
94
|
{
|
|
95
|
-
name: "test-package-3",
|
|
95
|
+
name: "testuser/test-package-3",
|
|
96
96
|
description: "Test Description",
|
|
97
97
|
},
|
|
98
98
|
{
|
|
@@ -161,7 +161,7 @@ test("update package release - no fields provided", async () => {
|
|
|
161
161
|
const packageResponse = await axios.post(
|
|
162
162
|
"/api/packages/create",
|
|
163
163
|
{
|
|
164
|
-
name: "test-package-4",
|
|
164
|
+
name: "testuser/test-package-4",
|
|
165
165
|
description: "Test Description",
|
|
166
166
|
},
|
|
167
167
|
{
|
|
@@ -6,7 +6,7 @@ test("add star to package using package_id", async () => {
|
|
|
6
6
|
|
|
7
7
|
// Create a test package using the create endpoint
|
|
8
8
|
const newPackageData = {
|
|
9
|
-
name: "test-package",
|
|
9
|
+
name: "testuser/test-package",
|
|
10
10
|
description: "Test Description",
|
|
11
11
|
}
|
|
12
12
|
const createResponse = await axios.post(
|
|
@@ -39,7 +39,7 @@ test("add star to package using name", async () => {
|
|
|
39
39
|
|
|
40
40
|
// Create a test package using the create endpoint
|
|
41
41
|
const newPackageData = {
|
|
42
|
-
name: "test-package-2",
|
|
42
|
+
name: "testuser/test-package-2",
|
|
43
43
|
description: "Test Description",
|
|
44
44
|
}
|
|
45
45
|
const createResponse = await axios.post(
|
|
@@ -115,7 +115,7 @@ test("add star to already starred package", async () => {
|
|
|
115
115
|
|
|
116
116
|
// Create a test package using the create endpoint
|
|
117
117
|
const newPackageData = {
|
|
118
|
-
name: "test-package-3",
|
|
118
|
+
name: "testuser/test-package-3",
|
|
119
119
|
description: "Test Description",
|
|
120
120
|
}
|
|
121
121
|
const createResponse = await axios.post(
|
|
@@ -7,7 +7,7 @@ test("create package", async () => {
|
|
|
7
7
|
const response = await axios.post(
|
|
8
8
|
"/api/packages/create",
|
|
9
9
|
{
|
|
10
|
-
name: "TestPackage",
|
|
10
|
+
name: "testuser/TestPackage",
|
|
11
11
|
description: "Test Description",
|
|
12
12
|
},
|
|
13
13
|
{
|
|
@@ -18,7 +18,8 @@ test("create package", async () => {
|
|
|
18
18
|
)
|
|
19
19
|
|
|
20
20
|
expect(response.status).toBe(200)
|
|
21
|
-
expect(response.data.package.name).toBe("TestPackage")
|
|
21
|
+
expect(response.data.package.name).toBe("testuser/TestPackage")
|
|
22
|
+
expect(response.data.package.unscoped_name).toBe("TestPackage")
|
|
22
23
|
expect(response.data.package.description).toBe("Test Description")
|
|
23
24
|
expect(response.data.package.owner_github_username).toBe("testuser")
|
|
24
25
|
expect(response.data.package.description).toBe("Test Description")
|
|
@@ -32,7 +33,7 @@ test("create package with private flag", async () => {
|
|
|
32
33
|
const { axios } = await getTestServer()
|
|
33
34
|
|
|
34
35
|
const response = await axios.post("/api/packages/create", {
|
|
35
|
-
name: "TestPackage",
|
|
36
|
+
name: "testuser/TestPackage",
|
|
36
37
|
description: "Test Description",
|
|
37
38
|
is_private: true,
|
|
38
39
|
})
|
|
@@ -6,7 +6,7 @@ test("GET /api/packages/get - should return package by package_id", async () =>
|
|
|
6
6
|
|
|
7
7
|
// Create a new package using the /create endpoint
|
|
8
8
|
const newPackageData = {
|
|
9
|
-
name: "test-package",
|
|
9
|
+
name: "testuser/test-package",
|
|
10
10
|
description: "A test package",
|
|
11
11
|
creator_account_id: "test_account_id",
|
|
12
12
|
owner_org_id: "test_org_id",
|
|
@@ -61,7 +61,7 @@ test("GET /api/packages/get - should return package by name", async () => {
|
|
|
61
61
|
const { axios } = await getTestServer()
|
|
62
62
|
|
|
63
63
|
await axios.post("/api/packages/create", {
|
|
64
|
-
name: "test-package",
|
|
64
|
+
name: "testuser/test-package",
|
|
65
65
|
description: "A test package",
|
|
66
66
|
creator_account_id: "test_account_id",
|
|
67
67
|
owner_org_id: "test_org_id",
|
|
@@ -69,7 +69,7 @@ test("GET /api/packages/get - should return package by name", async () => {
|
|
|
69
69
|
})
|
|
70
70
|
|
|
71
71
|
const getResponse = await axios.get("/api/packages/get", {
|
|
72
|
-
params: { name: "test-package" },
|
|
72
|
+
params: { name: "testuser/test-package" },
|
|
73
73
|
})
|
|
74
74
|
|
|
75
75
|
expect(getResponse.status).toBe(200)
|
|
@@ -6,7 +6,7 @@ test("remove star from package using package_id", async () => {
|
|
|
6
6
|
|
|
7
7
|
// Create a test package
|
|
8
8
|
const newPackageData = {
|
|
9
|
-
name: "test-package",
|
|
9
|
+
name: "testuser/test-package",
|
|
10
10
|
description: "Test Description",
|
|
11
11
|
}
|
|
12
12
|
const createResponse = await axios.post(
|
|
@@ -43,7 +43,7 @@ test("remove star from package using name", async () => {
|
|
|
43
43
|
|
|
44
44
|
// Create a test package
|
|
45
45
|
const newPackageData = {
|
|
46
|
-
name: "test-package-2",
|
|
46
|
+
name: "testuser/test-package-2",
|
|
47
47
|
description: "Test Description",
|
|
48
48
|
}
|
|
49
49
|
const createResponse = await axios.post(
|
|
@@ -127,7 +127,7 @@ test("remove star from unstarred package", async () => {
|
|
|
127
127
|
|
|
128
128
|
// Create a test package
|
|
129
129
|
const newPackageData = {
|
|
130
|
-
name: "test-package-3",
|
|
130
|
+
name: "testuser/test-package-3",
|
|
131
131
|
description: "Test Description",
|
|
132
132
|
}
|
|
133
133
|
const createResponse = await axios.post(
|
|
@@ -8,7 +8,7 @@ test("update package", async () => {
|
|
|
8
8
|
const packageResponse = await axios.post(
|
|
9
9
|
"/api/packages/create",
|
|
10
10
|
{
|
|
11
|
-
name: "test-package",
|
|
11
|
+
name: "testuser/test-package",
|
|
12
12
|
description: "Test Description",
|
|
13
13
|
},
|
|
14
14
|
{
|
|
@@ -52,7 +52,7 @@ test("update package privacy settings", async () => {
|
|
|
52
52
|
const packageResponse = await axios.post(
|
|
53
53
|
"/api/packages/create",
|
|
54
54
|
{
|
|
55
|
-
name: "public-package",
|
|
55
|
+
name: "testuser/public-package",
|
|
56
56
|
description: "Public Package",
|
|
57
57
|
is_private: false,
|
|
58
58
|
},
|
|
@@ -119,7 +119,7 @@ test("update package without permission", async () => {
|
|
|
119
119
|
const { axios, db } = await getTestServer()
|
|
120
120
|
|
|
121
121
|
db.addPackage({
|
|
122
|
-
name: "Package3",
|
|
122
|
+
name: "testuser/Package3",
|
|
123
123
|
unscoped_name: "Package3",
|
|
124
124
|
owner_github_username: "user1",
|
|
125
125
|
creator_account_id: "creator1",
|