Files
Hippy/scripts/init-example.js
T
Lxy 0445c4ec41 feat(hippy-vue-next): support vue3.x (#2357)
* feat(hippy-vue-next): initialize hippy-vue-next package

* feat(hippy-vue-next): rollup build config

* feat(example): add vue-next demo

* docs(hippy-vue-next): update vue version

* feat(hippy-vue-next): update branch up to date with Tencent:master

* feat(hippy-vue-next): update comment

* feat(example): use @vue/runtime-core with package

* docs(hippy-vue-next): update comment

* fix(hippy-vue-next): fix demo debug problem

* feat(hippy-vue-next): modify import type of runtime in demo

* feat(hippy-vue-next): generate d.ts file

* fix(hippy-vue-next): fix android horizontal problem in demo-list

* feat(hippy-vue-next): modify eslint options to check demo's code

* feat(hippy-vue-next): add vue-next unit test

* feat(hippy-vue-next): fix & commit unit tests

* feat(hippy-vue-next): ignore api-extractor warnings

* docs(hippy-vue-next): update docs

* docs(hippy-vue-next): update comment

* docs(hippy-vue-next): update docs

* docs(hippy-vue-next): update docs

* chore(license): add license header

* docs(hippy-vue-next): update docs

* feat(hippy-vue-next): add once event demo

* refactor(hippy-vue-next): rename tool package

* docs(hippy-vue-next): update docs

* docs(hippy-vue-next): update comment

* docs(hippy-vue-next): update docs

* feat(hippy-vue-next): modify regexp

* docs(hippy-vue-next): update docs

* feat(hippy-vue-next): modify regexp

* feat(hippy-vue-next): perf regexp

* feat(hippy-vue-next): perf regexp

* feat(hippy-vue-next): perf regexp

* feat(hippy-vue-next): perf regexp

* feat(hippy-vue-next): perf regexp

* feat(hippy-vue-next): perf regexp

* feat(hippy-vue-next): reset old package-lock

* feat(hippy-vue-next): update breakStrategy demo

* feat(hippy-vue-next): add utils unit test case

* feat(hippy-vue-next): add utils & element unit test case

* feat(hippy-vue-next): add event & element unit test case

* feat(hippy-vue-next): add native unit test case

* feat(hippy-vue-next): add built-in & patch unit test case

* feat(hippy-vue-next): add patch unit test case

* feat(hippy-vue-next): add style unit test case

* feat(hippy-vue-next): add style unit test case

* feat(hippy-vue-next): add style & util unit test case

* fix(hippy-vue-next): fix swiper & animation warn in debug mode

* feat(hippy-vue-next): use shallowRef to up perf for component reactive

* fix(hippy-vue-next): fix animation warn in debug mode

* feat(hippy-vue-next): upgrade debug package

* feat(hippy-vue-next): fix CR problem

* feat(hippy-vue-next): fix CR problem

* feat(hippy-vue-next): app start support both callback & promise

* feat(hippy-vue-next): fix turbo proxy value problem

* feat(hippy-vue-next): update docs

* feat(hippy-vue-next): fix animation demo problem

* feat(hippy-vue-next): modify register hippy method to compatible vue2

* feat(hippy-vue-next): update docs

* feat(hippy-vue-next): update vue3 docs

* feat(hippy-vue-next): add waterfall lose props

* fix(vue-next): fix lint issues and logic robust issues

* feat(hippy-vue-next): add event bus & unit test case

* feat(hippy-vue-next): add webpack vendor options

* feat(hippy-vue-next): add webpack vendor options

* feat(hippy-vue-next): remove unused demo method

* feat(hippy-vue-next): modify event bus to compatible vue2

* feat(hippy-vue-next): modify event bus to compatible vue2

* feat(hippy-vue-next): add event-bus unit test cases

* feat(hippy-vue-next): add build vendor directive

* feat(hippy-vue-next): remove demo redundant method & add silent option

* feat(hippy-vue-next): update debug doc

* feat(hippy-vue-next): add console output style

* feat(hippy-vue-next): add custom nativeapis and components demo

* docs(text): extend custom nativeapis and components docs

* feat(hippy-vue-next): remove auto generated declaration files

* feat(hippy-vue-next): update demo list & compatible vue3.2.39+ event

* feat(hippy-vue-next): support scoped & attribute selector & merge update

* feat(hippy-vue-next): support scoped & add unit tests

* feat(hippy-vue-next): update vue-next-demo same to vue-demo

* feat(hippy-vue-next): add unit tests

* feat(hippy-vue-next): use named export instead universal export

* feat(hippy-vue-next): update css-loader name to compatible vue-loader

* feat(hippy-vue-next): fix style matched issue

* refactor(vue-next): update docs & lock

* fix(npm,eslint): update npm package & fix lint

* feat(hippy-vue-next): add style unit tests

* feat(hippy-vue-next): fix eslint issue

* feat(hippy-vue-next): add android router inject logic & doc

* feat(hippy-vue-next): use hippy history to solve router inject logic

* feat(hippy-vue-next): update router history doc

* feat(hippy-vue-next): update router history doc

* feat(vue): add getElemCss scoped judgement

* refactor(vue-demo): remove stop

Co-authored-by: anqinli <anqinli@tencent.com>
Co-authored-by: birdguo <birdguo@tencent.com>
Co-authored-by: Zoom Chan <zoom_chan@163.com>
Co-authored-by: birdguo <gguoyu@users.noreply.github.com>
2022-10-11 14:24:18 +08:00

59 lines
1.8 KiB
JavaScript

/*
* Tencent is pleased to support the open source community by making
* Hippy available.
*
* Copyright (C) 2017-2022 THL A29 Limited, a Tencent company.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable no-console */
const path = require('path');
const {
exec,
pushd,
test,
rm,
} = require('shelljs');
const cmdExample = 'please execute command like \'npm run init:example hippy-react-demo\' or \'npm run init:example hippy-vue-demo\' or \'npm run init:example hippy-vue-next-demo\'';
const example = process.argv[2];
if (!example) {
console.error(`❌ No example argument found, ${cmdExample}`);
return;
}
const BASE_PATH = process.cwd();
// Target demo project path
const DEMO_PATH = path.join(BASE_PATH, 'examples', example);
if (!test('-d', DEMO_PATH)) {
console.error(`❌ Can not find demo project: ${example}, ${cmdExample}`);
return;
}
pushd(DEMO_PATH);
function errorHandler(code, stdout, stderr) {
if (code !== 0) {
console.error(`❌ init example - ${example} error: ${stderr}`);
process.exit(1);
}
}
const execOptions = { stdio: 'inherit' };
console.log(`1/2 Start to install ${example} dependencies.`);
rm('-rf', './node_modules');
exec('npm install --legacy-peer-deps', execOptions, errorHandler);
console.log(`${example} dependencies have been installed.`);