@dtwo/kit 3.2.0 → 3.2.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/LICENSE +21 -21
- package/dist/index.d.ts +7 -7
- package/dist/index.mjs +7 -7
- package/package.json +8 -8
- package/README.md +0 -7
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022 - Dtwo Team
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 - Dtwo Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ModuleOptions, ModuleDefinition, DtwoModule, Dtwo, DtwoConfig, DtwoOpti
|
|
|
2
2
|
import { LoadConfigOptions } from 'c12';
|
|
3
3
|
import { Import } from 'kdimport';
|
|
4
4
|
import { Configuration, WebpackPluginInstance } from 'webpack';
|
|
5
|
-
import { UserConfig, Plugin } from '
|
|
5
|
+
import { UserConfig, Plugin } from 'lahm';
|
|
6
6
|
import * as unctx_index from 'unctx/index';
|
|
7
7
|
import { HoleEventHandler, HoleDevEventHandler, Hole, HoleRouteConfig } from 'holepack';
|
|
8
8
|
import * as consola from 'consola';
|
|
@@ -68,7 +68,7 @@ interface ExtendConfigOptions {
|
|
|
68
68
|
}
|
|
69
69
|
interface ExtendWebpackConfigOptions extends ExtendConfigOptions {
|
|
70
70
|
}
|
|
71
|
-
interface
|
|
71
|
+
interface ExtendLahmConfigOptions extends ExtendConfigOptions {
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* Extend webpack config
|
|
@@ -78,17 +78,17 @@ interface ExtendWiteConfigOptions extends ExtendConfigOptions {
|
|
|
78
78
|
*/
|
|
79
79
|
declare function extendWebpackConfig(fn: ((config: Configuration) => void), options?: ExtendWebpackConfigOptions): void;
|
|
80
80
|
/**
|
|
81
|
-
* Extend
|
|
81
|
+
* Extend Lahm config
|
|
82
82
|
*/
|
|
83
|
-
declare function
|
|
83
|
+
declare function extendLahmConfig(fn: ((config: UserConfig) => void), options?: ExtendLahmConfigOptions): (() => void) | undefined;
|
|
84
84
|
/**
|
|
85
85
|
* Append webpack plugin to the config.
|
|
86
86
|
*/
|
|
87
87
|
declare function addWebpackPlugin(plugin: WebpackPluginInstance | WebpackPluginInstance[], options?: ExtendWebpackConfigOptions): void;
|
|
88
88
|
/**
|
|
89
|
-
* Append
|
|
89
|
+
* Append Lahm plugin to the config.
|
|
90
90
|
*/
|
|
91
|
-
declare function
|
|
91
|
+
declare function addLahmPlugin(plugin: Plugin | Plugin[], options?: ExtendLahmConfigOptions): void;
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
94
|
* Check version constraints and return incompatibility issues as an array
|
|
@@ -350,4 +350,4 @@ declare const templateUtils: {
|
|
|
350
350
|
}) => string;
|
|
351
351
|
};
|
|
352
352
|
|
|
353
|
-
export { AddComponentOptions, AddPluginOptions, AddRouteMiddlewareOptions, ExtendConfigOptions, ExtendRouteRulesOptions, ExtendWebpackConfigOptions,
|
|
353
|
+
export { AddComponentOptions, AddPluginOptions, AddRouteMiddlewareOptions, ExtendConfigOptions, ExtendLahmConfigOptions, ExtendRouteRulesOptions, ExtendWebpackConfigOptions, LoadDtwoConfigOptions, LoadDtwoOptions, RequireModuleOptions, ResolveModuleOptions, ResolvePathOptions, Resolver, addComponent, addComponentsDir, addDevServerHandler, addImports, addImportsDir, addImportsSources, addLahmPlugin, addLayout, addPlugin, addPluginTemplate, addPrerenderRoutes, addRouteMiddleware, addServerHandler, addServerPlugin, addTemplate, addWebpackPlugin, assertDtwoCompatibility, buildDtwo, checkDtwoCompatibility, clearRequireCache, compileTemplate, createResolver, defineDtwoModule, dtwoCtx, extendDtwoSchema, extendLahmConfig, extendPages, extendRouteRules, extendWebpackConfig, findPath, getDtwoVersion, getRequireCacheItem, hasDtwoCompatibility, importModule, installModule, isDtwo2, isDtwo3, isIgnored, isNodeModules, loadDtwo, loadDtwoConfig, logger, normalizePlugin, normalizeTemplate, requireModule, requireModulePkg, resolveAlias, resolveFiles, resolveModule, resolvePath, scanRequireTree, templateUtils, tryImportModule, tryRequireModule, tryResolveModule, tryUseDtwo, updateTemplates, useDtwo, useHole, useLogger };
|
package/dist/index.mjs
CHANGED
|
@@ -522,7 +522,7 @@ async function loadDtwo(opts) {
|
|
|
522
522
|
configOverrides: opts.overrides,
|
|
523
523
|
ready: opts.ready,
|
|
524
524
|
envConfig: opts.dotenv
|
|
525
|
-
// TODO: Backward format
|
|
525
|
+
// TODO: Backward format conversion
|
|
526
526
|
});
|
|
527
527
|
return dtwo;
|
|
528
528
|
}
|
|
@@ -589,7 +589,7 @@ function extendWebpackConfig(fn, options = {}) {
|
|
|
589
589
|
}
|
|
590
590
|
});
|
|
591
591
|
}
|
|
592
|
-
function
|
|
592
|
+
function extendLahmConfig(fn, options = {}) {
|
|
593
593
|
const dtwo = useDtwo();
|
|
594
594
|
if (options.dev === false && dtwo.options.dev) {
|
|
595
595
|
return;
|
|
@@ -598,9 +598,9 @@ function extendWiteConfig(fn, options = {}) {
|
|
|
598
598
|
return;
|
|
599
599
|
}
|
|
600
600
|
if (options.server !== false && options.client !== false) {
|
|
601
|
-
return dtwo.hook("
|
|
601
|
+
return dtwo.hook("lahm:extend", ({ config }) => fn(config));
|
|
602
602
|
}
|
|
603
|
-
dtwo.hook("
|
|
603
|
+
dtwo.hook("lahm:extendConfig", (config, { isClient, isServer }) => {
|
|
604
604
|
if (options.server !== false && isServer) {
|
|
605
605
|
return fn(config);
|
|
606
606
|
}
|
|
@@ -619,8 +619,8 @@ function addWebpackPlugin(plugin, options) {
|
|
|
619
619
|
}
|
|
620
620
|
}, options);
|
|
621
621
|
}
|
|
622
|
-
function
|
|
623
|
-
|
|
622
|
+
function addLahmPlugin(plugin, options) {
|
|
623
|
+
extendLahmConfig((config) => {
|
|
624
624
|
config.plugins = config.plugins || [];
|
|
625
625
|
if (Array.isArray(plugin)) {
|
|
626
626
|
config.plugins.push(...plugin);
|
|
@@ -850,4 +850,4 @@ function addPluginTemplate(plugin, opts = {}) {
|
|
|
850
850
|
return addPlugin(normalizedPlugin, opts);
|
|
851
851
|
}
|
|
852
852
|
|
|
853
|
-
export { addComponent, addComponentsDir, addDevServerHandler, addImports, addImportsDir, addImportsSources, addLayout, addPlugin, addPluginTemplate, addPrerenderRoutes, addRouteMiddleware, addServerHandler, addServerPlugin, addTemplate, addWebpackPlugin,
|
|
853
|
+
export { addComponent, addComponentsDir, addDevServerHandler, addImports, addImportsDir, addImportsSources, addLahmPlugin, addLayout, addPlugin, addPluginTemplate, addPrerenderRoutes, addRouteMiddleware, addServerHandler, addServerPlugin, addTemplate, addWebpackPlugin, assertDtwoCompatibility, buildDtwo, checkDtwoCompatibility, clearRequireCache, compileTemplate, createResolver, defineDtwoModule, dtwoCtx, extendDtwoSchema, extendLahmConfig, extendPages, extendRouteRules, extendWebpackConfig, findPath, getDtwoVersion, getRequireCacheItem, hasDtwoCompatibility, importModule, installModule, isDtwo2, isDtwo3, isIgnored, isNodeModules, loadDtwo, loadDtwoConfig, logger, normalizePlugin, normalizeTemplate, requireModule, requireModulePkg, resolveAlias, resolveFiles, resolveModule, resolvePath, scanRequireTree, templateUtils, tryImportModule, tryRequireModule, tryResolveModule, tryUseDtwo, updateTemplates, useDtwo, useHole, useLogger };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dtwo/kit",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"repository": "d2js/dtwo",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -10,23 +10,23 @@
|
|
|
10
10
|
"dist"
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@dtwo/schema": "3.2.
|
|
14
|
-
"c12": "1.1.
|
|
13
|
+
"@dtwo/schema": "3.2.1",
|
|
14
|
+
"c12": "1.1.2",
|
|
15
15
|
"consola": "2.15.3",
|
|
16
16
|
"defu": "6.1.2",
|
|
17
17
|
"globby": "13.1.3",
|
|
18
18
|
"hash-sum": "2.0.0",
|
|
19
19
|
"ignore": "5.2.4",
|
|
20
|
-
"jiti": "1.17.
|
|
20
|
+
"jiti": "1.17.1",
|
|
21
21
|
"kdimport": "2.2.4",
|
|
22
22
|
"knitwork": "1.0.0",
|
|
23
23
|
"lodash.template": "4.5.0",
|
|
24
|
-
"mlly": "1.1.
|
|
24
|
+
"mlly": "1.1.1",
|
|
25
25
|
"pathe": "1.1.0",
|
|
26
|
-
"pkg-types": "1.0.
|
|
26
|
+
"pkg-types": "1.0.2",
|
|
27
27
|
"scule": "1.0.0",
|
|
28
28
|
"semver": "7.3.8",
|
|
29
|
-
"unctx": "2.1.
|
|
29
|
+
"unctx": "2.1.2",
|
|
30
30
|
"untyped": "1.2.2"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"unbuild": "1.1.1"
|
|
36
36
|
},
|
|
37
37
|
"engines": {
|
|
38
|
-
"node": "^14.
|
|
38
|
+
"node": "^14.18.0 || ^16.10.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {}
|
|
41
41
|
}
|