Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(storybook): fix Storybook #1986

Merged
merged 26 commits into from
Oct 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a342466
update sb, ts-loader config
kamranayub Aug 6, 2021
5263be3
Remove webpack-terser-plugin
kamranayub Aug 6, 2021
0a90b8c
wip migrate to controls
kamranayub Aug 6, 2021
82f193f
storybook launches
kamranayub Aug 6, 2021
567dcc1
wip actions
kamranayub Aug 6, 2021
3fc162d
storybook works!!
kamranayub Aug 6, 2021
3633752
chore(ci): add build sb step
kamranayub Aug 7, 2021
e6ab18f
remove asset/resource thing
kamranayub Aug 7, 2021
d4a17c7
remove excess config
kamranayub Aug 7, 2021
a91b9e8
remove preview.js
kamranayub Aug 7, 2021
a8c83c5
update control arg types
kamranayub Aug 7, 2021
148f813
disable source-loader due to issue with graphics.add expressions
kamranayub Aug 7, 2021
04581a9
show
kamranayub Aug 7, 2021
ff47e11
fix animation stories
kamranayub Aug 11, 2021
8314874
Fix up camera/scene init lifecycle to support pos setting
eonarheim Aug 14, 2021
e4a960f
Fix pos handle on camera
eonarheim Aug 14, 2021
acc7bac
Respect actor anchors in graphics
eonarheim Aug 14, 2021
5bea66e
Adjust graphics.predraw to work like it did before
eonarheim Aug 14, 2021
fb6af0e
Tweak stories slightly for new graphics
eonarheim Aug 14, 2021
f00aa27
Fix tests
eonarheim Aug 14, 2021
4e6a4e0
update anchor stories
kamranayub Aug 11, 2021
bf7bf5a
Merge branch 'main' of https://github.com/excaliburjs/Excalibur into …
kamranayub Oct 9, 2021
5cca735
docs: readme and contributing
kamranayub Oct 9, 2021
7abae34
update for breaking changes
kamranayub Oct 9, 2021
a958265
center cam on hearts
kamranayub Oct 9, 2021
374945b
revert webpack config
eonarheim Oct 16, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ public someFunction() {...}

#### Code Organization

Excalibur uses an AMD bundler using TypeScript to generate a browser self-bootstrapping bundle.
Excalibur uses Webpack with TypeScript to bundle code.

The Excalibur public API (i.e. `ex.*`) is defined in `src/engine/index.ts`. Any new classes or APIs that should be made available publicly should be exported there. The AMD bundler will then ensure the APIs or classes are exposed in the browser.
The Excalibur public API (i.e. `ex.*`) is defined in `src/engine/index.ts`. Any new classes or APIs that should be made available publicly should be exported there. The bundler will then ensure the APIs or classes are exposed in the browser.

An example of exporting all public members from a new `MyClass.ts` that contains a `MyClass` ES6 class:

Expand All @@ -123,9 +123,9 @@ export { feature as Feature };

A number of our code formatting rules are enforced via linting. When you build Excalibur on your computer, the linter will make sure that certain aspects of your code are formatted properly. Additionally:

- Use 3 spaces for indenting
- Use 2 spaces for indenting
- All methods must explicitly specify their access modifier (public, private, etc.)
- Use the CamelCase naming convention, with a lowercase first letter for variables.
- Use the `TitleCase` naming convention for classes/interfaces, with a lowercase first letter for variables (`camelCase`).

#### Commit Messages

Expand Down Expand Up @@ -187,6 +187,12 @@ describe('a monkey', () => {
});
```

#### Visual Examples

Excalibur uses Storybook for writing visual tests and examples. These can be interactive and showcase different parts of the engine or specific features. We sometimes embed these examples in the documentation site.

Use `npm run visual` to start Storybook. Stories are written in the `src/stories` directory.

#### Documentation

- Add JSDoc comments to all public and protected methods
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

strategy:
matrix:
node-version: [12.x]
node-version: [14.x]

steps:
- uses: actions/checkout@v2
Expand All @@ -40,7 +40,8 @@ jobs:
${{ runner.os }}-node-
- run: npm ci
- run: npm run linux:ci
- name: Coveralls
- run: npm run build-storybook
- name: Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

strategy:
matrix:
node-version: [12.x]
node-version: [14.x]

steps:
- uses: actions/checkout@v2
Expand Down
20 changes: 17 additions & 3 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
const path = require('path');

module.exports = {
addons: ['@storybook/addon-docs', '@storybook/addon-knobs/register', '@storybook/addon-actions/register'],
stories: ['../src/stories/*.stories.ts'],
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
core: {
builder: 'webpack5'
},
webpackFinal: async (config, { configType }) => {
config.module.rules.push({
test: /\.(ts|tsx)$/,
test: /\.glsl$/,
use: ['raw-loader']
});

config.module.rules.push({
test: /\.(tsx?)$/,
use: [
{
loader: require.resolve('ts-loader'),
Expand All @@ -15,7 +23,13 @@ module.exports = {
}
]
});
config.resolve.extensions.push('.ts', '.tsx');

const sourceLoader = config.module.rules.findIndex((r) => r.loader && r.loader.includes('source-loader'));

if (sourceLoader > -1) {
// TODO: Investigate why source-loader is messing with graphics.add(string, object); expressions
config.module.rules.splice(sourceLoader, 1);
}

if (configType === 'PRODUCTION') {
config.mode = 'development';
Expand Down
1 change: 0 additions & 1 deletion .storybook/preview.js

This file was deleted.

8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,8 @@ npm run build
npm test
npm run test

# Compile HTML visual tests
# Useful to ensure HTML sandbox compiles
npm run visual

# Start sandbox dev server (long-running)
# Run in separate terminal alongside `npm run visual`
# Start Storybook-based sandbox
# Used for creating interactive visual tests and examples for docs
npm run sandbox

# Compile API docs
Expand Down
Loading