Skip to content

Commit

Permalink
fix ui exports, change api package bunder to vite, fix type exports
Browse files Browse the repository at this point in the history
  • Loading branch information
Onatcer committed Aug 22, 2024
1 parent f5054f5 commit 9b4e586
Show file tree
Hide file tree
Showing 8 changed files with 1,996 additions and 126 deletions.
1,924 changes: 1,884 additions & 40 deletions resources/js/packages/api/package-lock.json

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions resources/js/packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{
"name": "@solidtime/api",
"version": "0.0.1",
"version": "0.0.2",
"description": "Package containing the solidtime api client and type declarations",
"main": "dist/index.js",
"main": "./dist/solidtime-api.umd.cjs",
"module": "./dist/solidtime-api.js",
"types": "./dist/index.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/solidtime-io/solidtime.git",
"directory": "resources/js/packages/api"
},
"scripts": {
"build": "npx ncc build src/index.ts",
"build": "npx vite build",
"test": "echo \"Error: no test specified\" && exit 1"
},
"files": [
Expand All @@ -31,6 +33,7 @@
"zod": "^3.23.8"
},
"devDependencies": {
"@vercel/ncc": "^0.38.1"
"vite": "^5.4.2",
"vite-plugin-dts": "^4.0.3"
}
}
44 changes: 44 additions & 0 deletions resources/js/packages/api/src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import type { ApiOf, ZodiosResponseByAlias, ZodiosBodyByAlias, ZodiosQueryParamsByAlias } from '@zodios/core';

Check warning on line 1 in resources/js/packages/api/src/index.d.ts

View workflow job for this annotation

GitHub Actions / build

Replace `·ApiOf,·ZodiosResponseByAlias,·ZodiosBodyByAlias,·ZodiosQueryParamsByAlias·` with `⏎····ApiOf,⏎····ZodiosResponseByAlias,⏎····ZodiosBodyByAlias,⏎····ZodiosQueryParamsByAlias,⏎`
export type SolidTimeApi = ApiOf<typeof api>;
export type InvitationsIndexResponse = ZodiosResponseByAlias<SolidTimeApi, 'getInvitations'>;

Check warning on line 3 in resources/js/packages/api/src/index.d.ts

View workflow job for this annotation

GitHub Actions / build

Replace `SolidTimeApi,·'getInvitations'` with `⏎····SolidTimeApi,⏎····'getInvitations'⏎`
export type CreateInvitationBody = ZodiosBodyByAlias<SolidTimeApi, 'invite'>;
export type Invitation = InvitationsIndexResponse['data'][0];
export type TimeEntryResponse = ZodiosResponseByAlias<SolidTimeApi, 'getTimeEntries'>;

Check warning on line 6 in resources/js/packages/api/src/index.d.ts

View workflow job for this annotation

GitHub Actions / build

Replace `SolidTimeApi,·'getTimeEntries'` with `⏎····SolidTimeApi,⏎····'getTimeEntries'⏎`
export type TimeEntry = TimeEntryResponse['data'][0];
export type CreateTimeEntryBody = ZodiosBodyByAlias<SolidTimeApi, 'createTimeEntry'>;

Check warning on line 8 in resources/js/packages/api/src/index.d.ts

View workflow job for this annotation

GitHub Actions / build

Replace `SolidTimeApi,·'createTimeEntry'` with `⏎····SolidTimeApi,⏎····'createTimeEntry'⏎`
export type ProjectResponse = ZodiosResponseByAlias<SolidTimeApi, 'getProjects'>;

Check warning on line 9 in resources/js/packages/api/src/index.d.ts

View workflow job for this annotation

GitHub Actions / build

Replace `SolidTimeApi,·'getProjects'` with `⏎····SolidTimeApi,⏎····'getProjects'⏎`
export type Project = ProjectResponse['data'][0];
export type CreateProjectBody = ZodiosBodyByAlias<SolidTimeApi, 'createProject'>;

Check warning on line 11 in resources/js/packages/api/src/index.d.ts

View workflow job for this annotation

GitHub Actions / build

Replace `SolidTimeApi,·'createProject'` with `⏎····SolidTimeApi,⏎····'createProject'⏎`
export type UpdateProjectBody = ZodiosBodyByAlias<SolidTimeApi, 'updateProject'>;

Check warning on line 12 in resources/js/packages/api/src/index.d.ts

View workflow job for this annotation

GitHub Actions / build

Replace `SolidTimeApi,·'updateProject'` with `⏎····SolidTimeApi,⏎····'updateProject'⏎`
export type ProjectMemberResponse = ZodiosResponseByAlias<SolidTimeApi, 'getProjectMembers'>;

Check warning on line 13 in resources/js/packages/api/src/index.d.ts

View workflow job for this annotation

GitHub Actions / build

Replace `SolidTimeApi,·'getProjectMembers'` with `⏎····SolidTimeApi,⏎····'getProjectMembers'⏎`
export type CreateProjectMemberBody = ZodiosBodyByAlias<SolidTimeApi, 'createProjectMember'>;

Check warning on line 14 in resources/js/packages/api/src/index.d.ts

View workflow job for this annotation

GitHub Actions / build

Replace `SolidTimeApi,·'createProjectMember'` with `⏎····SolidTimeApi,⏎····'createProjectMember'⏎`
export type UpdateProjectMemberBody = ZodiosBodyByAlias<SolidTimeApi, 'updateProjectMember'>;

Check warning on line 15 in resources/js/packages/api/src/index.d.ts

View workflow job for this annotation

GitHub Actions / build

Replace `SolidTimeApi,·'updateProjectMember'` with `⏎····SolidTimeApi,⏎····'updateProjectMember'⏎`
export type ProjectMember = ProjectMemberResponse['data'][0];
export type CreateTaskBody = ZodiosBodyByAlias<SolidTimeApi, 'createTask'>;
export type CreateClientBody = ZodiosBodyByAlias<SolidTimeApi, 'createClient'>;
export type UpdateClientBody = ZodiosBodyByAlias<SolidTimeApi, 'updateClient'>;
export type TagIndexResponse = ZodiosResponseByAlias<SolidTimeApi, 'getTags'>;
export type Tag = TagIndexResponse['data'][0];
export type TaskIndexResponse = ZodiosResponseByAlias<SolidTimeApi, 'getTasks'>;
export type Task = TaskIndexResponse['data'][0];
export type UpdateTaskBody = ZodiosBodyByAlias<SolidTimeApi, 'updateTask'>;
export type ClientIndexResponse = ZodiosResponseByAlias<SolidTimeApi, 'getClients'>;
export type Client = ClientIndexResponse['data'][0];
export type MemberIndexResponse = ZodiosResponseByAlias<SolidTimeApi, 'getMembers'>;
export type Member = MemberIndexResponse['data'][0];
export type UpdateMemberBody = ZodiosBodyByAlias<SolidTimeApi, 'updateMember'>;
export type InviteMemberBody = ZodiosBodyByAlias<SolidTimeApi, 'invite'>;
export type MemberRole = InviteMemberBody['role'];
export type CreateTagBody = ZodiosBodyByAlias<SolidTimeApi, 'createTag'>;
export type ImportType = ZodiosResponseByAlias<SolidTimeApi, 'getImporters'>['data'][0];
export type ImportReport = ZodiosResponseByAlias<SolidTimeApi, 'importData'>;
export type ReportingResponse = ZodiosResponseByAlias<SolidTimeApi, 'getAggregatedTimeEntries'>;
export type AggregatedTimeEntries = ReportingResponse['data'];
export type GroupedDataEntries = ReportingResponse['data']['grouped_data'];
export type AggregatedTimeEntriesQueryParams = ZodiosQueryParamsByAlias<SolidTimeApi, 'getAggregatedTimeEntries'>;
export type OrganizationResponse = ZodiosResponseByAlias<SolidTimeApi, 'getOrganization'>;
export type Organization = ZodiosResponseByAlias<SolidTimeApi, 'getOrganization'>['data'];
export type UpdateOrganizationBody = ZodiosBodyByAlias<SolidTimeApi, 'updateOrganization'>;
export type MyMemberships = ZodiosResponseByAlias<SolidTimeApi, 'getMyMemberships'>['data'];
export type MyMembership = MyMemberships[0];
export declare const api: any;

Check failure on line 44 in resources/js/packages/api/src/index.d.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected any. Specify a different type
1 change: 1 addition & 0 deletions resources/js/packages/api/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"skipLibCheck": true,
"outDir": "./dist",
"rootDir": "./src",
"declaration": true
},
"include": [
"src/**/*.ts"
Expand Down
16 changes: 16 additions & 0 deletions resources/js/packages/api/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { resolve } from 'path'
import { defineConfig } from 'vite'
import dts from "vite-plugin-dts";

export default defineConfig({
plugins: [dts()],
build: {
lib: {
// Could also be a dictionary or array of multiple entry points
entry: resolve(__dirname, 'src/index.ts'),
name: 'SolidtimeApi',
// the proper extensions will be added
fileName: 'solidtime-api',
},
},
})
110 changes: 33 additions & 77 deletions resources/js/packages/ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions resources/js/packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@solidtime/ui",
"version": "0.0.5",
"version": "0.0.6",
"description": "Package containing the solidtime ui components",
"main": "./dist/solidtime-ui-lib.umd.cjs",
"module": "./dist/solidtime-ui-lib.js",
Expand All @@ -12,8 +12,14 @@
"types": "./dist/packages/ui/src/index.d.ts",
"exports": {
".": {
"import": "./dist/solidtime-ui-lib.js",
"require": "./dist/solidtime-ui-lib.umd.cjs"
"import": {
"types": "./dist/packages/ui/src/index.d.ts",
"default": "./dist/solidtime-ui-lib.js"
},
"require": {
"types": "./dist/packages/ui/src/index.d.ts",
"default": "./dist/solidtime-ui-lib.umd.cjs"
}
},
"./style.css": "./dist/style.css"
},
Expand Down
4 changes: 2 additions & 2 deletions resources/js/packages/ui/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import TextInput from './Input/TextInput.vue';
import InputLabel from './Input/InputLabel.vue';
import TimeTrackerRunningInDifferentOrganizationOverlay from './TimeTracker/TimeTrackerRunningInDifferentOrganizationOverlay.vue';
import TimeTrackerControls from './TimeTracker/TimeTrackerControls.vue';
import CardTitle from './TimeTracker/TimeTrackerControls.vue';
import SelectDropdown from './TimeTracker/TimeTrackerControls.vue';
import CardTitle from './CardTitle.vue';
import SelectDropdown from './Input/SelectDropdown.vue';
import Badge from './Badge.vue';
import Checkbox from './Input/Checkbox.vue';
import TimeEntryGroupedTable from './TimeEntry/TimeEntryGroupedTable.vue';
Expand Down

0 comments on commit 9b4e586

Please sign in to comment.