Skip to content

Commit e35cfae

Browse files
author
hubert
committed
chore: move playground to root
1 parent 9f48082 commit e35cfae

File tree

19 files changed

+2487
-1733
lines changed

19 files changed

+2487
-1733
lines changed

mock-submodules/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@test/sub-modules",
2+
"name": "@mock/submodules",
33
"version": "0.1.3",
44
"private": true,
55
"license": "MIT",

mock-submodules/src/dymanicRouter/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineBootstrap, defineMount } from '@vue-async/module-loader/esm/sub';
1+
import { defineBootstrap, defineMount } from '@vue-async/module-loader/sub';
22
// 模块的路由配置数组
33
import routes from './router';
44
import './assets/index.css';

mock-submodules/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"noImplicitAny": false,
1111
"jsx": "preserve",
1212
"paths": {
13-
"@vue-async/module-loader/esm/*": ["../packages/module-loader/src/*"]
13+
"@vue-async/module-loader/*": ["../packages/module-loader/src/*"]
1414
}
1515
},
1616
"include": ["src"]

mock-submodules/yarn.lock

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,29 @@ __metadata:
592592
languageName: node
593593
linkType: hard
594594

595+
"@mock/submodules@workspace:.":
596+
version: 0.0.0-use.local
597+
resolution: "@mock/submodules@workspace:."
598+
dependencies:
599+
"@vitejs/plugin-vue": ^5.0.4
600+
"@vitejs/plugin-vue-jsx": ^3.0.1
601+
"@vue/eslint-config-prettier": ^6.0.0
602+
"@vue/eslint-config-typescript": ^5.0.2
603+
concurrently: ^8.2.2
604+
core-js: ^3.6.4
605+
eslint-plugin-vue: ^5.0.0
606+
less: ^3.11.1
607+
less-loader: ^5.0.0
608+
lodash.merge: ^4.6.2
609+
rimraf: ^5.0.7
610+
stylus: ^0.54.5
611+
stylus-loader: ^3.0.2
612+
vite: ^5.1.6
613+
vue: ^3.0.0
614+
vue-demi: "*"
615+
languageName: unknown
616+
linkType: soft
617+
595618
"@npmcli/agent@npm:^2.0.0":
596619
version: 2.2.2
597620
resolution: "@npmcli/agent@npm:2.2.2"
@@ -733,29 +756,6 @@ __metadata:
733756
languageName: node
734757
linkType: hard
735758

736-
"@test/sub-modules@workspace:.":
737-
version: 0.0.0-use.local
738-
resolution: "@test/sub-modules@workspace:."
739-
dependencies:
740-
"@vitejs/plugin-vue": ^5.0.4
741-
"@vitejs/plugin-vue-jsx": ^3.0.1
742-
"@vue/eslint-config-prettier": ^6.0.0
743-
"@vue/eslint-config-typescript": ^5.0.2
744-
concurrently: ^8.2.2
745-
core-js: ^3.6.4
746-
eslint-plugin-vue: ^5.0.0
747-
less: ^3.11.1
748-
less-loader: ^5.0.0
749-
lodash.merge: ^4.6.2
750-
rimraf: ^5.0.7
751-
stylus: ^0.54.5
752-
stylus-loader: ^3.0.2
753-
vite: ^5.1.6
754-
vue: ^3.0.0
755-
vue-demi: "*"
756-
languageName: unknown
757-
linkType: soft
758-
759759
"@types/estree@npm:1.0.5":
760760
version: 1.0.5
761761
resolution: "@types/estree@npm:1.0.5"

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"scripts": {
1111
"serve:mock-data": "nodemon --delay 1 --watch mock-data/apis mock-data/server.js",
1212
"serve:mock-submodules": "cd mock-submodules && yarn serve",
13-
"serve:mock": "concurrently --raw \"yarn serve:mock-data\" \"yarn serve:mock-submodules\" ",
13+
"serve": "concurrently --raw \"yarn serve:mock-data\" \"yarn serve:mock-submodules\" \"nuxt dev playground -p 7001\"",
1414
"build": "lerna run build --sort --stream --scope='@vue-async/*'",
1515
"test": "jest --coverage --passWithNoTests",
1616
"prepublishOnly": "yarn install --mode=skip-build && yarn changelog && yarn build && yarn test",
@@ -102,6 +102,7 @@
102102
},
103103
"workspaces": {
104104
"packages": [
105+
"playground",
105106
"packages/*"
106107
]
107108
}

packages/module-loader/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
"types"
4848
],
4949
"scripts": {
50-
"serve": "nuxt dev playground -p 7001",
5150
"build": "run -T rimraf -rf lib esm dist && yarn build:version && yarn build:cjs && yarn build:esm && yarn build:umd",
5251
"build:version": "node -p \"'export const version: string = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts",
5352
"build:cjs": "run -T tsc --project tsconfig.build.json",
@@ -72,8 +71,7 @@
7271
"warning": "^4.0.3"
7372
},
7473
"devDependencies": {
75-
"@types/warning": "^3.0.0",
76-
"nuxt": "^3.0.0"
74+
"@types/warning": "^3.0.0"
7775
},
7876
"peerDependencies": {
7977
"@vue/composition-api": "^1.0.0",

packages/module-loader/playground/pages/remote-component-page.vue

Lines changed: 0 additions & 26 deletions
This file was deleted.

packages/module-loader/src/createLoader.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ type XOR<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T
1515
*/
1616
export function createLoader<Props extends Record<string, any> = any, Context = any>(
1717
options: {
18+
/**
19+
* global variables for the resolver
20+
*/
1821
globalVariables?: Record<string, any>;
1922
} & XOR<
2023
{

packages/module-loader/playground/nuxt.config.ts renamed to playground/nuxt.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ import { defineNuxtConfig } from 'nuxt/config';
33

44
export default defineNuxtConfig({
55
ssr: false,
6+
srcDir: 'src/',
67
app: {
78
head: {
89
script: [{ src: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/js-loading-overlay.min.js' }],
910
},
1011
},
11-
// plugins: [{ src: 'plugins/module-loader' }],
1212
build: {
1313
transpile: ['@vue-async/*'],
1414
},
1515
alias: {
16-
'@vue-async/module-loader': fileURLToPath(new URL('../src', import.meta.url)),
16+
'@vue-async/module-loader': fileURLToPath(new URL('../packages/module-loader/src', import.meta.url)),
1717
},
1818
});

playground/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "@test/playground",
3+
"version": "0.0.1",
4+
"private": true,
5+
"license": "MIT",
6+
"scripts": {
7+
"serve": "nuxt dev -p 7001"
8+
},
9+
"dependencies": {
10+
"nuxt": "^3.0.0"
11+
}
12+
}

0 commit comments

Comments
 (0)