@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.
- package/.editorconfig +12 -0
- package/cli.d.ts +1 -0
- package/cli.js +2 -0
- package/dist/cjs/cli/commands/build.d.ts +11 -0
- package/dist/cjs/cli/commands/build.d.ts.map +1 -0
- package/dist/cjs/cli/commands/build.js +181 -0
- package/dist/cjs/cli/commands/create.d.ts +6 -0
- package/dist/cjs/cli/commands/create.d.ts.map +1 -0
- package/dist/cjs/cli/commands/create.js +96 -0
- package/dist/cjs/cli/index.d.ts +4 -0
- package/dist/cjs/cli/index.d.ts.map +1 -0
- package/dist/cjs/cli/index.js +10 -0
- package/dist/cjs/cli/run.d.ts +2 -0
- package/dist/cjs/cli/run.d.ts.map +1 -0
- package/dist/cjs/cli/run.js +29 -0
- package/dist/cjs/cli/types.d.ts +4 -0
- package/dist/cjs/cli/types.d.ts.map +1 -0
- package/dist/cjs/cli/types.js +2 -0
- package/dist/cjs/cli/utils/get-package-version.d.ts +2 -0
- package/dist/cjs/cli/utils/get-package-version.d.ts.map +1 -0
- package/dist/cjs/cli/utils/get-package-version.js +12 -0
- package/dist/cjs/cli/utils/languages.d.ts +5 -0
- package/dist/cjs/cli/utils/languages.d.ts.map +1 -0
- package/dist/cjs/cli/utils/languages.js +30 -0
- package/dist/cjs/cli/utils/load-config.d.ts +2 -0
- package/dist/cjs/cli/utils/load-config.d.ts.map +1 -0
- package/dist/cjs/cli/utils/load-config.js +20 -0
- package/dist/cjs/cli/utils/logger.d.ts +2 -0
- package/dist/cjs/cli/utils/logger.d.ts.map +1 -0
- package/dist/cjs/cli/utils/logger.js +22 -0
- package/dist/cjs/cli/utils/rename-map.d.ts +2 -0
- package/dist/cjs/cli/utils/rename-map.d.ts.map +1 -0
- package/dist/cjs/cli/utils/rename-map.js +23 -0
- package/dist/cjs/index.d.ts +3 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +19 -0
- package/dist/esm/cli/commands/build.d.ts +11 -0
- package/dist/esm/cli/commands/build.d.ts.map +1 -0
- package/dist/esm/cli/commands/build.js +175 -0
- package/dist/esm/cli/commands/create.d.ts +6 -0
- package/dist/esm/cli/commands/create.d.ts.map +1 -0
- package/dist/esm/cli/commands/create.js +90 -0
- package/dist/esm/cli/index.d.ts +4 -0
- package/dist/esm/cli/index.d.ts.map +1 -0
- package/dist/esm/cli/index.js +3 -0
- package/dist/esm/cli/run.d.ts +2 -0
- package/dist/esm/cli/run.d.ts.map +1 -0
- package/dist/esm/cli/run.js +24 -0
- package/dist/esm/cli/types.d.ts +4 -0
- package/dist/esm/cli/types.d.ts.map +1 -0
- package/dist/esm/cli/types.js +1 -0
- package/dist/esm/cli/utils/get-package-version.d.ts +2 -0
- package/dist/esm/cli/utils/get-package-version.d.ts.map +1 -0
- package/dist/esm/cli/utils/get-package-version.js +6 -0
- package/dist/esm/cli/utils/languages.d.ts +5 -0
- package/dist/esm/cli/utils/languages.d.ts.map +1 -0
- package/dist/esm/cli/utils/languages.js +24 -0
- package/dist/esm/cli/utils/load-config.d.ts +2 -0
- package/dist/esm/cli/utils/load-config.d.ts.map +1 -0
- package/dist/esm/cli/utils/load-config.js +14 -0
- package/dist/esm/cli/utils/logger.d.ts +2 -0
- package/dist/esm/cli/utils/logger.d.ts.map +1 -0
- package/dist/esm/cli/utils/logger.js +16 -0
- package/dist/esm/cli/utils/rename-map.d.ts +2 -0
- package/dist/esm/cli/utils/rename-map.d.ts.map +1 -0
- package/dist/esm/cli/utils/rename-map.js +17 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +2 -0
- package/license +674 -0
- package/package.json +56 -0
- package/readme.md +3 -0
- package/src/cli/commands/build.ts +211 -0
- package/src/cli/commands/create.ts +121 -0
- package/src/cli/index.ts +4 -0
- package/src/cli/run.ts +30 -0
- package/src/cli/types.ts +4 -0
- package/src/cli/utils/get-package-version.ts +9 -0
- package/src/cli/utils/languages.ts +26 -0
- package/src/cli/utils/load-config.ts +19 -0
- package/src/cli/utils/logger.ts +15 -0
- package/src/cli/utils/rename-map.ts +20 -0
- package/src/index.ts +11 -0
- package/templates/common/javascript/_gitignore +3 -0
- package/templates/common/typescript/_gitignore +3 -0
- package/templates/common/typescript/tsconfig.json +28 -0
- package/templates/display/javascript/src/display.vue +14 -0
- package/templates/display/javascript/src/index.js +11 -0
- package/templates/display/typescript/src/display.vue +16 -0
- package/templates/display/typescript/src/index.ts +12 -0
- package/templates/display/typescript/src/shims.d.ts +5 -0
- package/templates/endpoint/javascript/src/index.js +3 -0
- package/templates/endpoint/typescript/src/index.ts +5 -0
- package/templates/hook/javascript/src/index.js +5 -0
- package/templates/hook/typescript/src/index.ts +7 -0
- package/templates/interface/javascript/src/index.js +11 -0
- package/templates/interface/javascript/src/interface.vue +22 -0
- package/templates/interface/typescript/src/index.ts +12 -0
- package/templates/interface/typescript/src/interface.vue +24 -0
- package/templates/interface/typescript/src/shims.d.ts +5 -0
- package/templates/layout/javascript/src/index.js +19 -0
- package/templates/layout/javascript/src/layout.vue +22 -0
- package/templates/layout/typescript/src/index.ts +20 -0
- package/templates/layout/typescript/src/layout.vue +24 -0
- package/templates/layout/typescript/src/shims.d.ts +5 -0
- package/templates/module/javascript/src/index.js +13 -0
- package/templates/module/javascript/src/module.vue +7 -0
- package/templates/module/typescript/src/index.ts +14 -0
- package/templates/module/typescript/src/module.vue +9 -0
- package/templates/module/typescript/src/shims.d.ts +5 -0
- package/tsconfig.json +30 -0
|
@@ -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,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,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
|
+
});
|
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
|
+
}
|