@utoo/pack 1.1.2-alpha.2 → 1.1.2-alpha.5
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/cjs/types.d.ts +0 -16
- package/cjs/webpackCompat.js +0 -26
- package/esm/types.d.ts +0 -16
- package/esm/webpackCompat.js +0 -26
- package/package.json +9 -8
package/cjs/types.d.ts
CHANGED
|
@@ -98,21 +98,6 @@ export interface ExternalAdvanced {
|
|
|
98
98
|
script?: string;
|
|
99
99
|
}
|
|
100
100
|
export type ExternalConfig = string | ExternalAdvanced;
|
|
101
|
-
/**
|
|
102
|
-
* Provider configuration for automatic module imports.
|
|
103
|
-
* Similar to webpack's ProvidePlugin.
|
|
104
|
-
*
|
|
105
|
-
* @example
|
|
106
|
-
* ```ts
|
|
107
|
-
* provider: {
|
|
108
|
-
* // Provides `$` as `import $ from 'jquery'`
|
|
109
|
-
* $: 'jquery',
|
|
110
|
-
* // Provides `Buffer` as `import { Buffer } from 'buffer'`
|
|
111
|
-
* Buffer: ['buffer', 'Buffer'],
|
|
112
|
-
* }
|
|
113
|
-
* ```
|
|
114
|
-
*/
|
|
115
|
-
export type ProviderConfig = Record<string, string | [string, string]>;
|
|
116
101
|
export interface ConfigComplete {
|
|
117
102
|
entry: EntryOptions[];
|
|
118
103
|
mode?: "production" | "development";
|
|
@@ -134,7 +119,6 @@ export interface ConfigComplete {
|
|
|
134
119
|
target?: string;
|
|
135
120
|
sourceMaps?: boolean;
|
|
136
121
|
define?: Record<string, string>;
|
|
137
|
-
provider?: ProviderConfig;
|
|
138
122
|
optimization?: {
|
|
139
123
|
moduleIds?: "named" | "deterministic";
|
|
140
124
|
minify?: boolean;
|
package/cjs/webpackCompat.js
CHANGED
|
@@ -29,7 +29,6 @@ function compatOptionsFromWebpack(webpackConfig, projectPath, rootPath) {
|
|
|
29
29
|
sourceMaps: compatSourceMaps(devtool),
|
|
30
30
|
optimization: compatOptimization(optimization),
|
|
31
31
|
define: compatFromWebpackPlugin(plugins, compatDefine),
|
|
32
|
-
provider: compatFromWebpackPlugin(plugins, compatProvider),
|
|
33
32
|
stats: compatStats(stats),
|
|
34
33
|
},
|
|
35
34
|
buildId: webpackConfig.name,
|
|
@@ -130,31 +129,6 @@ function compatDefine(maybeWebpackPluginInstance) {
|
|
|
130
129
|
}
|
|
131
130
|
return processedDefinitions;
|
|
132
131
|
}
|
|
133
|
-
compatProvider.pluginName = "ProvidePlugin";
|
|
134
|
-
function compatProvider(maybeWebpackPluginInstance) {
|
|
135
|
-
const definitions = maybeWebpackPluginInstance === null || maybeWebpackPluginInstance === void 0 ? void 0 : maybeWebpackPluginInstance.definitions;
|
|
136
|
-
if (!definitions || typeof definitions !== "object") {
|
|
137
|
-
return undefined;
|
|
138
|
-
}
|
|
139
|
-
const provider = {};
|
|
140
|
-
for (const [key, value] of Object.entries(definitions)) {
|
|
141
|
-
if (typeof value === "string") {
|
|
142
|
-
// Simple module import: { $: 'jquery' }
|
|
143
|
-
provider[key] = value;
|
|
144
|
-
}
|
|
145
|
-
else if (Array.isArray(value)) {
|
|
146
|
-
if (value.length === 1) {
|
|
147
|
-
// e.g. { process: ['process/browser'] } for default import
|
|
148
|
-
provider[key] = value[0];
|
|
149
|
-
}
|
|
150
|
-
else if (value.length >= 2) {
|
|
151
|
-
// Named export import: { Buffer: ['buffer', 'Buffer'] }
|
|
152
|
-
provider[key] = [value[0], value[1]];
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
return Object.keys(provider).length > 0 ? provider : undefined;
|
|
157
|
-
}
|
|
158
132
|
function compatExternals(webpackExternals) {
|
|
159
133
|
if (!webpackExternals) {
|
|
160
134
|
return undefined;
|
package/esm/types.d.ts
CHANGED
|
@@ -98,21 +98,6 @@ export interface ExternalAdvanced {
|
|
|
98
98
|
script?: string;
|
|
99
99
|
}
|
|
100
100
|
export type ExternalConfig = string | ExternalAdvanced;
|
|
101
|
-
/**
|
|
102
|
-
* Provider configuration for automatic module imports.
|
|
103
|
-
* Similar to webpack's ProvidePlugin.
|
|
104
|
-
*
|
|
105
|
-
* @example
|
|
106
|
-
* ```ts
|
|
107
|
-
* provider: {
|
|
108
|
-
* // Provides `$` as `import $ from 'jquery'`
|
|
109
|
-
* $: 'jquery',
|
|
110
|
-
* // Provides `Buffer` as `import { Buffer } from 'buffer'`
|
|
111
|
-
* Buffer: ['buffer', 'Buffer'],
|
|
112
|
-
* }
|
|
113
|
-
* ```
|
|
114
|
-
*/
|
|
115
|
-
export type ProviderConfig = Record<string, string | [string, string]>;
|
|
116
101
|
export interface ConfigComplete {
|
|
117
102
|
entry: EntryOptions[];
|
|
118
103
|
mode?: "production" | "development";
|
|
@@ -134,7 +119,6 @@ export interface ConfigComplete {
|
|
|
134
119
|
target?: string;
|
|
135
120
|
sourceMaps?: boolean;
|
|
136
121
|
define?: Record<string, string>;
|
|
137
|
-
provider?: ProviderConfig;
|
|
138
122
|
optimization?: {
|
|
139
123
|
moduleIds?: "named" | "deterministic";
|
|
140
124
|
minify?: boolean;
|
package/esm/webpackCompat.js
CHANGED
|
@@ -22,7 +22,6 @@ export function compatOptionsFromWebpack(webpackConfig, projectPath, rootPath) {
|
|
|
22
22
|
sourceMaps: compatSourceMaps(devtool),
|
|
23
23
|
optimization: compatOptimization(optimization),
|
|
24
24
|
define: compatFromWebpackPlugin(plugins, compatDefine),
|
|
25
|
-
provider: compatFromWebpackPlugin(plugins, compatProvider),
|
|
26
25
|
stats: compatStats(stats),
|
|
27
26
|
},
|
|
28
27
|
buildId: webpackConfig.name,
|
|
@@ -123,31 +122,6 @@ function compatDefine(maybeWebpackPluginInstance) {
|
|
|
123
122
|
}
|
|
124
123
|
return processedDefinitions;
|
|
125
124
|
}
|
|
126
|
-
compatProvider.pluginName = "ProvidePlugin";
|
|
127
|
-
function compatProvider(maybeWebpackPluginInstance) {
|
|
128
|
-
const definitions = maybeWebpackPluginInstance === null || maybeWebpackPluginInstance === void 0 ? void 0 : maybeWebpackPluginInstance.definitions;
|
|
129
|
-
if (!definitions || typeof definitions !== "object") {
|
|
130
|
-
return undefined;
|
|
131
|
-
}
|
|
132
|
-
const provider = {};
|
|
133
|
-
for (const [key, value] of Object.entries(definitions)) {
|
|
134
|
-
if (typeof value === "string") {
|
|
135
|
-
// Simple module import: { $: 'jquery' }
|
|
136
|
-
provider[key] = value;
|
|
137
|
-
}
|
|
138
|
-
else if (Array.isArray(value)) {
|
|
139
|
-
if (value.length === 1) {
|
|
140
|
-
// e.g. { process: ['process/browser'] } for default import
|
|
141
|
-
provider[key] = value[0];
|
|
142
|
-
}
|
|
143
|
-
else if (value.length >= 2) {
|
|
144
|
-
// Named export import: { Buffer: ['buffer', 'Buffer'] }
|
|
145
|
-
provider[key] = [value[0], value[1]];
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
return Object.keys(provider).length > 0 ? provider : undefined;
|
|
150
|
-
}
|
|
151
125
|
function compatExternals(webpackExternals) {
|
|
152
126
|
if (!webpackExternals) {
|
|
153
127
|
return undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utoo/pack",
|
|
3
|
-
"version": "1.1.2-alpha.
|
|
3
|
+
"version": "1.1.2-alpha.5",
|
|
4
4
|
"main": "cjs/index.js",
|
|
5
5
|
"module": "esm/index.js",
|
|
6
6
|
"types": "esm/index.d.ts",
|
|
@@ -82,18 +82,19 @@
|
|
|
82
82
|
"artifacts": "napi artifacts --dir ./src --dist npm",
|
|
83
83
|
"build:binding": "napi build src --platform --release -p pack-napi --cargo-cwd ../../ --cargo-name pack_napi --features plugin --js binding.js --dts binding.d.ts",
|
|
84
84
|
"build:binding:local": "napi build src --platform --profile release-local -p pack-napi --cargo-cwd ../../ --cargo-name pack_napi --features plugin --js binding.js --dts binding.d.ts",
|
|
85
|
+
"clean": "rm -rf cjs esm",
|
|
85
86
|
"prepublishOnly": "turbo run build:js --filter=@utoo/pack && napi prepublish -t npm --skip-gh-release",
|
|
86
87
|
"version": "napi version",
|
|
87
88
|
"generate-features-list": "node ./scripts/generate-feature-list.js"
|
|
88
89
|
},
|
|
89
90
|
"repository": "git@github.com:utooland/utoo.git",
|
|
90
91
|
"optionalDependencies": {
|
|
91
|
-
"@utoo/pack-darwin-arm64": "1.1.2-alpha.
|
|
92
|
-
"@utoo/pack-darwin-x64": "1.1.2-alpha.
|
|
93
|
-
"@utoo/pack-linux-arm64-gnu": "1.1.2-alpha.
|
|
94
|
-
"@utoo/pack-linux-arm64-musl": "1.1.2-alpha.
|
|
95
|
-
"@utoo/pack-linux-x64-gnu": "1.1.2-alpha.
|
|
96
|
-
"@utoo/pack-linux-x64-musl": "1.1.2-alpha.
|
|
97
|
-
"@utoo/pack-win32-x64-msvc": "1.1.2-alpha.
|
|
92
|
+
"@utoo/pack-darwin-arm64": "1.1.2-alpha.5",
|
|
93
|
+
"@utoo/pack-darwin-x64": "1.1.2-alpha.5",
|
|
94
|
+
"@utoo/pack-linux-arm64-gnu": "1.1.2-alpha.5",
|
|
95
|
+
"@utoo/pack-linux-arm64-musl": "1.1.2-alpha.5",
|
|
96
|
+
"@utoo/pack-linux-x64-gnu": "1.1.2-alpha.5",
|
|
97
|
+
"@utoo/pack-linux-x64-musl": "1.1.2-alpha.5",
|
|
98
|
+
"@utoo/pack-win32-x64-msvc": "1.1.2-alpha.5"
|
|
98
99
|
}
|
|
99
100
|
}
|