mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-16 05:03:11 +08:00
Merge pull request #12936 from storybookjs/e2e-tests
CLI: use Jest to test CLI commands and remove outdated fixtures
This commit is contained in:
commit
0e56733636
@ -40,7 +40,7 @@
|
||||
],
|
||||
"scripts": {
|
||||
"prepare": "node ../../scripts/prepare.js && node ./scripts/generate-sb-packages-versions.js",
|
||||
"test": "cd test && ./run_tests.sh",
|
||||
"test": "jest test/**/*.test.js",
|
||||
"postversion": "node ./scripts/generate-sb-packages-versions.js"
|
||||
},
|
||||
"dependencies": {
|
||||
|
3
lib/cli/test/.gitignore
vendored
3
lib/cli/test/.gitignore
vendored
@ -1,3 +0,0 @@
|
||||
cra-fixtures
|
||||
run
|
||||
run-yarn-2
|
12
lib/cli/test/default/cli.test.js
Executable file
12
lib/cli/test/default/cli.test.js
Executable file
@ -0,0 +1,12 @@
|
||||
const run = require('../helpers');
|
||||
|
||||
describe('Default behavior', () => {
|
||||
it('suggests the closest match to an unknown command', () => {
|
||||
const { status, stderr, stdout } = run(['upgraed']);
|
||||
|
||||
// Assertions
|
||||
expect(status).toBe(1);
|
||||
expect(stderr.toString()).toContain('Invalid command: upgraed.');
|
||||
expect(stdout.toString()).toContain('Did you mean upgrade?');
|
||||
});
|
||||
});
|
1
lib/cli/test/fixtures/ember-cli/.gitignore
vendored
1
lib/cli/test/fixtures/ember-cli/.gitignore
vendored
@ -1 +0,0 @@
|
||||
!dist
|
57
lib/cli/test/fixtures/ember-cli/README.md
vendored
57
lib/cli/test/fixtures/ember-cli/README.md
vendored
@ -1,57 +0,0 @@
|
||||
# ember-fixture
|
||||
|
||||
This README outlines the details of collaborating on this Ember application.
|
||||
A short introduction of this app could go here.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
You will need the following things properly installed on your computer.
|
||||
|
||||
* [Git](https://git-scm.com/)
|
||||
* [Node.js](https://nodejs.org/) (with npm)
|
||||
* [Ember CLI](https://ember-cli.com/)
|
||||
* [Google Chrome](https://google.com/chrome/)
|
||||
|
||||
## Installation
|
||||
|
||||
* `git clone <repository-url>` this repository
|
||||
* `cd ember-fixture`
|
||||
* `npm install`
|
||||
|
||||
## Running / Development
|
||||
|
||||
* `ember serve`
|
||||
* Visit your app at [http://localhost:4200](http://localhost:4200).
|
||||
* Visit your tests at [http://localhost:4200/tests](http://localhost:4200/tests).
|
||||
|
||||
### Code Generators
|
||||
|
||||
Make use of the many generators for code, try `ember help generate` for more details
|
||||
|
||||
### Running Tests
|
||||
|
||||
* `ember test`
|
||||
* `ember test --server`
|
||||
|
||||
### Linting
|
||||
|
||||
* `npm run lint:hbs`
|
||||
* `npm run lint:js`
|
||||
* `npm run lint:js -- --fix`
|
||||
|
||||
### Building
|
||||
|
||||
* `ember build` (development)
|
||||
* `ember build --environment production` (production)
|
||||
|
||||
### Deploying
|
||||
|
||||
Specify what it takes to deploy your app.
|
||||
|
||||
## Further Reading / Useful Links
|
||||
|
||||
* [ember.js](https://emberjs.com/)
|
||||
* [ember-cli](https://ember-cli.com/)
|
||||
* Development Browser Extensions
|
||||
* [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi)
|
||||
* [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/)
|
@ -1,51 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function(environment) {
|
||||
let ENV = {
|
||||
modulePrefix: 'ember-fixture',
|
||||
environment,
|
||||
rootURL: '/',
|
||||
locationType: 'auto',
|
||||
EmberENV: {
|
||||
FEATURES: {
|
||||
// Here you can enable experimental features on an ember canary build
|
||||
// e.g. 'with-controller': true
|
||||
},
|
||||
EXTEND_PROTOTYPES: {
|
||||
// Prevent Ember Data from overriding Date.parse.
|
||||
Date: false
|
||||
}
|
||||
},
|
||||
|
||||
APP: {
|
||||
// Here you can pass flags/options to your application instance
|
||||
// when it is created
|
||||
}
|
||||
};
|
||||
|
||||
if (environment === 'development') {
|
||||
// ENV.APP.LOG_RESOLVER = true;
|
||||
// ENV.APP.LOG_ACTIVE_GENERATION = true;
|
||||
// ENV.APP.LOG_TRANSITIONS = true;
|
||||
// ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
|
||||
// ENV.APP.LOG_VIEW_LOOKUPS = true;
|
||||
}
|
||||
|
||||
if (environment === 'test') {
|
||||
// Testem prefers this...
|
||||
ENV.locationType = 'none';
|
||||
|
||||
// keep test console output quieter
|
||||
ENV.APP.LOG_ACTIVE_GENERATION = false;
|
||||
ENV.APP.LOG_VIEW_LOOKUPS = false;
|
||||
|
||||
ENV.APP.rootElement = '#ember-testing';
|
||||
ENV.APP.autoboot = false;
|
||||
}
|
||||
|
||||
if (environment === 'production') {
|
||||
// here you can enable a production-specific feature
|
||||
}
|
||||
|
||||
return ENV;
|
||||
};
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"jquery-integration": true
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const browsers = [
|
||||
'last 1 Chrome versions',
|
||||
'last 1 Firefox versions',
|
||||
'last 1 Safari versions'
|
||||
];
|
||||
|
||||
const isCI = !!process.env.CI;
|
||||
const isProduction = process.env.EMBER_ENV === 'production';
|
||||
|
||||
if (isCI || isProduction) {
|
||||
browsers.push('ie 11');
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
browsers
|
||||
};
|
@ -1,24 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
|
||||
|
||||
module.exports = function(defaults) {
|
||||
let app = new EmberApp(defaults, {
|
||||
// Add options here
|
||||
});
|
||||
|
||||
// Use `app.import` to add additional libraries to the generated
|
||||
// output files.
|
||||
//
|
||||
// If you need to use different assets in different
|
||||
// environments, specify an object as the first parameter. That
|
||||
// object's keys should be the environment name and the values
|
||||
// should be the asset to use in that environment.
|
||||
//
|
||||
// If the library that you are including contains AMD or ES6
|
||||
// modules that you would like to import into your application
|
||||
// please specify an object with the list of modules as keys
|
||||
// along with the exports of each module as its value.
|
||||
|
||||
return app.toTree();
|
||||
};
|
51
lib/cli/test/fixtures/ember-cli/package.json
vendored
51
lib/cli/test/fixtures/ember-cli/package.json
vendored
@ -1,51 +0,0 @@
|
||||
{
|
||||
"name": "ember-fixture",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"description": "Small description for ember-fixture goes here",
|
||||
"repository": "",
|
||||
"license": "MIT",
|
||||
"author": "",
|
||||
"directories": {
|
||||
"doc": "doc",
|
||||
"test": "tests"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "ember build",
|
||||
"lint:hbs": "ember-template-lint .",
|
||||
"lint:js": "eslint .",
|
||||
"start": "ember serve",
|
||||
"test": "ember test"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@ember/jquery": "^0.5.2",
|
||||
"@ember/optional-features": "^0.6.3",
|
||||
"broccoli-asset-rev": "^2.7.0",
|
||||
"ember-ajax": "^3.1.0",
|
||||
"ember-cli": "~3.4.3",
|
||||
"ember-cli-app-version": "^3.2.0",
|
||||
"ember-cli-babel": "^6.16.0",
|
||||
"ember-cli-dependency-checker": "^3.0.0",
|
||||
"ember-cli-eslint": "^4.2.3",
|
||||
"ember-cli-htmlbars": "^3.0.0",
|
||||
"ember-cli-inject-live-reload": "^1.8.2",
|
||||
"ember-cli-qunit": "^4.3.2",
|
||||
"ember-cli-sri": "^2.1.1",
|
||||
"ember-cli-template-lint": "^1.0.0-beta.1",
|
||||
"ember-cli-uglify": "^2.1.0",
|
||||
"ember-data": "~3.4.0",
|
||||
"ember-export-application-global": "^2.0.0",
|
||||
"ember-load-initializers": "^1.1.0",
|
||||
"ember-maybe-import-regenerator": "^0.1.6",
|
||||
"ember-resolver": "^5.0.1",
|
||||
"ember-source": "~3.4.0",
|
||||
"ember-welcome-page": "^3.2.0",
|
||||
"eslint-plugin-ember": "^5.2.0",
|
||||
"loader.js": "^4.7.0",
|
||||
"qunit-dom": "^0.7.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "6.* || 8.* || >= 10.*"
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
# http://www.robotstxt.org
|
||||
User-agent: *
|
||||
Disallow:
|
25
lib/cli/test/fixtures/ember-cli/testem.js
vendored
25
lib/cli/test/fixtures/ember-cli/testem.js
vendored
@ -1,25 +0,0 @@
|
||||
module.exports = {
|
||||
test_page: 'tests/index.html?hidepassed',
|
||||
disable_watching: true,
|
||||
launch_in_ci: [
|
||||
'Chrome'
|
||||
],
|
||||
launch_in_dev: [
|
||||
'Chrome'
|
||||
],
|
||||
browser_args: {
|
||||
Chrome: {
|
||||
ci: [
|
||||
// --no-sandbox is needed when running Chrome inside a container
|
||||
process.env.CI ? '--no-sandbox' : null,
|
||||
'--headless',
|
||||
'--disable-gpu',
|
||||
'--disable-dev-shm-usage',
|
||||
'--disable-software-rasterizer',
|
||||
'--mute-audio',
|
||||
'--remote-debugging-port=0',
|
||||
'--window-size=1440,900'
|
||||
].filter(Boolean)
|
||||
}
|
||||
}
|
||||
};
|
33
lib/cli/test/fixtures/ember-cli/tests/index.html
vendored
33
lib/cli/test/fixtures/ember-cli/tests/index.html
vendored
@ -1,33 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>EmberFixture Tests</title>
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
{{content-for "head"}}
|
||||
{{content-for "test-head"}}
|
||||
|
||||
<link rel="stylesheet" href="{{rootURL}}assets/vendor.css">
|
||||
<link rel="stylesheet" href="{{rootURL}}assets/ember-fixture.css">
|
||||
<link rel="stylesheet" href="{{rootURL}}assets/test-support.css">
|
||||
|
||||
{{content-for "head-footer"}}
|
||||
{{content-for "test-head-footer"}}
|
||||
</head>
|
||||
<body>
|
||||
{{content-for "body"}}
|
||||
{{content-for "test-body"}}
|
||||
|
||||
<script src="/testem.js" integrity=""></script>
|
||||
<script src="{{rootURL}}assets/vendor.js"></script>
|
||||
<script src="{{rootURL}}assets/test-support.js"></script>
|
||||
<script src="{{rootURL}}assets/ember-fixture.js"></script>
|
||||
<script src="{{rootURL}}assets/tests.js"></script>
|
||||
|
||||
{{content-for "body-footer"}}
|
||||
{{content-for "test-body-footer"}}
|
||||
</body>
|
||||
</html>
|
@ -1,8 +0,0 @@
|
||||
import Application from '../app';
|
||||
import config from '../config/environment';
|
||||
import { setApplication } from '@ember/test-helpers';
|
||||
import { start } from 'ember-qunit';
|
||||
|
||||
setApplication(Application.create(config.APP));
|
||||
|
||||
start();
|
9
lib/cli/test/fixtures/marko/package.json
vendored
9
lib/cli/test/fixtures/marko/package.json
vendored
@ -1,9 +0,0 @@
|
||||
{
|
||||
"name": "marko-fixture",
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"marko": "^4.9.7"
|
||||
}
|
||||
}
|
1
lib/cli/test/fixtures/meteor/.gitignore
vendored
1
lib/cli/test/fixtures/meteor/.gitignore
vendored
@ -1 +0,0 @@
|
||||
node_modules/
|
@ -1,17 +0,0 @@
|
||||
# This file contains information which helps Meteor properly upgrade your
|
||||
# app when you run 'meteor update'. You should check it into version control
|
||||
# with your project.
|
||||
|
||||
notices-for-0.9.0
|
||||
notices-for-0.9.1
|
||||
0.9.4-platform-file
|
||||
notices-for-facebook-graph-api-2
|
||||
1.2.0-standard-minifiers-package
|
||||
1.2.0-meteor-platform-split
|
||||
1.2.0-cordova-changes
|
||||
1.2.0-breaking-changes
|
||||
1.3.0-split-minifiers-package
|
||||
1.4.0-remove-old-dev-bundle-link
|
||||
1.4.1-add-shell-server-package
|
||||
1.4.3-split-account-service-packages
|
||||
1.5-add-dynamic-import-package
|
@ -1 +0,0 @@
|
||||
local
|
7
lib/cli/test/fixtures/meteor/.meteor/.id
vendored
7
lib/cli/test/fixtures/meteor/.meteor/.id
vendored
@ -1,7 +0,0 @@
|
||||
# This file contains a token that is unique to your project.
|
||||
# Check it into your repository along with the rest of this directory.
|
||||
# It can be used for purposes such as:
|
||||
# - ensuring you don't accidentally deploy one app on top of another
|
||||
# - providing package authors with aggregated statistics
|
||||
|
||||
z9nshtsc5s3c33e5ya
|
21
lib/cli/test/fixtures/meteor/.meteor/packages
vendored
21
lib/cli/test/fixtures/meteor/.meteor/packages
vendored
@ -1,21 +0,0 @@
|
||||
# Meteor packages used by this project, one per line.
|
||||
# Check this file (and the other files in this directory) into your repository.
|
||||
#
|
||||
# 'meteor add' and 'meteor remove' will edit this file for you,
|
||||
# but you can also edit it by hand.
|
||||
|
||||
meteor-base@1.1.0 # Packages every Meteor app needs to have
|
||||
mobile-experience@1.0.4 # Packages for a great mobile UX
|
||||
mongo@1.1.19 # The database Meteor supports right now
|
||||
blaze-html-templates@1.0.4 # Compile .html files into Meteor Blaze views
|
||||
reactive-var@1.0.11 # Reactive variable for tracker
|
||||
tracker@1.1.3 # Meteor's client-side reactive programming library
|
||||
|
||||
standard-minifier-css@1.3.4 # CSS minifier run for production mode
|
||||
standard-minifier-js@2.1.1 # JS minifier run for production mode
|
||||
es5-shim@4.6.15 # ECMAScript 5 compatibility for older browsers
|
||||
ecmascript@0.8.1 # Enable ECMAScript2015+ syntax in app code
|
||||
shell-server@0.2.4 # Server-side component of the `meteor shell` command
|
||||
|
||||
autopublish@1.0.7 # Publish all data to the clients (for prototyping)
|
||||
insecure@1.0.7 # Allow all DB writes from clients (for prototyping)
|
@ -1,2 +0,0 @@
|
||||
server
|
||||
browser
|
1
lib/cli/test/fixtures/meteor/.meteor/release
vendored
1
lib/cli/test/fixtures/meteor/.meteor/release
vendored
@ -1 +0,0 @@
|
||||
METEOR@1.5.1
|
75
lib/cli/test/fixtures/meteor/.meteor/versions
vendored
75
lib/cli/test/fixtures/meteor/.meteor/versions
vendored
@ -1,75 +0,0 @@
|
||||
allow-deny@1.0.6
|
||||
autopublish@1.0.7
|
||||
autoupdate@1.3.12
|
||||
babel-compiler@6.19.4
|
||||
babel-runtime@1.0.1
|
||||
base64@1.0.10
|
||||
binary-heap@1.0.10
|
||||
blaze@2.3.2
|
||||
blaze-html-templates@1.1.2
|
||||
blaze-tools@1.0.10
|
||||
boilerplate-generator@1.1.1
|
||||
caching-compiler@1.1.9
|
||||
caching-html-compiler@1.1.2
|
||||
callback-hook@1.0.10
|
||||
check@1.2.5
|
||||
ddp@1.3.0
|
||||
ddp-client@2.0.0
|
||||
ddp-common@1.2.9
|
||||
ddp-server@2.0.0
|
||||
deps@1.0.12
|
||||
diff-sequence@1.0.7
|
||||
dynamic-import@0.1.1
|
||||
ecmascript@0.8.2
|
||||
ecmascript-runtime@0.4.1
|
||||
ecmascript-runtime-client@0.4.3
|
||||
ecmascript-runtime-server@0.4.1
|
||||
ejson@1.0.13
|
||||
es5-shim@4.6.15
|
||||
fastclick@1.0.13
|
||||
geojson-utils@1.0.10
|
||||
hot-code-push@1.0.4
|
||||
html-tools@1.0.11
|
||||
htmljs@1.0.11
|
||||
http@1.2.12
|
||||
id-map@1.0.9
|
||||
insecure@1.0.7
|
||||
jquery@1.11.10
|
||||
launch-screen@1.1.1
|
||||
livedata@1.0.18
|
||||
logging@1.1.17
|
||||
meteor@1.7.0
|
||||
meteor-base@1.1.0
|
||||
minifier-css@1.2.16
|
||||
minifier-js@2.1.1
|
||||
minimongo@1.2.1
|
||||
mobile-experience@1.0.4
|
||||
mobile-status-bar@1.0.14
|
||||
modules@0.9.2
|
||||
modules-runtime@0.8.0
|
||||
mongo@1.1.19
|
||||
mongo-id@1.0.6
|
||||
npm-mongo@2.2.24
|
||||
observe-sequence@1.0.16
|
||||
ordered-dict@1.0.9
|
||||
promise@0.8.9
|
||||
random@1.0.10
|
||||
reactive-var@1.0.11
|
||||
reload@1.1.11
|
||||
retry@1.0.9
|
||||
routepolicy@1.0.12
|
||||
shell-server@0.2.4
|
||||
spacebars@1.0.15
|
||||
spacebars-compiler@1.1.2
|
||||
standard-minifier-css@1.3.4
|
||||
standard-minifier-js@2.1.1
|
||||
templating@1.3.2
|
||||
templating-compiler@1.3.2
|
||||
templating-runtime@1.3.2
|
||||
templating-tools@1.1.2
|
||||
tracker@1.1.3
|
||||
ui@1.0.13
|
||||
underscore@1.0.10
|
||||
url@1.1.0
|
||||
webapp@1.3.17
|
||||
webapp-hashing@1.0.9
|
1
lib/cli/test/fixtures/meteor/client/main.css
vendored
1
lib/cli/test/fixtures/meteor/client/main.css
vendored
@ -1 +0,0 @@
|
||||
/* CSS declarations go here */
|
25
lib/cli/test/fixtures/meteor/client/main.html
vendored
25
lib/cli/test/fixtures/meteor/client/main.html
vendored
@ -1,25 +0,0 @@
|
||||
<head>
|
||||
<title>meteor</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Welcome to Meteor!</h1>
|
||||
|
||||
{{> hello}}
|
||||
{{> info}}
|
||||
</body>
|
||||
|
||||
<template name="hello">
|
||||
<button>Click Me</button>
|
||||
<p>You've pressed the button {{counter}} times.</p>
|
||||
</template>
|
||||
|
||||
<template name="info">
|
||||
<h2>Learn Meteor!</h2>
|
||||
<ul>
|
||||
<li><a href="https://www.meteor.com/try" target="_blank">Do the Tutorial</a></li>
|
||||
<li><a href="http://guide.meteor.com" target="_blank">Follow the Guide</a></li>
|
||||
<li><a href="https://docs.meteor.com" target="_blank">Read the Docs</a></li>
|
||||
<li><a href="https://forums.meteor.com" target="_blank">Discussions</a></li>
|
||||
</ul>
|
||||
</template>
|
22
lib/cli/test/fixtures/meteor/client/main.js
vendored
22
lib/cli/test/fixtures/meteor/client/main.js
vendored
@ -1,22 +0,0 @@
|
||||
import { Template } from 'meteor/templating';
|
||||
import { ReactiveVar } from 'meteor/reactive-var';
|
||||
|
||||
import './main.html';
|
||||
|
||||
Template.hello.onCreated(function helloOnCreated() {
|
||||
// counter starts at 0
|
||||
this.counter = new ReactiveVar(0);
|
||||
});
|
||||
|
||||
Template.hello.helpers({
|
||||
counter() {
|
||||
return Template.instance().counter.get();
|
||||
},
|
||||
});
|
||||
|
||||
Template.hello.events({
|
||||
'click button'(event, instance) {
|
||||
// increment the counter when button is clicked
|
||||
instance.counter.set(instance.counter.get() + 1);
|
||||
},
|
||||
});
|
12
lib/cli/test/fixtures/meteor/package.json
vendored
12
lib/cli/test/fixtures/meteor/package.json
vendored
@ -1,12 +0,0 @@
|
||||
{
|
||||
"name": "meteor-fixture",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "meteor run"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "7.0.0",
|
||||
"meteor-node-stubs": "~0.2.4"
|
||||
}
|
||||
}
|
5
lib/cli/test/fixtures/meteor/server/main.js
vendored
5
lib/cli/test/fixtures/meteor/server/main.js
vendored
@ -1,5 +0,0 @@
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
|
||||
Meteor.startup(() => {
|
||||
// code to run on server at startup
|
||||
});
|
13
lib/cli/test/fixtures/mithril/package.json
vendored
13
lib/cli/test/fixtures/mithril/package.json
vendored
@ -1,13 +0,0 @@
|
||||
{
|
||||
"name": "mithril-fixture",
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build": "webpack -p dist"
|
||||
},
|
||||
"dependencies": {
|
||||
"mithril": "^1.1.6"
|
||||
},
|
||||
"devDependencies": {}
|
||||
}
|
4
lib/cli/test/fixtures/react/.babelrc
vendored
4
lib/cli/test/fixtures/react/.babelrc
vendored
@ -1,4 +0,0 @@
|
||||
{
|
||||
"presets": ["@babel/preset-react"],
|
||||
"plugins": ["@babel/plugin-external-helpers"]
|
||||
}
|
11
lib/cli/test/fixtures/react/index.html
vendored
11
lib/cli/test/fixtures/react/index.html
vendored
@ -1,11 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Hello world</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script src="dist/bundle.js"></script>
|
||||
</body>
|
||||
</html>
|
7
lib/cli/test/fixtures/react/index.js
vendored
7
lib/cli/test/fixtures/react/index.js
vendored
@ -1,7 +0,0 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
|
||||
ReactDOM.render(
|
||||
<h1>Hello, world!</h1>,
|
||||
document.getElementById('root')
|
||||
);
|
22
lib/cli/test/fixtures/react/package.json
vendored
22
lib/cli/test/fixtures/react/package.json
vendored
@ -1,22 +0,0 @@
|
||||
{
|
||||
"name": "react-fixture",
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build": "rollup -c"
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/plugin-external-helpers": "7.2.0",
|
||||
"@babel/preset-react": "7.0.0",
|
||||
"rollup": "^1.4.1",
|
||||
"rollup-plugin-babel": "^4.3.2",
|
||||
"rollup-plugin-commonjs": "^9.2.1",
|
||||
"rollup-plugin-node-resolve": "^4.0.1",
|
||||
"rollup-plugin-replace": "^2.1.0"
|
||||
}
|
||||
}
|
22
lib/cli/test/fixtures/react/rollup.config.js
vendored
22
lib/cli/test/fixtures/react/rollup.config.js
vendored
@ -1,22 +0,0 @@
|
||||
import replace from 'rollup-plugin-replace';
|
||||
import commonjs from 'rollup-plugin-commonjs';
|
||||
import resolve from 'rollup-plugin-node-resolve';
|
||||
import babel from 'rollup-plugin-babel';
|
||||
|
||||
export default {
|
||||
input: 'index.js',
|
||||
output: {
|
||||
file: 'dist/bundle.js',
|
||||
format: 'iife'
|
||||
},
|
||||
plugins: [
|
||||
replace({
|
||||
'process.env.NODE_ENV': JSON.stringify('production')
|
||||
}),
|
||||
commonjs(),
|
||||
resolve(),
|
||||
babel({
|
||||
exclude: 'node_modules/**' // only transpile our source code
|
||||
})
|
||||
]
|
||||
};
|
@ -1,3 +0,0 @@
|
||||
module.exports = {
|
||||
stories: ['../stories/**/*.stories.js'],
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
['@babel/preset-env', { shippedProposals: true, useBuiltIns: 'usage', corejs: '3' }],
|
||||
'@babel/preset-react',
|
||||
],
|
||||
plugins: ['@babel/plugin-proposal-optional-chaining'],
|
||||
};
|
@ -1,21 +0,0 @@
|
||||
{
|
||||
"name": "react-babel-config-js-fixture",
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"main": "stories/index.stories.js",
|
||||
"scripts": {
|
||||
"build-storybook": "build-storybook",
|
||||
"storybook": "start-storybook -p 6006"
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.3.4",
|
||||
"@babel/plugin-proposal-optional-chaining": "7.0.0",
|
||||
"@babel/preset-env": "^7.4.1",
|
||||
"@babel/preset-react": "^7.0.0",
|
||||
"babel-loader": "^8.0.5"
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"presets": ["./babel-preset-custom"]
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
module.exports = {
|
||||
stories: ['../stories/**/*.stories.js'],
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
module.exports = () => ({
|
||||
plugins: ['@babel/plugin-proposal-optional-chaining'],
|
||||
});
|
@ -1,19 +0,0 @@
|
||||
{
|
||||
"name": "react-babel-custom-preset-fixture",
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"main": "stories/index.stories.js",
|
||||
"scripts": {
|
||||
"build-storybook": "build-storybook",
|
||||
"storybook": "start-storybook -p 6006"
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.3.4",
|
||||
"@babel/plugin-proposal-optional-chaining": "7.0.0",
|
||||
"babel-loader": "^8.0.5"
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
module.exports = {
|
||||
stories: ['../stories/**/*.stories.js'],
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
{
|
||||
"name": "react-babel-pkg-json-fixture",
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"main": "stories/index.stories.js",
|
||||
"scripts": {
|
||||
"build-storybook": "build-storybook",
|
||||
"storybook": "start-storybook -p 6006"
|
||||
},
|
||||
"babel": {
|
||||
"plugins": [
|
||||
"@babel/plugin-proposal-optional-chaining"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.3.4",
|
||||
"@babel/plugin-proposal-optional-chaining": "7.0.0",
|
||||
"babel-loader": "^8.0.5"
|
||||
}
|
||||
}
|
3
lib/cli/test/fixtures/react_babelrc/.babelrc
vendored
3
lib/cli/test/fixtures/react_babelrc/.babelrc
vendored
@ -1,3 +0,0 @@
|
||||
{
|
||||
"plugins": ["@babel/plugin-proposal-optional-chaining"]
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
module.exports = {
|
||||
stories: ['../stories/**/*.stories.js'],
|
||||
}
|
19
lib/cli/test/fixtures/react_babelrc/package.json
vendored
19
lib/cli/test/fixtures/react_babelrc/package.json
vendored
@ -1,19 +0,0 @@
|
||||
{
|
||||
"name": "react-babelrc-fixture",
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"main": "stories/index.stories.js",
|
||||
"scripts": {
|
||||
"build-storybook": "build-storybook",
|
||||
"storybook": "start-storybook -p 6006"
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.3.4",
|
||||
"@babel/plugin-proposal-optional-chaining": "7.0.0",
|
||||
"babel-loader": "^8.0.5"
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
module.exports = {
|
||||
plugins: ['@babel/plugin-proposal-optional-chaining'],
|
||||
};
|
@ -1,3 +0,0 @@
|
||||
module.exports = {
|
||||
stories: ['../stories/**/*.stories.js'],
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
{
|
||||
"name": "react-babelrc-js-fixture",
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"main": "stories/index.stories.js",
|
||||
"scripts": {
|
||||
"build-storybook": "build-storybook",
|
||||
"storybook": "start-storybook -p 6006"
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.3.4",
|
||||
"@babel/plugin-proposal-optional-chaining": "7.0.0",
|
||||
"babel-loader": "^8.0.5"
|
||||
}
|
||||
}
|
3
lib/cli/test/fixtures/react_project/.babelrc
vendored
3
lib/cli/test/fixtures/react_project/.babelrc
vendored
@ -1,3 +0,0 @@
|
||||
{
|
||||
"presets": ["@babel/preset-env", "@babel/preset-react"]
|
||||
}
|
6
lib/cli/test/fixtures/react_project/index.js
vendored
6
lib/cli/test/fixtures/react_project/index.js
vendored
@ -1,6 +0,0 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
|
||||
export default function Welcome(props) {
|
||||
return <h1>Hello, {props.name}</h1>;
|
||||
}
|
16
lib/cli/test/fixtures/react_project/package.json
vendored
16
lib/cli/test/fixtures/react_project/package.json
vendored
@ -1,16 +0,0 @@
|
||||
{
|
||||
"name": "react-project-fixture",
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build": "babel index.js -d dist"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.2.3",
|
||||
"@babel/preset-env": "^7.4.1",
|
||||
"@babel/preset-react": "7.0.0",
|
||||
"react": "^16.8.0 || ^17.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0"
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"extends": "react-static/.babelrc"
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
# dependencies
|
||||
/node_modules
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# production
|
||||
/dist
|
||||
/tmp
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
@ -1,9 +0,0 @@
|
||||
# React-Static - Blank Example
|
||||
|
||||
This example is a blank version of react-static. It includes::
|
||||
- Babel
|
||||
- CSS imports
|
||||
- Image imports
|
||||
- File imports
|
||||
|
||||
To get started, run `react-static create` and use the `blank` template.
|
@ -1,24 +0,0 @@
|
||||
{
|
||||
"name": "react-static-next-fixture",
|
||||
"version": "1.0.1",
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build": "react-static build",
|
||||
"serve": "serve dist -p 3000",
|
||||
"stage": "react-static build --staging",
|
||||
"start": "react-static start"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.18.0",
|
||||
"react": "^16.8.0 || ^17.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0",
|
||||
"react-hot-loader": "^4.7.2",
|
||||
"react-router": "^4.3.1",
|
||||
"react-static": "^6.3.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint-config-react-tools": "1.x.x",
|
||||
"serve": "^6.1.0"
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
User-agent: *
|
@ -1,23 +0,0 @@
|
||||
import React, { Component } from 'react'
|
||||
import { hot } from 'react-hot-loader'
|
||||
//
|
||||
import './app.css'
|
||||
import logo from './logo.png'
|
||||
|
||||
class App extends Component {
|
||||
render () {
|
||||
return (
|
||||
<div className="App">
|
||||
<header className="App-header">
|
||||
<img src={logo} className="App-logo" alt="logo" />
|
||||
<h1 className="App-title">Welcome to React-Static</h1>
|
||||
</header>
|
||||
<p className="App-intro">
|
||||
To get started, edit <code>src/App.js</code> and save to reload.
|
||||
</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default hot(module)(App)
|
@ -1,41 +0,0 @@
|
||||
body {
|
||||
font-family: 'HelveticaNeue-Light', 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial,
|
||||
'Lucida Grande', sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 16px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.App {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.App-logo {
|
||||
animation: App-logo-spin infinite 20s linear;
|
||||
height: 120px;
|
||||
}
|
||||
|
||||
.App-header {
|
||||
background-color: #ddd;
|
||||
height: 170px;
|
||||
padding: 20px;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.App-title {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
.App-intro {
|
||||
font-size: large;
|
||||
}
|
||||
|
||||
@keyframes App-logo-spin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
import React from 'react'
|
||||
import ReactDOM from 'react-dom'
|
||||
|
||||
// Your top level component
|
||||
import App from './App'
|
||||
|
||||
// Export your top level component as JSX (for static rendering)
|
||||
export default App
|
||||
|
||||
// Render your app
|
||||
if (typeof document !== 'undefined') {
|
||||
const renderMethod = module.hot ? ReactDOM.render : ReactDOM.hydrate || ReactDOM.render
|
||||
const render = Comp => {
|
||||
renderMethod(<Comp />, document.getElementById('root'))
|
||||
}
|
||||
|
||||
// Render!
|
||||
render(App)
|
||||
}
|
BIN
lib/cli/test/fixtures/react_static_next/src/logo.png
vendored
BIN
lib/cli/test/fixtures/react_static_next/src/logo.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 52 KiB |
@ -1,3 +0,0 @@
|
||||
// Though this file is optional, there are SO MANY COOL THINGS you can do here.
|
||||
// Read the docs at https://github.com/nozzle/react-static/blob/master/README.md to learn more!
|
||||
export default {}
|
12
lib/cli/test/fixtures/riot/.editorconfig
vendored
12
lib/cli/test/fixtures/riot/.editorconfig
vendored
@ -1,12 +0,0 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
4
lib/cli/test/fixtures/riot/.gitignore
vendored
4
lib/cli/test/fixtures/riot/.gitignore
vendored
@ -1,4 +0,0 @@
|
||||
.DS_Store
|
||||
node_modules/
|
||||
dist/
|
||||
npm-debug.log
|
39
lib/cli/test/fixtures/riot/README.md
vendored
39
lib/cli/test/fixtures/riot/README.md
vendored
@ -1,39 +0,0 @@
|
||||
# riot
|
||||
|
||||
> A riot.js project
|
||||
|
||||
## Build setup
|
||||
|
||||
### [yarn](https://yarnpkg.com) - recommend
|
||||
|
||||
```bash
|
||||
# Install dependencies
|
||||
yarn install
|
||||
|
||||
# Server with hot reload at localhost:8080
|
||||
yarn run dev
|
||||
|
||||
# Build for production with minification
|
||||
yarn run build
|
||||
```
|
||||
|
||||
### [npm](https://www.npmjs.com/)
|
||||
|
||||
```bash
|
||||
# Install dependencies
|
||||
npm install
|
||||
|
||||
# Server with hot reload at localhost:8080
|
||||
npm run dev
|
||||
|
||||
# Build for production with minification
|
||||
npm run build
|
||||
```
|
||||
|
||||
## Reference
|
||||
|
||||
- For detailed explanation on how things work, consult the [docs for riot-tag-loader](https://github.com/riot/tag-loader).
|
||||
|
||||
## License
|
||||
|
||||
MIT © hypnos <mailto:Filipp.Riabchun@jetbrains.com>
|
28
lib/cli/test/fixtures/riot/package.json
vendored
28
lib/cli/test/fixtures/riot/package.json
vendored
@ -1,28 +0,0 @@
|
||||
{
|
||||
"name": "riot-fixture",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"description": "A riot.js project",
|
||||
"author": "hypnos <Filipp.Riabchun@jetbrains.com>",
|
||||
"scripts": {
|
||||
"build:js": "cross-env NODE_ENV=production webpack",
|
||||
"dev": "cross-env NODE_ENV=development webpack"
|
||||
},
|
||||
"dependencies": {
|
||||
"riot": "^3.11.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-loader": "^8.0.5",
|
||||
"cross-env": "^5.2.0",
|
||||
"css-loader": "^2.1.0",
|
||||
"packer-webpack-plugin": "^0.0.5",
|
||||
"raw-loader": "^1.0.0",
|
||||
"riot-compiler": "^3.6.0",
|
||||
"riot-hot-reload": "^1.0.0",
|
||||
"riot-tmpl": "^3.0.8",
|
||||
"style-loader": "^0.23.1",
|
||||
"webpack": "^4.44.2",
|
||||
"webpack-bundle-analyzer": "^3.3.2",
|
||||
"webpack-cli": "^3.2.3"
|
||||
}
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 33 KiB |
15
lib/cli/test/fixtures/riot/public/index.html
vendored
15
lib/cli/test/fixtures/riot/public/index.html
vendored
@ -1,15 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>riot</title>
|
||||
<link rel="stylesheet" href="assets/css/app.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script src="assets/js/app.js"></script>
|
||||
</body>
|
||||
</html>
|
30
lib/cli/test/fixtures/riot/src/App.tag
vendored
30
lib/cli/test/fixtures/riot/src/App.tag
vendored
@ -1,30 +0,0 @@
|
||||
<template>
|
||||
<div class="app">
|
||||
<hello></hello>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
riot.mount('hello', {});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
body {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.app {
|
||||
color: #444;
|
||||
margin-top: 100px;
|
||||
max-width: 600px;
|
||||
font-family: Helvetica, sans-serif;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
</template>
|
@ -1,18 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<img src="assets/images/logo.png">
|
||||
<h1>{{ msg }}</h1>
|
||||
<hello/>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
riot.mount('hello', {msg: 'riot.js - Simple and elegant component-based UI library'})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
h1 {
|
||||
padding: 0 .25em;
|
||||
}
|
||||
</style>
|
||||
|
||||
</template>
|
5
lib/cli/test/fixtures/riot/src/main.js
vendored
5
lib/cli/test/fixtures/riot/src/main.js
vendored
@ -1,5 +0,0 @@
|
||||
import App from './App.tag'
|
||||
import Hello from './components/Hello.tag'
|
||||
import { mount } from 'riot'
|
||||
|
||||
mount('#app', 'app', {})
|
24
lib/cli/test/fixtures/riot/webpack.config.js
vendored
24
lib/cli/test/fixtures/riot/webpack.config.js
vendored
@ -1,24 +0,0 @@
|
||||
module.exports = {
|
||||
target: 'web',
|
||||
mode: 'production',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tag$/,
|
||||
use: { loader: 'riot-tag-loader' }
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
use: { loader: 'babel-loader' },
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [
|
||||
{ loader: 'style-loader' },
|
||||
{ loader: 'css-loader', options: { sourceMap: true } }
|
||||
]
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
19
lib/cli/test/fixtures/sfc_vue/.babelrc
vendored
19
lib/cli/test/fixtures/sfc_vue/.babelrc
vendored
@ -1,19 +0,0 @@
|
||||
{
|
||||
"presets": [
|
||||
["@babel/preset-env", {
|
||||
"modules": false,
|
||||
"targets": {
|
||||
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
|
||||
}
|
||||
}]
|
||||
],
|
||||
"plugins": ["@babel/plugin-transform-runtime"],
|
||||
"env": {
|
||||
"test": {
|
||||
"presets": [
|
||||
"@babel/preset-env"
|
||||
],
|
||||
"plugins": ["istanbul"]
|
||||
}
|
||||
}
|
||||
}
|
9
lib/cli/test/fixtures/sfc_vue/.editorconfig
vendored
9
lib/cli/test/fixtures/sfc_vue/.editorconfig
vendored
@ -1,9 +0,0 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
13
lib/cli/test/fixtures/sfc_vue/.gitignore
vendored
13
lib/cli/test/fixtures/sfc_vue/.gitignore
vendored
@ -1,13 +0,0 @@
|
||||
.DS_Store
|
||||
node_modules/
|
||||
dist/
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
21
lib/cli/test/fixtures/sfc_vue/README.md
vendored
21
lib/cli/test/fixtures/sfc_vue/README.md
vendored
@ -1,21 +0,0 @@
|
||||
# sfc_vue
|
||||
|
||||
> A Vue.js project
|
||||
|
||||
## Build Setup
|
||||
|
||||
```bash
|
||||
# install dependencies
|
||||
npm install
|
||||
|
||||
# serve with hot reload at localhost:8080
|
||||
npm run dev
|
||||
|
||||
# build for production with minification
|
||||
npm run build
|
||||
|
||||
# build for production and view the bundle analyzer report
|
||||
npm run build --report
|
||||
```
|
||||
|
||||
For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
|
@ -1,6 +0,0 @@
|
||||
var merge = require('webpack-merge')
|
||||
var prodEnv = require('./prod.env')
|
||||
|
||||
module.exports = merge(prodEnv, {
|
||||
NODE_ENV: '"development"'
|
||||
})
|
38
lib/cli/test/fixtures/sfc_vue/config/index.js
vendored
38
lib/cli/test/fixtures/sfc_vue/config/index.js
vendored
@ -1,38 +0,0 @@
|
||||
// see http://vuejs-templates.github.io/webpack for documentation.
|
||||
var path = require('path')
|
||||
|
||||
module.exports = {
|
||||
build: {
|
||||
env: require('./prod.env'),
|
||||
index: path.resolve(__dirname, '../dist/index.html'),
|
||||
assetsRoot: path.resolve(__dirname, '../dist'),
|
||||
assetsSubDirectory: 'static',
|
||||
assetsPublicPath: '/',
|
||||
productionSourceMap: true,
|
||||
// Gzip off by default as many popular static hosts such as
|
||||
// Surge or Netlify already gzip all static assets for you.
|
||||
// Before setting to `true`, make sure to:
|
||||
// npm install --save-dev compression-webpack-plugin
|
||||
productionGzip: false,
|
||||
productionGzipExtensions: ['js', 'css'],
|
||||
// Run the build command with an extra argument to
|
||||
// View the bundle analyzer report after build finishes:
|
||||
// `npm run build --report`
|
||||
// Set to `true` or `false` to always turn it on or off
|
||||
bundleAnalyzerReport: process.env.npm_config_report
|
||||
},
|
||||
dev: {
|
||||
env: require('./dev.env'),
|
||||
port: 8080,
|
||||
autoOpenBrowser: true,
|
||||
assetsSubDirectory: 'static',
|
||||
assetsPublicPath: '/',
|
||||
proxyTable: {},
|
||||
// CSS Sourcemaps off by default because relative paths are "buggy"
|
||||
// with this option, according to the CSS-Loader README
|
||||
// (https://github.com/webpack/css-loader#sourcemaps)
|
||||
// In our experience, they generally work as expected,
|
||||
// just be aware of this issue when enabling this option.
|
||||
cssSourceMap: false
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
module.exports = {
|
||||
NODE_ENV: '"production"'
|
||||
}
|
11
lib/cli/test/fixtures/sfc_vue/index.html
vendored
11
lib/cli/test/fixtures/sfc_vue/index.html
vendored
@ -1,11 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>sfc_vue</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
</html>
|
61
lib/cli/test/fixtures/sfc_vue/package.json
vendored
61
lib/cli/test/fixtures/sfc_vue/package.json
vendored
@ -1,61 +0,0 @@
|
||||
{
|
||||
"name": "sfc-vue-fixture",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"description": "A Vue.js project",
|
||||
"author": "hypnos <Filipp.Riabchun@jetbrains.com>",
|
||||
"scripts": {
|
||||
"build": "node build/build.js",
|
||||
"dev": "node build/dev-server.js",
|
||||
"start": "node build/dev-server.js"
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions",
|
||||
"not ie <= 8"
|
||||
],
|
||||
"dependencies": {
|
||||
"vue": "^2.6.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.3.4",
|
||||
"@babel/plugin-transform-runtime": "^7.1.0",
|
||||
"@babel/preset-env": "^7.4.1",
|
||||
"@babel/preset-stage-2": "^7.0.0",
|
||||
"@babel/register": "^7.0.0",
|
||||
"@storybook/semver": "^7.3.2",
|
||||
"autoprefixer": "^9.4.9",
|
||||
"babel-core": "^7.0.0-bridge.0",
|
||||
"babel-loader": "^8.0.5",
|
||||
"chalk": "^2.4.2",
|
||||
"connect-history-api-fallback": "^1.6.0",
|
||||
"copy-webpack-plugin": "^5.0.0",
|
||||
"css-loader": "^2.1.0",
|
||||
"cssnano": "^4.1.10",
|
||||
"eventsource-polyfill": "^0.9.6",
|
||||
"express": "^4.16.4",
|
||||
"extract-text-webpack-plugin": "^3.0.2",
|
||||
"file-loader": "^3.0.1",
|
||||
"friendly-errors-webpack-plugin": "^1.7.0",
|
||||
"html-webpack-plugin": "^4.0.0-beta.2",
|
||||
"http-proxy-middleware": "^0.19.1",
|
||||
"open": "^6.1.0",
|
||||
"optimize-css-assets-webpack-plugin": "^2.0.0",
|
||||
"ora": "^3.2.0",
|
||||
"rimraf": "^2.6.3",
|
||||
"shelljs": "^0.8.4",
|
||||
"url-loader": "^1.1.2",
|
||||
"vue-loader": "15.7.0",
|
||||
"vue-style-loader": "^4.1.2",
|
||||
"vue-template-compiler": "^2.6.8",
|
||||
"webpack": "^4.44.2",
|
||||
"webpack-bundle-analyzer": "^3.3.2",
|
||||
"webpack-dev-middleware": "^3.6.0",
|
||||
"webpack-hot-middleware": "^2.24.3",
|
||||
"webpack-merge": "^4.2.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 4.0.0",
|
||||
"npm": ">= 3.0.0"
|
||||
}
|
||||
}
|
28
lib/cli/test/fixtures/sfc_vue/src/App.vue
vendored
28
lib/cli/test/fixtures/sfc_vue/src/App.vue
vendored
@ -1,28 +0,0 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<img src="./assets/logo.png">
|
||||
<hello></hello>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Hello from './components/Hello'
|
||||
|
||||
export default {
|
||||
name: 'app',
|
||||
components: {
|
||||
Hello
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
#app {
|
||||
font-family: 'Avenir', Helvetica, Arial, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
text-align: center;
|
||||
color: #2c3e50;
|
||||
margin-top: 60px;
|
||||
}
|
||||
</style>
|
BIN
lib/cli/test/fixtures/sfc_vue/src/assets/logo.png
vendored
BIN
lib/cli/test/fixtures/sfc_vue/src/assets/logo.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 5.7 KiB |
@ -1,53 +0,0 @@
|
||||
<template>
|
||||
<div class="hello">
|
||||
<h1>{{ msg }}</h1>
|
||||
<h2>Essential Links</h2>
|
||||
<ul>
|
||||
<li><a href="https://vuejs.org" target="_blank">Core Docs</a></li>
|
||||
<li><a href="https://forum.vuejs.org" target="_blank">Forum</a></li>
|
||||
<li><a href="https://chat.vuejs.org" target="_blank">Community Chat</a></li>
|
||||
<li><a href="https://twitter.com/vuejs" target="_blank">Twitter</a></li>
|
||||
<br>
|
||||
<li><a href="http://vuejs-templates.github.io/webpack/" target="_blank">Docs for This Template</a></li>
|
||||
</ul>
|
||||
<h2>Ecosystem</h2>
|
||||
<ul>
|
||||
<li><a href="http://router.vuejs.org/" target="_blank">vue-router</a></li>
|
||||
<li><a href="http://vuex.vuejs.org/" target="_blank">vuex</a></li>
|
||||
<li><a href="http://vue-loader.vuejs.org/" target="_blank">vue-loader</a></li>
|
||||
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank">awesome-vue</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'hello',
|
||||
data () {
|
||||
return {
|
||||
msg: 'Welcome to Your Vue.js App'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||
<style scoped>
|
||||
h1, h2 {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
li {
|
||||
display: inline-block;
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #42b983;
|
||||
}
|
||||
</style>
|
13
lib/cli/test/fixtures/sfc_vue/src/main.js
vendored
13
lib/cli/test/fixtures/sfc_vue/src/main.js
vendored
@ -1,13 +0,0 @@
|
||||
// The Vue build version to load with the `import` command
|
||||
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
|
||||
import Vue from 'vue'
|
||||
import App from './App'
|
||||
|
||||
Vue.config.productionTip = false
|
||||
|
||||
/* eslint-disable no-new */
|
||||
new Vue({
|
||||
el: '#app',
|
||||
template: '<App/>',
|
||||
components: { App }
|
||||
})
|
@ -1,18 +0,0 @@
|
||||
# See https://help.github.com/ignore-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
.env
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
@ -1,3 +0,0 @@
|
||||
module.exports = {
|
||||
stories: ['../stories/**/*.stories.js'],
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,21 +0,0 @@
|
||||
{
|
||||
"name": "update-package-organisations-fixture",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "react-scripts build",
|
||||
"build-storybook": "build-storybook",
|
||||
"eject": "react-scripts eject",
|
||||
"start": "react-scripts start",
|
||||
"storybook": "start-storybook -p 6006",
|
||||
"test": "react-scripts test --env=jsdom"
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0",
|
||||
"react-scripts": "0.9.x"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@kadira/storybook": "^2.21.0"
|
||||
}
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 24 KiB |
@ -1,31 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
|
||||
<!--
|
||||
Notice the use of %PUBLIC_URL% in the tag above.
|
||||
It will be replaced with the URL of the `public` folder during the build.
|
||||
Only files inside the `public` folder can be referenced from the HTML.
|
||||
|
||||
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
||||
work correctly both with client-side routing and a non-root public URL.
|
||||
Learn how to configure a non-root public URL by running `npm run build`.
|
||||
-->
|
||||
<title>React App</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<!--
|
||||
This HTML file is a template.
|
||||
If you open it directly in the browser, you will see an empty page.
|
||||
|
||||
You can add webfonts, meta tags, or analytics to this file.
|
||||
The build step will place the bundled scripts into the <body> tag.
|
||||
|
||||
To begin the development, run `npm start`.
|
||||
To create a production bundle, use `npm run build`.
|
||||
-->
|
||||
</body>
|
||||
</html>
|
@ -1,15 +0,0 @@
|
||||
{
|
||||
"short_name": "React App",
|
||||
"name": "Create React App Sample",
|
||||
"icons": [
|
||||
{
|
||||
"src": "favicon.ico",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png"
|
||||
}
|
||||
],
|
||||
"start_url": "./index.html",
|
||||
"display": "standalone",
|
||||
"theme_color": "#000000",
|
||||
"background_color": "#ffffff"
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user