firstly 0.0.10 → 0.0.11

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # firstly
2
2
 
3
+ ## 0.0.11
4
+
5
+ ### Patch Changes
6
+
7
+ - [#56](https://github.com/jycouet/firstly/pull/56)
8
+ [`a1e8de0`](https://github.com/jycouet/firstly/commit/a1e8de0a8871b8f1aa6cd81ee20d24f6a3da4c3f)
9
+ Thanks [@jycouet](https://github.com/jycouet)! - export changeLog module and not changeLogs
10
+
3
11
  ## 0.0.10
4
12
 
5
13
  ### Patch Changes
package/esm/bin/cmd.js CHANGED
@@ -121,21 +121,11 @@ module.exports = {
121
121
  `import { FF_Role } from 'firstly'
122
122
  import { firstly } from 'firstly/api'
123
123
  import { auth } from 'firstly/auth'
124
+ import { changeLog } from 'firstly/changeLog'
124
125
  import { Log } from '@kitql/helpers'
125
126
 
126
127
  import { task } from './modules/task'
127
128
 
128
- //----------------------------------------
129
- // To switch to postgres (1/2)
130
- //----------------------------------------
131
- // import { createPostgresConnection } from 'remult/postgres'
132
- // import { DATABASE_URL } from '$env/static/private'
133
-
134
- //----------------------------------------
135
- // To enable OAuth via Github (1/2)
136
- //----------------------------------------
137
- // import { github } from 'firstly/auth/providers'
138
-
139
129
  /**
140
130
  * Your roles, use them in your app !
141
131
  */
@@ -150,7 +140,10 @@ export const log = new Log('${pkg.name}')
150
140
 
151
141
  export const api = firstly({
152
142
  //----------------------------------------
153
- // To switch to postgres (2/2)
143
+ // To switch to postgres
144
+ // NEEDS ON TOP OF THE FILE:
145
+ // import { createPostgresConnection } from 'remult/postgres'
146
+ // import { DATABASE_URL } from '$env/static/private'
154
147
  //----------------------------------------
155
148
  // dataProvider: await createPostgresConnection({
156
149
  // connectionString: DATABASE_URL,
@@ -174,8 +167,10 @@ export const api = firstly({
174
167
 
175
168
  oAuths: [
176
169
  //----------------------------------------
177
- // To enable OAuth via Github (2/2)
170
+ // To enable OAuth via Github
178
171
  // Instructions by hovering the method \`github\`
172
+ // NEEDS ON TOP OF THE FILE:
173
+ // import { github } from 'firstly/auth/providers'
179
174
  //----------------------------------------
180
175
  // github(),
181
176
  ],
@@ -200,10 +195,9 @@ export const api = firstly({
200
195
  },
201
196
 
202
197
  //----------------------------------------
203
- // enabling changeLog in general.
204
- // To enable it, replace @Entity by @FF_Entity in your entities
198
+ // Replace @Entity by @FF_Entity in your entities to enable changeLog on this entity
205
199
  //----------------------------------------
206
- // changeLog(),
200
+ changeLog(),
207
201
  ],
208
202
  })
209
203
  `,
@@ -91,7 +91,7 @@ const disableButton = (issueNumber2, title2, content2) => {
91
91
  <span class="badge badge-warning">En attente de réponse de TA part 😉, oui 🫵!</span>
92
92
  {/if}
93
93
  {#if issueNumber}
94
- <button on:click={update} class="divider"></button>
94
+ <button on:click={update} aria-label="Actualiser" class="divider"></button>
95
95
  {/if}
96
96
 
97
97
  {#if issue?.state === 'CLOSED'}
@@ -102,7 +102,9 @@ const disableButton = (issueNumber2, title2, content2) => {
102
102
  {#if issueNumber === null}
103
103
  <Field cell={cellBuildor(repo(FilterEntity), 'title')} bind:value={title} />
104
104
  {/if}
105
- <Textarea bind:value={content} placeholder="Un peu de détail c'est pas mal... Fais toi Plaiz'"
105
+ <Textarea
106
+ bind:value={content}
107
+ placeholder="Un peu de détail c'est pas mal... Fais toi Plaiz' (Tu as même le droit d'utiliser le format markdown!)"
106
108
  ></Textarea>
107
109
  <div class="flex justify-between">
108
110
  {#if issueNumber}
@@ -45,7 +45,7 @@ onMount(async () => {
45
45
  on:click={async () => {
46
46
  await dialog.show({
47
47
  component: DialogIssue,
48
- classes: { root: 'overflow-auto w-5/6 h-5/6' },
48
+ classes: { root: 'overflow-auto w-[80vh] h-[80vh]' },
49
49
  props: { issueNumber: null, milestoneId },
50
50
  detail: {
51
51
  caption: 'Nouveau Feedback',
@@ -64,10 +64,10 @@ onMount(async () => {
64
64
  on:click={async () => {
65
65
  await dialog.show({
66
66
  component: DialogIssue,
67
- classes: { root: 'overflow-auto w-5/6 h-5/6' },
67
+ classes: { root: 'overflow-auto w-[80vh] h-[80vh]' },
68
68
  props: { issueNumber: issue.number, milestoneId },
69
69
  detail: {
70
- caption: issue.titleHTML,
70
+ caption: '#' + issue.number + ' - ' + issue.titleHTML,
71
71
  icon: { data: issue.state === 'OPEN' ? LibIcon_Search : LibIcon_Check },
72
72
  },
73
73
  })
@@ -77,6 +77,9 @@ onMount(async () => {
77
77
  >
78
78
  <div class="flex w-full justify-center justify-items-center text-left">
79
79
  <div class="flex-grow">
80
+ <span class="text-base-content/60 mr-2 inline-block w-8 text-right text-xs italic"
81
+ >#{issue.number}</span
82
+ >
80
83
  {@html issue.titleHTML}
81
84
  </div>
82
85
  {#if issue.highlight}
@@ -90,7 +93,13 @@ onMount(async () => {
90
93
  <Loading class="h-12"></Loading>
91
94
  <Loading class="h-12"></Loading>
92
95
  {:else}
93
- <p>Nothing here</p>
96
+ <div class="flex flex-col items-center justify-center p-8 text-center text-gray-500">
97
+ <div class="mb-4">
98
+ <Icon data={LibIcon_Search} size="4rem"></Icon>
99
+ </div>
100
+ <p class="text-lg font-medium">Aucun feedback <b>{issueState}</b> pour le moment</p>
101
+ <p class="mt-2 text-sm">Soyez le premier à donner votre avis sur cette version !</p>
102
+ </div>
94
103
  {/if}
95
104
  {/each}
96
105
  </div>
@@ -18,7 +18,7 @@ onMount(async () => {
18
18
  on:click={() =>
19
19
  dialog.show({
20
20
  component: DialogIssues,
21
- classes: { root: 'overflow-auto w-5/6 h-5/6' },
21
+ classes: { root: 'overflow-auto w-[85vh] h-[85vh]' },
22
22
  props: { milestoneNumber: milestone.number, milestoneId: milestone.id },
23
23
  detail: { caption: milestone.title },
24
24
  })}
@@ -3,10 +3,12 @@ import DialogMilestones from "./DialogMilestones.svelte";
3
3
  const list = async () => {
4
4
  await dialog.show({
5
5
  component: DialogMilestones,
6
- classes: { root: "overflow-auto w-5/6 h-5/6" },
6
+ classes: { root: "overflow-auto w-[90vh] h-[90vh]" },
7
7
  detail: { caption: "Feedback" }
8
8
  });
9
9
  };
10
10
  </script>
11
11
 
12
12
  <button class="text-secondary" on:click={list}>Feedback</button>
13
+
14
+ <!-- <span class="h-9/12 hidden w-9/12"></span> -->
package/esm/helper.d.ts CHANGED
@@ -35,7 +35,6 @@ export declare const getFieldMetaType: (field?: FieldMetadata) => FieldMetaType;
35
35
  export declare const displayWithDefaultAndSuffix: (field: FieldMetadata<any, any> | undefined, value: any) => string;
36
36
  export declare const getEnum: <T extends BaseEnum>(baseEnum: ClassType<T>, id: string | undefined | null) => T | undefined;
37
37
  export declare const getEnums: <T extends BaseEnum>(baseEnum: ClassType<T>) => T[];
38
- export declare const upsert: <Entity>(currentRepo: Repository<Entity>, id: Parameters<typeof currentRepo.findId>[0], entity: Partial<Entity>) => Promise<void>;
39
38
  /**
40
39
  * To be used like:
41
40
  * ```ts
package/esm/helper.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { getEntityRef, getValueList } from 'remult';
2
2
  import { getRelationFieldInfo } from 'remult/internals';
3
- import { stryEq } from '@kitql/helpers';
4
3
  import { suffixWithS } from './formats/strings.js';
5
4
  export function isError(object) {
6
5
  return object;
@@ -119,19 +118,6 @@ export const getEnum = (baseEnum, id) => {
119
118
  export const getEnums = (baseEnum) => {
120
119
  return getValueList(baseEnum) || [];
121
120
  };
122
- export const upsert = async (currentRepo, id, entity) => {
123
- const found = await currentRepo.findId(id);
124
- if (found) {
125
- // @ts-ignore
126
- if (!stryEq(found, entity)) {
127
- // Opti => Sedn only the diff?
128
- await currentRepo.update(id, entity);
129
- }
130
- }
131
- else {
132
- await currentRepo.insert(entity);
133
- }
134
- };
135
121
  /**
136
122
  * To be used like:
137
123
  * ```ts
package/esm/index.d.ts CHANGED
@@ -43,7 +43,7 @@ export { FF_Entity } from './FF_Entity.js';
43
43
  export { FF_LogToConsole } from './SqlDatabase/FF_LogToConsole.js';
44
44
  export { BaseEnum } from './BaseEnum.js';
45
45
  export { dialog } from './ui/dialog/dialog.js';
46
- export { getEntityDisplayValue, isError, getFieldLinkDisplayValue, getEnum, getEnums, upsert, onDelete, } from './helper.js';
46
+ export { getEntityDisplayValue, isError, getFieldLinkDisplayValue, getEnum, getEnums, onDelete, } from './helper.js';
47
47
  export { buildWhere, getPlaceholder, buildSearchWhere, cellsBuildor, cellBuildor, fieldsOf, containsWords, } from './cellsBuildor.js';
48
48
  export { storeItem };
49
49
  export { storeList };
package/esm/index.js CHANGED
@@ -36,7 +36,7 @@ export { FF_Entity } from './FF_Entity.js';
36
36
  export { FF_LogToConsole } from './SqlDatabase/FF_LogToConsole.js';
37
37
  export { BaseEnum } from './BaseEnum.js';
38
38
  export { dialog } from './ui/dialog/dialog.js';
39
- export { getEntityDisplayValue, isError, getFieldLinkDisplayValue, getEnum, getEnums, upsert, onDelete, } from './helper.js';
39
+ export { getEntityDisplayValue, isError, getFieldLinkDisplayValue, getEnum, getEnums, onDelete, } from './helper.js';
40
40
  export { buildWhere, getPlaceholder, buildSearchWhere, cellsBuildor, cellBuildor, fieldsOf, containsWords, } from './cellsBuildor.js';
41
41
  export { storeItem };
42
42
  export { storeList };
@@ -81,7 +81,7 @@ const {
81
81
  transition:fade={{ duration: 100 }}
82
82
  class="bg-base-300 z-30 rounded-lg ring-1 ring-black"
83
83
  >
84
- <div {...$arrow} use:arrow />
84
+ <div {...$arrow} use:arrow></div>
85
85
  <div class="px-4 py-1">
86
86
  {#if $$slots.tooltip}
87
87
  <slot name="tooltip" />
@@ -138,7 +138,7 @@ const calcSuffix = (value2) => {
138
138
  label={cell?.header ?? cell.field?.caption ?? cell.field?.key}
139
139
  required={!cell.field?.allowNull && mode === 'edit' && metaType.subKind !== 'checkbox'}
140
140
  {error}
141
- classes={{ slot: metaType.subKind === 'textarea' ? 'h-32 items-start' : '' }}
141
+ classes={{ slot: metaType.subKind === 'textarea' ? 'h-24 items-start' : '' }}
142
142
  >
143
143
  {@const clearableComputed =
144
144
  cell.clearable || clearable || (mode === 'filtre' && clearable === undefined)}
@@ -30,7 +30,7 @@ const {
30
30
  transition:fade={{ duration: 100 }}
31
31
  class="bg-base-300 z-30 rounded-lg ring-1 ring-black"
32
32
  >
33
- <div {...$arrow} use:arrow />
33
+ <div {...$arrow} use:arrow></div>
34
34
  <div class="px-4 py-1">
35
35
  {#if $$slots.tooltip}
36
36
  <slot name="tooltip" />
@@ -37,7 +37,7 @@ function dispatchChange(_data) {
37
37
  use:$overlay.action
38
38
  class="bg-base-300/80 fixed inset-0 z-40 blur-sm"
39
39
  transition:fade={{ duration: 150 }}
40
- />
40
+ ></div>
41
41
  <div
42
42
  class={tw(
43
43
  `border-base-content/60 bg-base-100 relative z-40 max-h-[90vh] overflow-auto rounded-xl border p-6 shadow-lg`,
@@ -33,7 +33,9 @@ const handleInput = (e) => {
33
33
  const target = e.target;
34
34
  if ($$restProps.type === "number") {
35
35
  if (e.data === "." || e.data === ",") {
36
- e.preventDefault();
36
+ value = target.value.toString().replaceAll(",", ".");
37
+ } else if (target.value === "") {
38
+ value = null;
37
39
  } else {
38
40
  value = target.value.toString().replaceAll(",", ".");
39
41
  }
@@ -2,7 +2,7 @@
2
2
  import { scrollbar } from "../../theme";
3
3
  export let name = null;
4
4
  export let id = "";
5
- export let rows = 6;
5
+ export let rows = 4;
6
6
  export let placeholder = "";
7
7
  export let focus = false;
8
8
  export let value = "";
@@ -57,5 +57,5 @@ function dispatchInput(value2) {
57
57
  // @ts-ignore
58
58
  dispatchInput(e.target.value)
59
59
  }}
60
- />
60
+ ></textarea>
61
61
  {/if}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firstly",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "type": "module",
5
5
  "description": "Firstly, an opinionated Remult setup!",
6
6
  "repository": {
@@ -14,19 +14,19 @@
14
14
  },
15
15
  "peerDependencies": {
16
16
  "@sveltejs/kit": ">=1.0.0 <3.0.0",
17
- "remult": "0.27.20",
17
+ "remult": "2.7.27",
18
18
  "svelte": ">=4.2.18"
19
19
  },
20
20
  "dependencies": {
21
21
  "@clack/prompts": "^0.7.0",
22
22
  "@kitql/internals": "0.9.9",
23
23
  "@mdi/js": "^7.4.47",
24
- "@melt-ui/svelte": "^0.83.0",
24
+ "@melt-ui/svelte": "^0.84.0",
25
25
  "@types/nodemailer": "^6.4.15",
26
26
  "arctic": "^1.8.0",
27
27
  "clsx": "^2.1.1",
28
28
  "cron": "^3.1.7",
29
- "daisyui": "^4.12.10",
29
+ "daisyui": "^4.12.14",
30
30
  "esm-env": "^1.0.0",
31
31
  "lucia": "^3.2.0",
32
32
  "nodemailer": "^6.9.13",
@@ -81,9 +81,9 @@
81
81
  "types": "./esm/feedback/index.d.ts",
82
82
  "default": "./esm/feedback/index.js"
83
83
  },
84
- "./changeLogs": {
85
- "types": "./esm/changeLogs/index.d.ts",
86
- "default": "./esm/changeLogs/index.js"
84
+ "./changeLog": {
85
+ "types": "./esm/changeLog/index.d.ts",
86
+ "default": "./esm/changeLog/index.js"
87
87
  },
88
88
  "./mail": {
89
89
  "types": "./esm/mail/index.d.ts",