@tarojs/plugin-platform-jd 3.5.5 → 3.5.6-alpha.0
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/index.js +24 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/types/index.d.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var service = require('@tarojs/service');
|
|
6
5
|
var shared = require('@tarojs/shared');
|
|
6
|
+
var service = require('@tarojs/service');
|
|
7
7
|
var template = require('@tarojs/shared/dist/template');
|
|
8
8
|
|
|
9
9
|
/*! *****************************************************************************
|
|
@@ -119,6 +119,29 @@ var index = (ctx) => {
|
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
|
+
ctx.modifyRunnerOpts(({ opts }) => {
|
|
123
|
+
if (!(opts === null || opts === void 0 ? void 0 : opts.compiler))
|
|
124
|
+
return;
|
|
125
|
+
if (shared.isString(opts.compiler)) {
|
|
126
|
+
opts.compiler = {
|
|
127
|
+
type: opts.compiler
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
const { compiler } = opts;
|
|
131
|
+
if (compiler.type === 'webpack5') {
|
|
132
|
+
compiler.prebundle || (compiler.prebundle = {});
|
|
133
|
+
const prebundleOptions = compiler.prebundle;
|
|
134
|
+
if (prebundleOptions.enable === false)
|
|
135
|
+
return;
|
|
136
|
+
prebundleOptions.swc || (prebundleOptions.swc = {
|
|
137
|
+
jsc: {
|
|
138
|
+
target: 'es5'
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
prebundleOptions.exclude || (prebundleOptions.exclude = []);
|
|
142
|
+
prebundleOptions.include || (prebundleOptions.include = []);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
122
145
|
};
|
|
123
146
|
|
|
124
147
|
exports.JD = JD;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/components.ts","../src/template.ts","../src/program.ts","../src/index.ts"],"sourcesContent":["import { singleQuote } from '@tarojs/shared'\n\nexport const components = {\n // ======== 调整属性 ========\n Swiper: {\n 'easing-function': singleQuote('default')\n },\n Canvas: {\n type: ''\n },\n Button: {\n bindGetPhoneNumber: ''\n },\n Map: {\n bindRegionChange: ''\n }\n}\n","import { UnRecursiveTemplate } from '@tarojs/shared/dist/template'\n\nexport class Template extends UnRecursiveTemplate {\n supportXS = false\n Adapter = {\n if: 'jd:if',\n else: 'jd:else',\n elseif: 'jd:elif',\n for: 'jd:for',\n forItem: 'jd:for-item',\n forIndex: 'jd:for-index',\n key: 'jd:key',\n type: 'jd'\n }\n\n replacePropName (name, value, componentName) {\n if (value === 'eh') {\n const nameLowerCase = name.toLowerCase()\n if (nameLowerCase === 'bindlongtap' && componentName !== 'canvas') return 'bindlongpress'\n return nameLowerCase\n }\n return name\n }\n}\n","import { TaroPlatformBase } from '@tarojs/service'\n\nimport { components } from './components'\nimport { Template } from './template'\n\nconst PACKAGE_NAME = '@tarojs/plugin-platform-jd'\n\nexport default class JD extends TaroPlatformBase {\n platform = 'jd'\n globalObject = 'jd'\n projectConfigJson = 'project.jd.json'\n runtimePath = `${PACKAGE_NAME}/dist/runtime`\n fileType = {\n templ: '.jxml',\n style: '.jxss',\n config: '.json',\n script: '.js'\n }\n\n template = new Template()\n\n /**\n * 1. setupTransaction - init\n * 2. setup\n * 3. setupTransaction - close\n * 4. buildTransaction - init\n * 5. build\n * 6. buildTransaction - close\n */\n constructor (ctx, config) {\n super(ctx, config)\n\n this.setupTransaction.addWrapper({\n close: this.modifyTemplate\n })\n }\n\n /**\n * 增加组件或修改组件属性\n */\n modifyTemplate () {\n this.template.mergeComponents(this.ctx, components)\n }\n}\n","import
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/components.ts","../src/template.ts","../src/program.ts","../src/index.ts"],"sourcesContent":["import { singleQuote } from '@tarojs/shared'\n\nexport const components = {\n // ======== 调整属性 ========\n Swiper: {\n 'easing-function': singleQuote('default')\n },\n Canvas: {\n type: ''\n },\n Button: {\n bindGetPhoneNumber: ''\n },\n Map: {\n bindRegionChange: ''\n }\n}\n","import { UnRecursiveTemplate } from '@tarojs/shared/dist/template'\n\nexport class Template extends UnRecursiveTemplate {\n supportXS = false\n Adapter = {\n if: 'jd:if',\n else: 'jd:else',\n elseif: 'jd:elif',\n for: 'jd:for',\n forItem: 'jd:for-item',\n forIndex: 'jd:for-index',\n key: 'jd:key',\n type: 'jd'\n }\n\n replacePropName (name, value, componentName) {\n if (value === 'eh') {\n const nameLowerCase = name.toLowerCase()\n if (nameLowerCase === 'bindlongtap' && componentName !== 'canvas') return 'bindlongpress'\n return nameLowerCase\n }\n return name\n }\n}\n","import { TaroPlatformBase } from '@tarojs/service'\n\nimport { components } from './components'\nimport { Template } from './template'\n\nconst PACKAGE_NAME = '@tarojs/plugin-platform-jd'\n\nexport default class JD extends TaroPlatformBase {\n platform = 'jd'\n globalObject = 'jd'\n projectConfigJson = 'project.jd.json'\n runtimePath = `${PACKAGE_NAME}/dist/runtime`\n fileType = {\n templ: '.jxml',\n style: '.jxss',\n config: '.json',\n script: '.js'\n }\n\n template = new Template()\n\n /**\n * 1. setupTransaction - init\n * 2. setup\n * 3. setupTransaction - close\n * 4. buildTransaction - init\n * 5. build\n * 6. buildTransaction - close\n */\n constructor (ctx, config) {\n super(ctx, config)\n\n this.setupTransaction.addWrapper({\n close: this.modifyTemplate\n })\n }\n\n /**\n * 增加组件或修改组件属性\n */\n modifyTemplate () {\n this.template.mergeComponents(this.ctx, components)\n }\n}\n","import { isString } from '@tarojs/shared'\n\nimport JD from './program'\n\nimport type { IPluginContext } from '@tarojs/service'\n\n// 让其它平台插件可以继承此平台\nexport { JD }\n\nexport default (ctx: IPluginContext) => {\n ctx.registerPlatform({\n name: 'jd',\n useConfigName: 'mini',\n async fn ({ config }) {\n const program = new JD(ctx, config)\n await program.start()\n }\n })\n\n ctx.modifyRunnerOpts(({ opts }) => {\n if (!opts?.compiler) return\n\n if (isString(opts.compiler)) {\n opts.compiler = {\n type: opts.compiler\n }\n }\n const { compiler } = opts\n if (compiler.type === 'webpack5') {\n compiler.prebundle ||= {}\n const prebundleOptions = compiler.prebundle\n if (prebundleOptions.enable === false) return\n prebundleOptions.swc ||= {\n jsc: {\n target: 'es5'\n }\n }\n prebundleOptions.exclude ||= []\n prebundleOptions.include ||= []\n }\n })\n}\n"],"names":["singleQuote","UnRecursiveTemplate","TaroPlatformBase","isString"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,MAAM,UAAU,GAAG;;AAExB,IAAA,MAAM,EAAE;AACN,QAAA,iBAAiB,EAAEA,kBAAW,CAAC,SAAS,CAAC;AAC1C,KAAA;AACD,IAAA,MAAM,EAAE;AACN,QAAA,IAAI,EAAE,EAAE;AACT,KAAA;AACD,IAAA,MAAM,EAAE;AACN,QAAA,kBAAkB,EAAE,EAAE;AACvB,KAAA;AACD,IAAA,GAAG,EAAE;AACH,QAAA,gBAAgB,EAAE,EAAE;AACrB,KAAA;CACF;;ACdK,MAAO,QAAS,SAAQC,4BAAmB,CAAA;AAAjD,IAAA,WAAA,GAAA;;QACE,IAAS,CAAA,SAAA,GAAG,KAAK,CAAA;AACjB,QAAA,IAAA,CAAA,OAAO,GAAG;AACR,YAAA,EAAE,EAAE,OAAO;AACX,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,MAAM,EAAE,SAAS;AACjB,YAAA,GAAG,EAAE,QAAQ;AACb,YAAA,OAAO,EAAE,aAAa;AACtB,YAAA,QAAQ,EAAE,cAAc;AACxB,YAAA,GAAG,EAAE,QAAQ;AACb,YAAA,IAAI,EAAE,IAAI;SACX,CAAA;KAUF;AARC,IAAA,eAAe,CAAE,IAAI,EAAE,KAAK,EAAE,aAAa,EAAA;QACzC,IAAI,KAAK,KAAK,IAAI,EAA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AC;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/plugin-platform-jd",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.6-alpha.0",
|
|
4
4
|
"description": "京东小程序平台插件",
|
|
5
5
|
"author": "Chen-jj",
|
|
6
6
|
"homepage": "https://github.com/nervjs/taro/tree/master/packages/taro-jd#readme",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"url": "https://github.com/NervJS/taro/issues"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@tarojs/service": "3.5.
|
|
27
|
-
"@tarojs/shared": "3.5.
|
|
26
|
+
"@tarojs/service": "3.5.6-alpha.0",
|
|
27
|
+
"@tarojs/shared": "3.5.6-alpha.0"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "rollup -c",
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TaroPlatformBase, IPluginContext } from "@tarojs/service";
|
|
2
2
|
import { UnRecursiveTemplate } from "@tarojs/shared/dist/template";
|
|
3
3
|
declare class Template extends UnRecursiveTemplate {
|
|
4
4
|
supportXS: boolean;
|