@directus/extensions-sdk 9.4.1 → 9.5.1
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/dist/cjs/cli/commands/build.d.ts +2 -1
- package/dist/cjs/cli/commands/build.d.ts.map +1 -1
- package/dist/cjs/cli/commands/build.js +8 -5
- package/dist/cjs/cli/run.js +2 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +3 -1
- package/dist/esm/cli/commands/build.d.ts +2 -1
- package/dist/esm/cli/commands/build.d.ts.map +1 -1
- package/dist/esm/cli/commands/build.js +8 -5
- package/dist/esm/cli/run.js +2 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -1
- package/package.json +3 -3
- package/src/cli/commands/build.ts +10 -6
- package/src/cli/run.ts +2 -1
- package/src/index.ts +10 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/build.ts"],"names":[],"mappings":"AA4BA,aAAK,YAAY,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/build.ts"],"names":[],"mappings":"AA4BA,aAAK,YAAY,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,wBAA8B,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA6FxE"}
|
|
@@ -112,7 +112,7 @@ function getRollupOptions(type, language, input, plugins = [], options) {
|
|
|
112
112
|
(0, rollup_plugin_styles_1.default)(),
|
|
113
113
|
...plugins,
|
|
114
114
|
(0, plugin_node_resolve_1.nodeResolve)({ browser: true }),
|
|
115
|
-
(0, plugin_commonjs_1.default)({ esmExternals: true, sourceMap:
|
|
115
|
+
(0, plugin_commonjs_1.default)({ esmExternals: true, sourceMap: options.sourcemap }),
|
|
116
116
|
(0, plugin_json_1.default)(),
|
|
117
117
|
(0, plugin_replace_1.default)({
|
|
118
118
|
values: {
|
|
@@ -120,7 +120,7 @@ function getRollupOptions(type, language, input, plugins = [], options) {
|
|
|
120
120
|
},
|
|
121
121
|
preventAssignment: true,
|
|
122
122
|
}),
|
|
123
|
-
options.
|
|
123
|
+
options.minify ? (0, rollup_plugin_terser_1.terser)() : null,
|
|
124
124
|
],
|
|
125
125
|
};
|
|
126
126
|
}
|
|
@@ -132,7 +132,7 @@ function getRollupOptions(type, language, input, plugins = [], options) {
|
|
|
132
132
|
language === 'typescript' ? (0, rollup_plugin_typescript2_1.default)({ check: false }) : null,
|
|
133
133
|
...plugins,
|
|
134
134
|
(0, plugin_node_resolve_1.nodeResolve)(),
|
|
135
|
-
(0, plugin_commonjs_1.default)({ sourceMap:
|
|
135
|
+
(0, plugin_commonjs_1.default)({ sourceMap: options.sourcemap }),
|
|
136
136
|
(0, plugin_json_1.default)(),
|
|
137
137
|
(0, plugin_replace_1.default)({
|
|
138
138
|
values: {
|
|
@@ -140,7 +140,7 @@ function getRollupOptions(type, language, input, plugins = [], options) {
|
|
|
140
140
|
},
|
|
141
141
|
preventAssignment: true,
|
|
142
142
|
}),
|
|
143
|
-
options.
|
|
143
|
+
options.minify ? (0, rollup_plugin_terser_1.terser)() : null,
|
|
144
144
|
],
|
|
145
145
|
};
|
|
146
146
|
}
|
|
@@ -150,6 +150,8 @@ function getRollupOutputOptions(type, output, options) {
|
|
|
150
150
|
return {
|
|
151
151
|
file: output,
|
|
152
152
|
format: 'es',
|
|
153
|
+
inlineDynamicImports: true,
|
|
154
|
+
sourcemap: options.sourcemap,
|
|
153
155
|
};
|
|
154
156
|
}
|
|
155
157
|
else {
|
|
@@ -157,7 +159,8 @@ function getRollupOutputOptions(type, output, options) {
|
|
|
157
159
|
file: output,
|
|
158
160
|
format: 'cjs',
|
|
159
161
|
exports: 'default',
|
|
160
|
-
|
|
162
|
+
inlineDynamicImports: true,
|
|
163
|
+
sourcemap: options.sourcemap,
|
|
161
164
|
};
|
|
162
165
|
}
|
|
163
166
|
}
|
package/dist/cjs/cli/run.js
CHANGED
|
@@ -25,6 +25,7 @@ program
|
|
|
25
25
|
.option('-l, --language <language>', 'overwrite the language to use')
|
|
26
26
|
.option('-f, --force', 'ignore the package manifest')
|
|
27
27
|
.option('-w, --watch', 'watch and rebuild on changes')
|
|
28
|
-
.option('-
|
|
28
|
+
.option('--no-minify', 'disable minification')
|
|
29
|
+
.option('--sourcemap', 'include source maps in output')
|
|
29
30
|
.action(build_1.default);
|
|
30
31
|
program.parse(process.argv);
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { defineInterface, defineDisplay, defineLayout, defineModule, definePanel, defineHook, defineEndpoint, getFieldsFromTemplate, getRelationType, } from '@directus/shared/utils';
|
|
2
|
-
export { useStores, useApi, useSync, useCollection, useItems, useFilterFields } from '@directus/shared/composables';
|
|
2
|
+
export { useStores, useApi, useExtensions, useSync, useCollection, useItems, useLayout, useFilterFields, } from '@directus/shared/composables';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,eAAe,GACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,eAAe,GACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,SAAS,EACT,MAAM,EACN,aAAa,EACb,OAAO,EACP,aAAa,EACb,QAAQ,EACR,SAAS,EACT,eAAe,GACf,MAAM,8BAA8B,CAAC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useFilterFields = exports.useItems = exports.useCollection = exports.useSync = exports.useApi = exports.useStores = exports.getRelationType = exports.getFieldsFromTemplate = exports.defineEndpoint = exports.defineHook = exports.definePanel = exports.defineModule = exports.defineLayout = exports.defineDisplay = exports.defineInterface = void 0;
|
|
3
|
+
exports.useFilterFields = exports.useLayout = exports.useItems = exports.useCollection = exports.useSync = exports.useExtensions = exports.useApi = exports.useStores = exports.getRelationType = exports.getFieldsFromTemplate = exports.defineEndpoint = exports.defineHook = exports.definePanel = exports.defineModule = exports.defineLayout = exports.defineDisplay = exports.defineInterface = void 0;
|
|
4
4
|
var utils_1 = require("@directus/shared/utils");
|
|
5
5
|
Object.defineProperty(exports, "defineInterface", { enumerable: true, get: function () { return utils_1.defineInterface; } });
|
|
6
6
|
Object.defineProperty(exports, "defineDisplay", { enumerable: true, get: function () { return utils_1.defineDisplay; } });
|
|
@@ -14,7 +14,9 @@ Object.defineProperty(exports, "getRelationType", { enumerable: true, get: funct
|
|
|
14
14
|
var composables_1 = require("@directus/shared/composables");
|
|
15
15
|
Object.defineProperty(exports, "useStores", { enumerable: true, get: function () { return composables_1.useStores; } });
|
|
16
16
|
Object.defineProperty(exports, "useApi", { enumerable: true, get: function () { return composables_1.useApi; } });
|
|
17
|
+
Object.defineProperty(exports, "useExtensions", { enumerable: true, get: function () { return composables_1.useExtensions; } });
|
|
17
18
|
Object.defineProperty(exports, "useSync", { enumerable: true, get: function () { return composables_1.useSync; } });
|
|
18
19
|
Object.defineProperty(exports, "useCollection", { enumerable: true, get: function () { return composables_1.useCollection; } });
|
|
19
20
|
Object.defineProperty(exports, "useItems", { enumerable: true, get: function () { return composables_1.useItems; } });
|
|
21
|
+
Object.defineProperty(exports, "useLayout", { enumerable: true, get: function () { return composables_1.useLayout; } });
|
|
20
22
|
Object.defineProperty(exports, "useFilterFields", { enumerable: true, get: function () { return composables_1.useFilterFields; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/build.ts"],"names":[],"mappings":"AA4BA,aAAK,YAAY,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/build.ts"],"names":[],"mappings":"AA4BA,aAAK,YAAY,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,wBAA8B,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA6FxE"}
|
|
@@ -106,7 +106,7 @@ function getRollupOptions(type, language, input, plugins = [], options) {
|
|
|
106
106
|
styles(),
|
|
107
107
|
...plugins,
|
|
108
108
|
nodeResolve({ browser: true }),
|
|
109
|
-
commonjs({ esmExternals: true, sourceMap:
|
|
109
|
+
commonjs({ esmExternals: true, sourceMap: options.sourcemap }),
|
|
110
110
|
json(),
|
|
111
111
|
replace({
|
|
112
112
|
values: {
|
|
@@ -114,7 +114,7 @@ function getRollupOptions(type, language, input, plugins = [], options) {
|
|
|
114
114
|
},
|
|
115
115
|
preventAssignment: true,
|
|
116
116
|
}),
|
|
117
|
-
options.
|
|
117
|
+
options.minify ? terser() : null,
|
|
118
118
|
],
|
|
119
119
|
};
|
|
120
120
|
}
|
|
@@ -126,7 +126,7 @@ function getRollupOptions(type, language, input, plugins = [], options) {
|
|
|
126
126
|
language === 'typescript' ? typescript({ check: false }) : null,
|
|
127
127
|
...plugins,
|
|
128
128
|
nodeResolve(),
|
|
129
|
-
commonjs({ sourceMap:
|
|
129
|
+
commonjs({ sourceMap: options.sourcemap }),
|
|
130
130
|
json(),
|
|
131
131
|
replace({
|
|
132
132
|
values: {
|
|
@@ -134,7 +134,7 @@ function getRollupOptions(type, language, input, plugins = [], options) {
|
|
|
134
134
|
},
|
|
135
135
|
preventAssignment: true,
|
|
136
136
|
}),
|
|
137
|
-
options.
|
|
137
|
+
options.minify ? terser() : null,
|
|
138
138
|
],
|
|
139
139
|
};
|
|
140
140
|
}
|
|
@@ -144,6 +144,8 @@ function getRollupOutputOptions(type, output, options) {
|
|
|
144
144
|
return {
|
|
145
145
|
file: output,
|
|
146
146
|
format: 'es',
|
|
147
|
+
inlineDynamicImports: true,
|
|
148
|
+
sourcemap: options.sourcemap,
|
|
147
149
|
};
|
|
148
150
|
}
|
|
149
151
|
else {
|
|
@@ -151,7 +153,8 @@ function getRollupOutputOptions(type, output, options) {
|
|
|
151
153
|
file: output,
|
|
152
154
|
format: 'cjs',
|
|
153
155
|
exports: 'default',
|
|
154
|
-
|
|
156
|
+
inlineDynamicImports: true,
|
|
157
|
+
sourcemap: options.sourcemap,
|
|
155
158
|
};
|
|
156
159
|
}
|
|
157
160
|
}
|
package/dist/esm/cli/run.js
CHANGED
|
@@ -20,6 +20,7 @@ program
|
|
|
20
20
|
.option('-l, --language <language>', 'overwrite the language to use')
|
|
21
21
|
.option('-f, --force', 'ignore the package manifest')
|
|
22
22
|
.option('-w, --watch', 'watch and rebuild on changes')
|
|
23
|
-
.option('-
|
|
23
|
+
.option('--no-minify', 'disable minification')
|
|
24
|
+
.option('--sourcemap', 'include source maps in output')
|
|
24
25
|
.action(build);
|
|
25
26
|
program.parse(process.argv);
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { defineInterface, defineDisplay, defineLayout, defineModule, definePanel, defineHook, defineEndpoint, getFieldsFromTemplate, getRelationType, } from '@directus/shared/utils';
|
|
2
|
-
export { useStores, useApi, useSync, useCollection, useItems, useFilterFields } from '@directus/shared/composables';
|
|
2
|
+
export { useStores, useApi, useExtensions, useSync, useCollection, useItems, useLayout, useFilterFields, } from '@directus/shared/composables';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,eAAe,GACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,eAAe,GACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,SAAS,EACT,MAAM,EACN,aAAa,EACb,OAAO,EACP,aAAa,EACb,QAAQ,EACR,SAAS,EACT,eAAe,GACf,MAAM,8BAA8B,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { defineInterface, defineDisplay, defineLayout, defineModule, definePanel, defineHook, defineEndpoint, getFieldsFromTemplate, getRelationType, } from '@directus/shared/utils';
|
|
2
|
-
export { useStores, useApi, useSync, useCollection, useItems, useFilterFields } from '@directus/shared/composables';
|
|
2
|
+
export { useStores, useApi, useExtensions, useSync, useCollection, useItems, useLayout, useFilterFields, } from '@directus/shared/composables';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@directus/extensions-sdk",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.5.1",
|
|
4
4
|
"description": "A toolkit to develop extensions to extend Directus.",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"node": ">=12.20.0"
|
|
30
30
|
},
|
|
31
31
|
"author": "Nicola Krumschmidt",
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "c0c412d30b116bd38a2690b62463f775d37db79c",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@directus/shared": "9.
|
|
34
|
+
"@directus/shared": "9.5.1",
|
|
35
35
|
"@rollup/plugin-commonjs": "^21.0.0",
|
|
36
36
|
"@rollup/plugin-json": "^4.1.0",
|
|
37
37
|
"@rollup/plugin-node-resolve": "^13.0.0",
|
|
@@ -33,7 +33,8 @@ type BuildOptions = {
|
|
|
33
33
|
language: string;
|
|
34
34
|
force: boolean;
|
|
35
35
|
watch: boolean;
|
|
36
|
-
|
|
36
|
+
minify: boolean;
|
|
37
|
+
sourcemap: boolean;
|
|
37
38
|
};
|
|
38
39
|
|
|
39
40
|
export default async function build(options: BuildOptions): Promise<void> {
|
|
@@ -148,7 +149,7 @@ function getRollupOptions(
|
|
|
148
149
|
styles(),
|
|
149
150
|
...plugins,
|
|
150
151
|
nodeResolve({ browser: true }),
|
|
151
|
-
commonjs({ esmExternals: true, sourceMap:
|
|
152
|
+
commonjs({ esmExternals: true, sourceMap: options.sourcemap }),
|
|
152
153
|
json(),
|
|
153
154
|
replace({
|
|
154
155
|
values: {
|
|
@@ -156,7 +157,7 @@ function getRollupOptions(
|
|
|
156
157
|
},
|
|
157
158
|
preventAssignment: true,
|
|
158
159
|
}),
|
|
159
|
-
options.
|
|
160
|
+
options.minify ? terser() : null,
|
|
160
161
|
],
|
|
161
162
|
};
|
|
162
163
|
} else {
|
|
@@ -167,7 +168,7 @@ function getRollupOptions(
|
|
|
167
168
|
language === 'typescript' ? typescript({ check: false }) : null,
|
|
168
169
|
...plugins,
|
|
169
170
|
nodeResolve(),
|
|
170
|
-
commonjs({ sourceMap:
|
|
171
|
+
commonjs({ sourceMap: options.sourcemap }),
|
|
171
172
|
json(),
|
|
172
173
|
replace({
|
|
173
174
|
values: {
|
|
@@ -175,7 +176,7 @@ function getRollupOptions(
|
|
|
175
176
|
},
|
|
176
177
|
preventAssignment: true,
|
|
177
178
|
}),
|
|
178
|
-
options.
|
|
179
|
+
options.minify ? terser() : null,
|
|
179
180
|
],
|
|
180
181
|
};
|
|
181
182
|
}
|
|
@@ -186,13 +187,16 @@ function getRollupOutputOptions(type: ExtensionType, output: string, options: Bu
|
|
|
186
187
|
return {
|
|
187
188
|
file: output,
|
|
188
189
|
format: 'es',
|
|
190
|
+
inlineDynamicImports: true,
|
|
191
|
+
sourcemap: options.sourcemap,
|
|
189
192
|
};
|
|
190
193
|
} else {
|
|
191
194
|
return {
|
|
192
195
|
file: output,
|
|
193
196
|
format: 'cjs',
|
|
194
197
|
exports: 'default',
|
|
195
|
-
|
|
198
|
+
inlineDynamicImports: true,
|
|
199
|
+
sourcemap: options.sourcemap,
|
|
196
200
|
};
|
|
197
201
|
}
|
|
198
202
|
}
|
package/src/cli/run.ts
CHANGED
|
@@ -25,7 +25,8 @@ program
|
|
|
25
25
|
.option('-l, --language <language>', 'overwrite the language to use')
|
|
26
26
|
.option('-f, --force', 'ignore the package manifest')
|
|
27
27
|
.option('-w, --watch', 'watch and rebuild on changes')
|
|
28
|
-
.option('-
|
|
28
|
+
.option('--no-minify', 'disable minification')
|
|
29
|
+
.option('--sourcemap', 'include source maps in output')
|
|
29
30
|
.action(build);
|
|
30
31
|
|
|
31
32
|
program.parse(process.argv);
|
package/src/index.ts
CHANGED
|
@@ -9,4 +9,13 @@ export {
|
|
|
9
9
|
getFieldsFromTemplate,
|
|
10
10
|
getRelationType,
|
|
11
11
|
} from '@directus/shared/utils';
|
|
12
|
-
export {
|
|
12
|
+
export {
|
|
13
|
+
useStores,
|
|
14
|
+
useApi,
|
|
15
|
+
useExtensions,
|
|
16
|
+
useSync,
|
|
17
|
+
useCollection,
|
|
18
|
+
useItems,
|
|
19
|
+
useLayout,
|
|
20
|
+
useFilterFields,
|
|
21
|
+
} from '@directus/shared/composables';
|