Skip to content

Commit

Permalink
chore: bump dependencies version
Browse files Browse the repository at this point in the history
  • Loading branch information
nonzzz committed Jul 24, 2023
1 parent 843790c commit 55f91c8
Show file tree
Hide file tree
Showing 15 changed files with 110 additions and 35 deletions.
9 changes: 1 addition & 8 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
module.exports = {
extends: ['kagura/typescript'],
rules: {
'@typescript-eslint/space-infix-ops': 'error',
'@typescript-eslint/type-annotation-spacing': ['error', {
before: false,
after: true
}]
}
extends: ['kagura/typescript']
}
8 changes: 4 additions & 4 deletions __tests__/code-gen.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test('filter', async (t) => {
import { ref } from 'vue';
const v = ref(0)
`
const dependencies:Map<string, ModuleInfo> = new Map()
const dependencies: Map<string, ModuleInfo> = new Map()
const codeGen = createCodeGenerator()
dependencies.set('vue', {
name: 'vue',
Expand Down Expand Up @@ -83,7 +83,7 @@ test('exports with source and re named local name', async (t) => {
if (!res.code) return
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const ast = await parse(res.code, { babelrc: false, configFile: false })!
const keys:Set<string> = new Set()
const keys: Set<string> = new Set()
await traverse(ast, {
ObjectProperty: {
enter: (path) => {
Expand Down Expand Up @@ -114,7 +114,7 @@ test('export all with source and re named it with default', async (t) => {
if (!res.code) return
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const ast = await parse(res.code, { babelrc: false, configFile: false })!
const keys:Set<string> = new Set()
const keys: Set<string> = new Set()
await traverse(ast, {
ObjectProperty: (path) => {
path.node.key.type === 'Identifier' && keys.add(path.node.key.name)
Expand All @@ -133,7 +133,7 @@ test('export all with source and re named it with custom', async (t) => {
if (!res.code) return
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const ast = await parse(res.code, { babelrc: false, configFile: false })!
const keys:Set<string> = new Set()
const keys: Set<string> = new Set()
await traverse(ast, {
ObjectProperty: (path) => {
path.node.key.type === 'Identifier' && keys.add(path.node.key.name)
Expand Down
2 changes: 1 addition & 1 deletion __tests__/inject.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface MockIIFEMdoule extends TrackModule{
}

test('inject', (t) => {
const modules:Map<string, MockIIFEMdoule> = new Map()
const modules: Map<string, MockIIFEMdoule> = new Map()
modules.set('fake', {
relativeModule: 'fake.js',
version: '0.0.0.',
Expand Down
4 changes: 2 additions & 2 deletions __tests__/shared.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import test from 'ava'
import fsp from 'fs/promises'
import { lookup, len } from '../dist/shared'
import test from 'ava'
import { len, lookup } from '../dist/shared'


test('len', (t) => {
Expand Down
8 changes: 4 additions & 4 deletions e2e/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import fs from 'fs'
import http from 'http'
import test from 'ava'
import { chromium } from 'playwright'
import type { Page } from 'playwright'
import { cdn } from '../dist'

import type { Page } from 'playwright'
import type { Vite2Instance } from './vite2/interface'
import type { Vite3Instance } from './vite3/interface'
import type { Vite4Instance } from './vite4/interface'
Expand All @@ -26,7 +26,7 @@ type Server = http.Server & {

const defaultWd = __dirname

function prepareAssets(taskName:string, options:TestOptions) {
function prepareAssets(taskName: string, options: TestOptions) {
const { vite, pluginOption = {}, plugins } = options
vite.build({
root: defaultWd,
Expand All @@ -38,7 +38,7 @@ function prepareAssets(taskName:string, options:TestOptions) {
})
}

function createGetter<T>(obj: T, key: string, getter: ()=>unknown) {
function createGetter<T>(obj: T, key: string, getter: ()=> unknown) {
Object.defineProperty(obj, key, {
get: getter
})
Expand Down Expand Up @@ -101,7 +101,7 @@ async function expectTestCase(taskName: string, page: Awaited<Page>) {
test(`${taskName} cdn load`, async (t) => t.is(await expect1, 'info'))
}

export async function runTest(taskName:string, options: TestOptions) {
export async function runTest(taskName: string, options: TestOptions) {
await prepareAssets(taskName, options)
await new Promise((resolve) => setTimeout(resolve, 5000))
const { server } = createServer(taskName)
Expand Down
2 changes: 1 addition & 1 deletion e2e/vite2/e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import vue from '@vitejs/plugin-vue'
import { name } from './package.json'
import { runTest } from '../e2e'
import { name } from './package.json'

export default (async function () {
const vite = await import('vite')
Expand Down
2 changes: 1 addition & 1 deletion e2e/vite3/e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import vue from '@vitejs/plugin-vue'
import { name } from './package.json'
import { runTest } from '../e2e'
import { name } from './package.json'

export default (async function () {
const vite = await import('vite')
Expand Down
2 changes: 1 addition & 1 deletion e2e/vite4/e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import vue from '@vitejs/plugin-vue'
import { name } from './package.json'
import { runTest } from '../e2e'
import { name } from './package.json'

export default (async function () {
const vite = await import('vite')
Expand Down
1 change: 1 addition & 0 deletions example/src/api.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
export { ref as default, onMounted, watchEffect } from 'vue'
export * as vue from 'vue'

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"ava": "^5.2.0",
"c8": "^7.12.0",
"eslint": "^8.23.1",
"eslint-config-kagura": "^1.1.0",
"eslint-config-kagura": "^1.2.0",
"no-bump": "^0.7.1",
"playwright": "^1.35.1",
"rollup-plugin-cleanup": "^3.2.1",
Expand Down
4 changes: 2 additions & 2 deletions src/code-gen.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { parse as esModuleLexer } from 'rs-module-lexer'
import { parse as babelParse, traverse, transformFromAstAsync, types as t } from '@babel/core'
import { len } from './shared'
import { parse as babelParse, types as t, transformFromAstAsync, traverse } from '@babel/core'
import type { NodePath } from '@babel/core'
import { len } from './shared'
import type { ModuleInfo } from './interface'


Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { createFilter } from '@rollup/pluginutils'
import type { Plugin } from 'vite'
import { createScanner } from './scanner'
import { createInjectScript } from './inject'
import { createCodeGenerator } from './code-gen'
import { isSupportThreads } from './shared'
import { jsdelivr } from './url'
import type { Plugin } from 'vite'
import type { CDNPluginOptions } from './interface'

function cdn(opts: CDNPluginOptions = {}): Plugin {
Expand Down
2 changes: 1 addition & 1 deletion src/inject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { URL } from 'url'
import { Window } from 'happy-dom'
import { uniq } from './shared'
import type { CDNPluginOptions, ScriptNode, LinkNode, ModuleInfo, ResolverFunction } from './interface'
import type { CDNPluginOptions, LinkNode, ModuleInfo, ResolverFunction, ScriptNode } from './interface'

function isScript(url: string) {
return url.split('.').pop() === 'js' ? 'script' : 'link'
Expand Down
6 changes: 3 additions & 3 deletions src/scanner.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import fsp from 'fs/promises'
import worker_threads from 'worker_threads'
import { createConcurrentQueue, createVM, MAX_CONCURRENT } from './vm'
import { is, len, lookup } from './shared'
import type { MessagePort } from 'worker_threads'
import type { TrackModule, IIFEModuleInfo, ModuleInfo, IModule, ResolverFunction } from './interface'
import { MAX_CONCURRENT, createConcurrentQueue, createVM } from './vm'
import { is, len, lookup } from './shared'
import type { IIFEModuleInfo, IModule, ModuleInfo, ResolverFunction, TrackModule } from './interface'

// This file is a simply dependencies scanner.
// We won't throw any error unless it's an internal thread error(such as pid not equal)
Expand Down
91 changes: 86 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1336,6 +1336,13 @@ date-time@^3.1.0:
dependencies:
time-zone "^1.0.0"

debug@^3.2.7:
version "3.2.7"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a"
integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==
dependencies:
ms "^2.1.1"

debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4:
version "4.3.4"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
Expand Down Expand Up @@ -1384,6 +1391,13 @@ dir-glob@^3.0.1:
dependencies:
path-type "^4.0.0"

doctrine@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d"
integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==
dependencies:
esutils "^2.0.2"

doctrine@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961"
Expand Down Expand Up @@ -1569,13 +1583,45 @@ escape-string-regexp@^4.0.0:
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==

eslint-config-kagura@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/eslint-config-kagura/-/eslint-config-kagura-1.1.0.tgz#c751a4055c68d22cda8d54039c3b958446f14099"
integrity sha512-DMGEnDE4FoWtS1E7SemQid8NDCxmInE1ekW1fQFXiq7ZebFx91GrKDFDgAcLW/DtcVPZ58kkMxsE+SImadhXkA==
eslint-config-kagura@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/eslint-config-kagura/-/eslint-config-kagura-1.2.0.tgz#91a3d9a3994d7a41e2d6e84e0bcfd441ce9b38e8"
integrity sha512-HelILB4FjklTUfb4XcrFFs0JLAM9nYfZXxOgUNyKyxNZq+ZEbl1jaoBBtdy1SZOy6zBko+J0fu9C8V5jKclTpg==
dependencies:
"@typescript-eslint/eslint-plugin" "^5.59.5"
"@typescript-eslint/parser" "^5.59.5"
eslint-plugin-import "npm:eslint-plugin-i@latest"

eslint-import-resolver-node@^0.3.7:
version "0.3.7"
resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.7.tgz#83b375187d412324a1963d84fa664377a23eb4d7"
integrity sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA==
dependencies:
debug "^3.2.7"
is-core-module "^2.11.0"
resolve "^1.22.1"

eslint-module-utils@^2.8.0:
version "2.8.0"
resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz#e439fee65fc33f6bba630ff621efc38ec0375c49"
integrity sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==
dependencies:
debug "^3.2.7"

"eslint-plugin-import@npm:eslint-plugin-i@latest":
version "2.27.5-4"
resolved "https://registry.yarnpkg.com/eslint-plugin-i/-/eslint-plugin-i-2.27.5-4.tgz#cbfe16e8660c5f115cd78299f609e2cae846886d"
integrity sha512-X3Z+dp9nZw7d/y41EDO6JyFw4WVMOT91SFuoJvL0C0/4M1l6NxQ5mLTjXHuYhq0AazW75pAmj25yMk5wPMzjsw==
dependencies:
debug "^3.2.7"
doctrine "^2.1.0"
eslint-import-resolver-node "^0.3.7"
eslint-module-utils "^2.8.0"
get-tsconfig "^4.6.0"
is-glob "^4.0.3"
minimatch "^3.1.2"
resolve "^1.22.3"
semver "^7.5.3"

eslint-scope@^5.1.1:
version "5.1.1"
Expand Down Expand Up @@ -1847,6 +1893,13 @@ get-tsconfig@^4.2.0:
resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.5.0.tgz#6d52d1c7b299bd3ee9cd7638561653399ac77b0f"
integrity sha512-MjhiaIWCJ1sAU4pIQ5i5OfOuHHxVo1oYeNsWTON7jxYkod8pHocXeh+SSbmu5OZZZK73B6cbJ2XADzXehLyovQ==

get-tsconfig@^4.6.0:
version "4.6.2"
resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.6.2.tgz#831879a5e6c2aa24fe79b60340e2233a1e0f472e"
integrity sha512-E5XrT4CbbXcXWy+1jChlZmrmCwd5KGx502kDCXJJ7y898TtWW9FwoG5HfOLVRKmlmDGkWN2HM9Ho+/Y8F0sJDg==
dependencies:
resolve-pkg-maps "^1.0.0"

glob-parent@^5.1.2, glob-parent@~5.1.2:
version "5.1.2"
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
Expand Down Expand Up @@ -2065,6 +2118,13 @@ is-core-module@^2.11.0:
dependencies:
has "^1.0.3"

is-core-module@^2.12.0:
version "2.12.1"
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.12.1.tgz#0c0b6885b6f80011c71541ce15c8d66cf5a4f9fd"
integrity sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==
dependencies:
has "^1.0.3"

is-error@^2.2.2:
version "2.2.2"
resolved "https://registry.yarnpkg.com/is-error/-/is-error-2.2.2.tgz#c10ade187b3c93510c5470a5567833ee25649843"
Expand Down Expand Up @@ -2392,7 +2452,7 @@ ms@2.1.2:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==

ms@^2.1.3:
ms@^2.1.1, ms@^2.1.3:
version "2.1.3"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
Expand Down Expand Up @@ -2716,6 +2776,11 @@ resolve-from@^5.0.0:
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69"
integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==

resolve-pkg-maps@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz#616b3dc2c57056b5588c31cdf4b3d64db133720f"
integrity sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==

resolve@^1.22.1:
version "1.22.2"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.2.tgz#0ed0943d4e301867955766c9f3e1ae6d01c6845f"
Expand All @@ -2725,6 +2790,15 @@ resolve@^1.22.1:
path-parse "^1.0.7"
supports-preserve-symlinks-flag "^1.0.0"

resolve@^1.22.3:
version "1.22.3"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.3.tgz#4b4055349ffb962600972da1fdc33c46a4eb3283"
integrity sha512-P8ur/gp/AmbEzjr729bZnLjXK5Z+4P0zhIJgBgzqRih7hL7BOukHGtSTA3ACMY467GRFz3duQsi0bDZdR7DKdw==
dependencies:
is-core-module "^2.12.0"
path-parse "^1.0.7"
supports-preserve-symlinks-flag "^1.0.0"

reusify@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76"
Expand Down Expand Up @@ -2835,6 +2909,13 @@ semver@^7.3.7:
dependencies:
lru-cache "^6.0.0"

semver@^7.5.3:
version "7.5.4"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e"
integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==
dependencies:
lru-cache "^6.0.0"

serialize-error@^7.0.1:
version "7.0.1"
resolved "https://registry.yarnpkg.com/serialize-error/-/serialize-error-7.0.1.tgz#f1360b0447f61ffb483ec4157c737fab7d778e18"
Expand Down

0 comments on commit 55f91c8

Please sign in to comment.