diff --git a/.github/actions/prepare-install/action.yml b/.github/actions/prepare-install/action.yml index 255c9ea1181..bc3594b0a23 100644 --- a/.github/actions/prepare-install/action.yml +++ b/.github/actions/prepare-install/action.yml @@ -11,7 +11,7 @@ runs: steps: - uses: pnpm/action-setup@v3 with: - version: 11 + version: 11.12.0 - name: Use Node.js ${{ inputs.node-version }} uses: actions/setup-node@v4 diff --git a/legacy/build/bundle.ts b/legacy/build/bundle.ts deleted file mode 100644 index c63cf8c7f12..00000000000 --- a/legacy/build/bundle.ts +++ /dev/null @@ -1,2 +0,0 @@ -// @ts-ignore -export * from '@antv/l7'; diff --git a/legacy/build/rollup-plugin-glsl.js b/legacy/build/rollup-plugin-glsl.js deleted file mode 100644 index 156c969ec49..00000000000 --- a/legacy/build/rollup-plugin-glsl.js +++ /dev/null @@ -1,33 +0,0 @@ -import { createFilter } from 'rollup-pluginutils'; - -// borrow from https://github.com/uber/luma.gl/blob/master/dev-modules/babel-plugin-remove-glsl-comments/index.js#L4-L5 -const INLINE_COMMENT_REGEX = /\s*\/\/.*[\n\r]/g; -const BLOCK_COMMENT_REGEX = /\s*\/\*(\*(?!\/)|[^*])*\*\//g; - -// 生产环境压缩 GLSL -export default function glsl(include, minify) { - const filter = createFilter(include); - return { - name: 'glsl', - transform(code, id) { - if (!filter(id)) return; - - if (minify) { - code = code - .trim() // strip whitespace at the start/end - .replace(/\n+/g, '\n') // collapse multi line breaks - // remove comments - .replace(INLINE_COMMENT_REGEX, '\n') - .replace(BLOCK_COMMENT_REGEX, '') - .replace(/\n\s+/g, '\n') // strip identation - // .replace(/\s?([+-\/*=,])\s?/g, '$1') // strip whitespace around operators - // .replace(/([;\(\),\{\}])\n(?=[^#])/g, '$1'); // strip more line breaks - } - - return { - code: `export default ${JSON.stringify(code)};`, - map: { mappings: '' } - }; - } - }; -} diff --git a/legacy/build/rollup-plugin-inline-worker.js b/legacy/build/rollup-plugin-inline-worker.js deleted file mode 100644 index dc6b1526203..00000000000 --- a/legacy/build/rollup-plugin-inline-worker.js +++ /dev/null @@ -1,16 +0,0 @@ -import { createFilter } from 'rollup-pluginutils'; - -export default function inlineWorker(include) { - const filter = createFilter(include); - return { - name: 'inline-worker', - transform(code, id) { - if (!filter(id)) return; - - return { - code: `export default ${JSON.stringify(code)};`, - map: { mappings: '' }, - }; - }, - }; -} diff --git a/legacy/build/rollup-plugin-miniapp.js b/legacy/build/rollup-plugin-miniapp.js deleted file mode 100644 index aa45edca12c..00000000000 --- a/legacy/build/rollup-plugin-miniapp.js +++ /dev/null @@ -1,48 +0,0 @@ -import inject from '@rollup/plugin-inject'; -import modify from '@rollup/plugin-modify'; -import path from 'path'; - -const module = '@oasis-engine/miniprogram-adapter '; - -function register(name) { - return [module, name]; -} - -function resolveFile(filePath) { - return path.join(__dirname, '..', filePath); -} - -const adapterArray = [ - 'window', - 'atob', - 'devicePixelRatio', - 'document', - 'Element', - 'Event', - 'EventTarget', - 'HTMLCanvasElement', - 'HTMLElement', - 'HTMLMediaElement', - 'HTMLVideoElement', - 'Image', - 'navigator', - 'Node', - 'requestAnimationFrame', - 'cancelAnimationFrame', - 'screen', - 'XMLHttpRequest', - 'performance', -]; -const adapterVars = {}; - -adapterArray.forEach((name) => { - adapterVars[name] = register(name); -}); - -export default [ - inject(adapterVars), - modify({ - find: /^@antv\/l7-(.*)/, - replacement: resolveFile('packages/$1/src'), - }), -]; diff --git a/legacy/build/rollup.config.js b/legacy/build/rollup.config.js deleted file mode 100644 index b29750d0bc6..00000000000 --- a/legacy/build/rollup.config.js +++ /dev/null @@ -1,100 +0,0 @@ -import path from 'path'; -import alias from '@rollup/plugin-alias'; -import json from '@rollup/plugin-json'; -import resolve from '@rollup/plugin-node-resolve'; -import commonjs from '@rollup/plugin-commonjs'; -import { terser } from 'rollup-plugin-terser'; -import analyze from 'rollup-plugin-analyzer'; -import babel from 'rollup-plugin-babel'; -import glsl from './rollup-plugin-glsl'; -import inlineWorker from './rollup-plugin-inline-worker'; -import postcss from 'rollup-plugin-postcss'; -import url from 'postcss-url'; - -const { BUILD, MINIFY } = process.env; -const minified = MINIFY === 'true'; -const production = BUILD === 'production'; -const outputFile = !production - ? 'packages/l7/dist/l7-dev.js' - : minified - ? 'packages/l7/dist/l7.js' - : 'packages/l7/dist/l7-dev.js'; - -function resolveFile(filePath) { - return path.join(__dirname, '..', filePath); -} - -module.exports = [ - { - input: resolveFile('build/bundle.ts'), - output: { - file: resolveFile(outputFile), - format: 'umd', - name: 'L7', - globals: { - 'mapbox-gl': 'mapboxgl', - }, - }, - external: ['mapbox-gl'], - treeshake: minified, - plugins: [ - alias({ - resolve: ['.tsx', '.ts'], - entries: [ - { - find: /^@antv\/l7-(.*)/, - replacement: resolveFile('packages/$1/src'), - }, - { - find: /^@antv\/l7$/, - replacement: resolveFile('packages/l7/src'), - }, - ], - }), - resolve({ - browser: true, - preferBuiltins: false, - extensions: ['.js', '.ts'], - }), - glsl(['**/*.glsl'], true), - inlineWorker(['**/*.worker.js']), - json(), - postcss({ - extract: false, - plugins: [url({ url: 'inline' })], - }), - // @see https://github.com/rollup/rollup-plugin-node-resolve#using-with-rollup-plugin-commonjs - commonjs({ - namedExports: { - eventemitter3: ['EventEmitter'], - // inversify: [ 'inject', 'injectable', 'postConstruct', 'Container', 'decorate', 'interfaces' ], - // @see https://github.com/rollup/rollup-plugin-commonjs/issues/266 - lodash: [ - 'isNil', - 'uniq', - 'clamp', - 'isObject', - 'isFunction', - 'cloneDeep', - 'isString', - 'isNumber', - 'isPlainObject', - 'merge', - ], - }, - dynamicRequireTargets: [ - 'node_modules/inversify/lib/syntax/binding_{on,when}_syntax.js', - ], - }), - babel({ - extensions: ['.js', '.ts'], - }), - // terser(), - minified ? terser() : false, - analyze({ - summaryOnly: true, - limit: 20, - }), - ], - }, -]; diff --git a/legacy/build/rollup.config.worker.js b/legacy/build/rollup.config.worker.js deleted file mode 100644 index c2ccf593132..00000000000 --- a/legacy/build/rollup.config.worker.js +++ /dev/null @@ -1,64 +0,0 @@ -import path from 'path'; -import alias from '@rollup/plugin-alias'; -import json from '@rollup/plugin-json'; -import resolve from '@rollup/plugin-node-resolve'; -import commonjs from '@rollup/plugin-commonjs'; -import { terser } from 'rollup-plugin-terser'; -// import analyze from 'rollup-plugin-analyzer'; -import babel from 'rollup-plugin-babel'; - -const { BUILD } = process.env; -const production = BUILD === 'production'; -const outputFile = production - ? 'packages/utils/dist/l7-utils.worker.js' - : 'packages/utils/dist/l7-utils.worker.js'; -function resolveFile(filePath) { - return path.join(__dirname, '..', filePath); -} - -module.exports = [ - { - input: resolveFile('packages/utils/src/workers/index.ts'), - output: { - file: resolveFile(outputFile), - format: 'iife', - name: 'L7', - }, - context: 'self', - treeshake: true, - plugins: [ - alias({ - resolve: ['.tsx', '.ts'], - entries: [ - { - find: /^@antv\/l7-(.*)\/src\/(.*)/, - replacement: resolveFile('packages/$1/src/$2'), - }, - { - find: /^@antv\/l7-(.*)/, - replacement: resolveFile('packages/$1/src'), - }, - { - find: /^@antv\/l7$/, - replacement: resolveFile('packages/l7/src'), - }, - ], - }), - resolve({ - browser: true, - preferBuiltins: false, - extensions: ['.js', '.ts'], - }), - json(), - commonjs(), - babel({ - extensions: ['.js', '.ts'], - }), - production ? terser() : false, - // analyze({ - // summaryOnly: true, - // limit: 20, - // }), - ], - }, -]; diff --git a/packages/maps/src/earth/theme.ts b/packages/maps/src/earth/theme.ts deleted file mode 100644 index 3b29aa499fa..00000000000 --- a/packages/maps/src/earth/theme.ts +++ /dev/null @@ -1,23 +0,0 @@ -export const MapTheme: { - [key: string]: any; -} = { - light: 'mapbox://styles/zcxduo/ck2ypyb1r3q9o1co1766dex29', - dark: 'mapbox://styles/zcxduo/ck241p6413s0b1cpayzldv7x7', - normal: 'mapbox://styles/mapbox/streets-v11', - blank: { - version: 8, - // sprite: 'https://lzxue.github.io/font-glyphs/sprite/sprite', - // glyphs: - // 'https://gw.alipayobjects.com/os/antvdemo/assets/mapbox/glyphs/{fontstack}/{range}.pbf', - sources: {}, - layers: [ - { - id: 'background', - type: 'background', - layout: { - visibility: 'none', - }, - }, - ], - }, -}; diff --git a/packages/maps/src/map/theme.ts b/packages/maps/src/map/theme.ts deleted file mode 100644 index 3b29aa499fa..00000000000 --- a/packages/maps/src/map/theme.ts +++ /dev/null @@ -1,23 +0,0 @@ -export const MapTheme: { - [key: string]: any; -} = { - light: 'mapbox://styles/zcxduo/ck2ypyb1r3q9o1co1766dex29', - dark: 'mapbox://styles/zcxduo/ck241p6413s0b1cpayzldv7x7', - normal: 'mapbox://styles/mapbox/streets-v11', - blank: { - version: 8, - // sprite: 'https://lzxue.github.io/font-glyphs/sprite/sprite', - // glyphs: - // 'https://gw.alipayobjects.com/os/antvdemo/assets/mapbox/glyphs/{fontstack}/{range}.pbf', - sources: {}, - layers: [ - { - id: 'background', - type: 'background', - layout: { - visibility: 'none', - }, - }, - ], - }, -}; diff --git a/packages/maps/src/mapbox/theme.ts b/packages/maps/src/mapbox/theme.ts deleted file mode 100644 index 3b29aa499fa..00000000000 --- a/packages/maps/src/mapbox/theme.ts +++ /dev/null @@ -1,23 +0,0 @@ -export const MapTheme: { - [key: string]: any; -} = { - light: 'mapbox://styles/zcxduo/ck2ypyb1r3q9o1co1766dex29', - dark: 'mapbox://styles/zcxduo/ck241p6413s0b1cpayzldv7x7', - normal: 'mapbox://styles/mapbox/streets-v11', - blank: { - version: 8, - // sprite: 'https://lzxue.github.io/font-glyphs/sprite/sprite', - // glyphs: - // 'https://gw.alipayobjects.com/os/antvdemo/assets/mapbox/glyphs/{fontstack}/{range}.pbf', - sources: {}, - layers: [ - { - id: 'background', - type: 'background', - layout: { - visibility: 'none', - }, - }, - ], - }, -}; diff --git a/packages/maps/src/tdtmap/logo.css b/packages/maps/src/tdtmap/logo.css deleted file mode 100644 index 1b5215fd730..00000000000 --- a/packages/maps/src/tdtmap/logo.css +++ /dev/null @@ -1,4 +0,0 @@ -.tencent-map--hide-logo img[src*='//mapapi.qq.com/web/jsapi/logo/logo_def.png'], -.tencent-map--hide-logo .logo-text { - display: none !important; -}