@directus/extensions-sdk 9.0.0-rc.100

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.
Files changed (111) hide show
  1. package/.editorconfig +12 -0
  2. package/cli.d.ts +1 -0
  3. package/cli.js +2 -0
  4. package/dist/cjs/cli/commands/build.d.ts +11 -0
  5. package/dist/cjs/cli/commands/build.d.ts.map +1 -0
  6. package/dist/cjs/cli/commands/build.js +181 -0
  7. package/dist/cjs/cli/commands/create.d.ts +6 -0
  8. package/dist/cjs/cli/commands/create.d.ts.map +1 -0
  9. package/dist/cjs/cli/commands/create.js +96 -0
  10. package/dist/cjs/cli/index.d.ts +4 -0
  11. package/dist/cjs/cli/index.d.ts.map +1 -0
  12. package/dist/cjs/cli/index.js +10 -0
  13. package/dist/cjs/cli/run.d.ts +2 -0
  14. package/dist/cjs/cli/run.d.ts.map +1 -0
  15. package/dist/cjs/cli/run.js +29 -0
  16. package/dist/cjs/cli/types.d.ts +4 -0
  17. package/dist/cjs/cli/types.d.ts.map +1 -0
  18. package/dist/cjs/cli/types.js +2 -0
  19. package/dist/cjs/cli/utils/get-package-version.d.ts +2 -0
  20. package/dist/cjs/cli/utils/get-package-version.d.ts.map +1 -0
  21. package/dist/cjs/cli/utils/get-package-version.js +12 -0
  22. package/dist/cjs/cli/utils/languages.d.ts +5 -0
  23. package/dist/cjs/cli/utils/languages.d.ts.map +1 -0
  24. package/dist/cjs/cli/utils/languages.js +30 -0
  25. package/dist/cjs/cli/utils/load-config.d.ts +2 -0
  26. package/dist/cjs/cli/utils/load-config.d.ts.map +1 -0
  27. package/dist/cjs/cli/utils/load-config.js +20 -0
  28. package/dist/cjs/cli/utils/logger.d.ts +2 -0
  29. package/dist/cjs/cli/utils/logger.d.ts.map +1 -0
  30. package/dist/cjs/cli/utils/logger.js +22 -0
  31. package/dist/cjs/cli/utils/rename-map.d.ts +2 -0
  32. package/dist/cjs/cli/utils/rename-map.d.ts.map +1 -0
  33. package/dist/cjs/cli/utils/rename-map.js +23 -0
  34. package/dist/cjs/index.d.ts +3 -0
  35. package/dist/cjs/index.d.ts.map +1 -0
  36. package/dist/cjs/index.js +19 -0
  37. package/dist/esm/cli/commands/build.d.ts +11 -0
  38. package/dist/esm/cli/commands/build.d.ts.map +1 -0
  39. package/dist/esm/cli/commands/build.js +175 -0
  40. package/dist/esm/cli/commands/create.d.ts +6 -0
  41. package/dist/esm/cli/commands/create.d.ts.map +1 -0
  42. package/dist/esm/cli/commands/create.js +90 -0
  43. package/dist/esm/cli/index.d.ts +4 -0
  44. package/dist/esm/cli/index.d.ts.map +1 -0
  45. package/dist/esm/cli/index.js +3 -0
  46. package/dist/esm/cli/run.d.ts +2 -0
  47. package/dist/esm/cli/run.d.ts.map +1 -0
  48. package/dist/esm/cli/run.js +24 -0
  49. package/dist/esm/cli/types.d.ts +4 -0
  50. package/dist/esm/cli/types.d.ts.map +1 -0
  51. package/dist/esm/cli/types.js +1 -0
  52. package/dist/esm/cli/utils/get-package-version.d.ts +2 -0
  53. package/dist/esm/cli/utils/get-package-version.d.ts.map +1 -0
  54. package/dist/esm/cli/utils/get-package-version.js +6 -0
  55. package/dist/esm/cli/utils/languages.d.ts +5 -0
  56. package/dist/esm/cli/utils/languages.d.ts.map +1 -0
  57. package/dist/esm/cli/utils/languages.js +24 -0
  58. package/dist/esm/cli/utils/load-config.d.ts +2 -0
  59. package/dist/esm/cli/utils/load-config.d.ts.map +1 -0
  60. package/dist/esm/cli/utils/load-config.js +14 -0
  61. package/dist/esm/cli/utils/logger.d.ts +2 -0
  62. package/dist/esm/cli/utils/logger.d.ts.map +1 -0
  63. package/dist/esm/cli/utils/logger.js +16 -0
  64. package/dist/esm/cli/utils/rename-map.d.ts +2 -0
  65. package/dist/esm/cli/utils/rename-map.d.ts.map +1 -0
  66. package/dist/esm/cli/utils/rename-map.js +17 -0
  67. package/dist/esm/index.d.ts +3 -0
  68. package/dist/esm/index.d.ts.map +1 -0
  69. package/dist/esm/index.js +2 -0
  70. package/license +674 -0
  71. package/package.json +56 -0
  72. package/readme.md +3 -0
  73. package/src/cli/commands/build.ts +211 -0
  74. package/src/cli/commands/create.ts +121 -0
  75. package/src/cli/index.ts +4 -0
  76. package/src/cli/run.ts +30 -0
  77. package/src/cli/types.ts +4 -0
  78. package/src/cli/utils/get-package-version.ts +9 -0
  79. package/src/cli/utils/languages.ts +26 -0
  80. package/src/cli/utils/load-config.ts +19 -0
  81. package/src/cli/utils/logger.ts +15 -0
  82. package/src/cli/utils/rename-map.ts +20 -0
  83. package/src/index.ts +11 -0
  84. package/templates/common/javascript/_gitignore +3 -0
  85. package/templates/common/typescript/_gitignore +3 -0
  86. package/templates/common/typescript/tsconfig.json +28 -0
  87. package/templates/display/javascript/src/display.vue +14 -0
  88. package/templates/display/javascript/src/index.js +11 -0
  89. package/templates/display/typescript/src/display.vue +16 -0
  90. package/templates/display/typescript/src/index.ts +12 -0
  91. package/templates/display/typescript/src/shims.d.ts +5 -0
  92. package/templates/endpoint/javascript/src/index.js +3 -0
  93. package/templates/endpoint/typescript/src/index.ts +5 -0
  94. package/templates/hook/javascript/src/index.js +5 -0
  95. package/templates/hook/typescript/src/index.ts +7 -0
  96. package/templates/interface/javascript/src/index.js +11 -0
  97. package/templates/interface/javascript/src/interface.vue +22 -0
  98. package/templates/interface/typescript/src/index.ts +12 -0
  99. package/templates/interface/typescript/src/interface.vue +24 -0
  100. package/templates/interface/typescript/src/shims.d.ts +5 -0
  101. package/templates/layout/javascript/src/index.js +19 -0
  102. package/templates/layout/javascript/src/layout.vue +22 -0
  103. package/templates/layout/typescript/src/index.ts +20 -0
  104. package/templates/layout/typescript/src/layout.vue +24 -0
  105. package/templates/layout/typescript/src/shims.d.ts +5 -0
  106. package/templates/module/javascript/src/index.js +13 -0
  107. package/templates/module/javascript/src/module.vue +7 -0
  108. package/templates/module/typescript/src/index.ts +14 -0
  109. package/templates/module/typescript/src/module.vue +9 -0
  110. package/templates/module/typescript/src/shims.d.ts +5 -0
  111. package/tsconfig.json +30 -0
@@ -0,0 +1,11 @@
1
+ import InterfaceComponent from './interface.vue';
2
+
3
+ export default {
4
+ id: 'custom',
5
+ name: 'Custom',
6
+ icon: 'box',
7
+ description: 'This is my custom interface!',
8
+ component: InterfaceComponent,
9
+ options: null,
10
+ types: ['string'],
11
+ };
@@ -0,0 +1,22 @@
1
+ <template>
2
+ <input :value="value" @input="handleChange($event.target.value)" />
3
+ </template>
4
+
5
+ <script>
6
+ export default {
7
+ props: {
8
+ value: {
9
+ type: String,
10
+ default: null,
11
+ },
12
+ },
13
+ emits: ['input'],
14
+ setup(props, { emit }) {
15
+ return { handleChange };
16
+
17
+ function handleChange(value) {
18
+ emit('input', value);
19
+ }
20
+ },
21
+ };
22
+ </script>
@@ -0,0 +1,12 @@
1
+ import { defineInterface } from '@directus/extensions-sdk';
2
+ import InterfaceComponent from './interface.vue';
3
+
4
+ export default defineInterface({
5
+ id: 'custom',
6
+ name: 'Custom',
7
+ icon: 'box',
8
+ description: 'This is my custom interface!',
9
+ component: InterfaceComponent,
10
+ options: null,
11
+ types: ['string'],
12
+ });
@@ -0,0 +1,24 @@
1
+ <template>
2
+ <input :value="value" @input="handleChange($event.target.value)" />
3
+ </template>
4
+
5
+ <script lang="ts">
6
+ import { defineComponent } from 'vue';
7
+
8
+ export default defineComponent({
9
+ props: {
10
+ value: {
11
+ type: String,
12
+ default: null,
13
+ },
14
+ },
15
+ emits: ['input'],
16
+ setup(props, { emit }) {
17
+ return { handleChange };
18
+
19
+ function handleChange(value: string): void {
20
+ emit('input', value);
21
+ }
22
+ },
23
+ });
24
+ </script>
@@ -0,0 +1,5 @@
1
+ declare module '*.vue' {
2
+ import { DefineComponent } from 'vue';
3
+ const component: DefineComponent<{}, {}, any>;
4
+ export default component;
5
+ }
@@ -0,0 +1,19 @@
1
+ import { ref } from 'vue';
2
+ import LayoutComponent from './layout.vue';
3
+
4
+ export default {
5
+ id: 'custom',
6
+ name: 'Custom',
7
+ icon: 'box',
8
+ component: LayoutComponent,
9
+ slots: {
10
+ options: () => null,
11
+ sidebar: () => null,
12
+ actions: () => null,
13
+ },
14
+ setup() {
15
+ const name = ref('Custom Layout');
16
+
17
+ return { name };
18
+ },
19
+ };
@@ -0,0 +1,22 @@
1
+ <template>
2
+ <div>
3
+ <p>Name: {{ name }}</p>
4
+ <p>Collection: {{ collection }}</p>
5
+ </div>
6
+ </template>
7
+
8
+ <script>
9
+ export default {
10
+ inheritAttrs: false,
11
+ props: {
12
+ collection: {
13
+ type: String,
14
+ required: true,
15
+ },
16
+ name: {
17
+ type: String,
18
+ required: true,
19
+ },
20
+ },
21
+ };
22
+ </script>
@@ -0,0 +1,20 @@
1
+ import { ref } from 'vue';
2
+ import { defineLayout } from '@directus/extensions-sdk';
3
+ import LayoutComponent from './layout.vue';
4
+
5
+ export default defineLayout({
6
+ id: 'custom',
7
+ name: 'Custom',
8
+ icon: 'box',
9
+ component: LayoutComponent,
10
+ slots: {
11
+ options: () => null,
12
+ sidebar: () => null,
13
+ actions: () => null,
14
+ },
15
+ setup() {
16
+ const name = ref('Custom Layout');
17
+
18
+ return { name };
19
+ },
20
+ });
@@ -0,0 +1,24 @@
1
+ <template>
2
+ <div>
3
+ <p>Name: {{ name }}</p>
4
+ <p>Collection: {{ collection }}</p>
5
+ </div>
6
+ </template>
7
+
8
+ <script lang="ts">
9
+ import { defineComponent } from 'vue';
10
+
11
+ export default defineComponent({
12
+ inheritAttrs: false,
13
+ props: {
14
+ collection: {
15
+ type: String,
16
+ required: true,
17
+ },
18
+ name: {
19
+ type: String,
20
+ required: true,
21
+ },
22
+ },
23
+ });
24
+ </script>
@@ -0,0 +1,5 @@
1
+ declare module '*.vue' {
2
+ import { DefineComponent } from 'vue';
3
+ const component: DefineComponent<{}, {}, any>;
4
+ export default component;
5
+ }
@@ -0,0 +1,13 @@
1
+ import ModuleComponent from './module.vue';
2
+
3
+ export default {
4
+ id: 'custom',
5
+ name: 'Custom',
6
+ icon: 'box',
7
+ routes: [
8
+ {
9
+ path: '',
10
+ component: ModuleComponent,
11
+ },
12
+ ],
13
+ };
@@ -0,0 +1,7 @@
1
+ <template>
2
+ <private-view title="My Custom Module">Content goes here...</private-view>
3
+ </template>
4
+
5
+ <script>
6
+ export default {};
7
+ </script>
@@ -0,0 +1,14 @@
1
+ import { defineModule } from '@directus/extensions-sdk';
2
+ import ModuleComponent from './module.vue';
3
+
4
+ export default defineModule({
5
+ id: 'custom',
6
+ name: 'Custom',
7
+ icon: 'box',
8
+ routes: [
9
+ {
10
+ path: '',
11
+ component: ModuleComponent,
12
+ },
13
+ ],
14
+ });
@@ -0,0 +1,9 @@
1
+ <template>
2
+ <private-view title="My Custom Module">Content goes here...</private-view>
3
+ </template>
4
+
5
+ <script lang="ts">
6
+ import { defineComponent } from 'vue';
7
+
8
+ export default defineComponent({});
9
+ </script>
@@ -0,0 +1,5 @@
1
+ declare module '*.vue' {
2
+ import { DefineComponent } from 'vue';
3
+ const component: DefineComponent<{}, {}, any>;
4
+ export default component;
5
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2019",
4
+ "lib": ["ES2019"],
5
+ "moduleResolution": "node",
6
+ "declaration": true,
7
+ "declarationMap": true,
8
+ "strict": true,
9
+ "noFallthroughCasesInSwitch": true,
10
+ "esModuleInterop": true,
11
+ "noImplicitAny": true,
12
+ "noImplicitThis": true,
13
+ "noImplicitReturns": true,
14
+ "noUnusedLocals": true,
15
+ "noUncheckedIndexedAccess": true,
16
+ "noUnusedParameters": true,
17
+ "alwaysStrict": true,
18
+ "strictNullChecks": true,
19
+ "strictFunctionTypes": true,
20
+ "strictBindCallApply": true,
21
+ "strictPropertyInitialization": true,
22
+ "resolveJsonModule": false,
23
+ "skipLibCheck": true,
24
+ "forceConsistentCasingInFileNames": true,
25
+ "allowSyntheticDefaultImports": true,
26
+ "isolatedModules": true,
27
+ "rootDir": "./src",
28
+ },
29
+ "include": ["./src/**/*.ts"]
30
+ }