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

CLI: Move all templates out of cli into renderers #19664

Merged
merged 2 commits into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
7 changes: 7 additions & 0 deletions code/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,12 @@ module.exports = {
'no-undef': 'off', // ignore "window" undef errors
},
},
{
// Because those templates reference css files in other directory.
files: ['**/template/cli/**/*'],
rules: {
'import/no-unresolved': 'off',
},
},
],
};
14 changes: 8 additions & 6 deletions code/frameworks/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
"url": "https://opencollective.com/storybook"
},
"license": "MIT",
"main": "dist/types/index.js",
"module": "dist/types/index.js",
"types": "dist/types/index.d.ts",
"main": "dist/index.js",
kasperpeulen marked this conversation as resolved.
Show resolved Hide resolved
"types": "dist/index.d.ts",
"files": [
"dist/**/*",
"template/**/*",
"README.md",
"*.js",
"*.d.ts"
],
"scripts": {
"check": "../../../scripts/node_modules/.bin/tsc --noEmit",
"prep": "node ../../../scripts/prepare.js"
"check": "../../../scripts/node_modules/.bin/tsc",
kasperpeulen marked this conversation as resolved.
Show resolved Hide resolved
"prep": "rimraf dist && ../../../scripts/node_modules/.bin/tsc --project tsconfig.build.json && echo \"Preventing passing flags to tsc\""
},
"dependencies": {
"@storybook/addons": "7.0.0-alpha.46",
Expand Down Expand Up @@ -77,11 +77,13 @@
"@angular/platform-browser": "^13.3.6",
"@angular/platform-browser-dynamic": "^13.3.6",
"@nrwl/workspace": "14.6.1",
"@types/rimraf": "^3.0.2",
"@types/tmp": "^0.2.3",
"cross-spawn": "^7.0.3",
"jest": "^27.5.1",
"jest-preset-angular": "^12.0.0",
"jest-specific-snapshot": "^5.0.0",
"rimraf": "^3.0.2",
"tmp": "^0.2.1",
"typescript": "~4.6.3",
"webpack": "5",
Expand Down Expand Up @@ -119,6 +121,6 @@
"publishConfig": {
"access": "public"
},
"builders": "dist/types/builders/builders.json",
"builders": "dist/builders/builders.json",
"gitHead": "c64b5be851ed2affac56e1daaac3f453fbe6f230"
}
2 changes: 1 addition & 1 deletion code/frameworks/angular/preset.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('./dist/types/preset');
module.exports = require('./dist/preset');
2 changes: 1 addition & 1 deletion code/frameworks/angular/renderer.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './dist/types/renderer.d';
export * from './dist/renderer.d';
2 changes: 1 addition & 1 deletion code/frameworks/angular/renderer.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('./dist/types/renderer');
module.exports = require('./dist/renderer');
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import { hasDocsOrControls } from '@storybook/docs-tools';

export const previewAnnotations: StorybookConfig['previewAnnotations'] = (entry = [], options) => {
if (!hasDocsOrControls(options)) return entry;
return [...entry, path.join(__dirname, '../../../dist/types/client/docs/config')];
return [...entry, path.join(__dirname, '../../dist/client/docs/config')];
};
5 changes: 5 additions & 0 deletions code/frameworks/angular/template/cli/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"rules": {
"@typescript-eslint/consistent-type-imports": ["error", { "disallowTypeAnnotations": false }]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class DocButtonComponent<T> {

/** Test null default value. */
@Input()
public aNullValue = null;
public aNullValue: string | null = null;

/** Test null default value. */
@Input()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class DocInjectableService {
/**
* Get posts from Backend.
*/
getPosts() {
getPosts(): unknown[] {
return [];
}
}
21 changes: 21 additions & 0 deletions code/frameworks/angular/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": "../../tsconfig.json",
"compileOnSave": false,
"compilerOptions": {
"target": "ES2020",
"module": "CommonJS",
"lib": ["es2020", "dom"],
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"declaration": true,
"outDir": "dist",
"types": ["node"],
"skipLibCheck": true,
"resolveJsonModule": true,
"allowJs": true,
"pretty": true,
"noErrorTruncation": true,
"listEmittedFiles": false
},
"include": ["src/**/*", "src/**/*.json"]
}
16 changes: 3 additions & 13 deletions code/frameworks/angular/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
{
"extends": "../../tsconfig.json",
"compileOnSave": false,
"extends": "./tsconfig.build.json",
"compilerOptions": {
"target": "ES2020",
"module": "CommonJS",
"lib": ["es2020", "dom"],
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"outDir": "dist",
"types": ["node"],
"skipLibCheck": true,
"resolveJsonModule": true,
"allowJs": true
"noEmit": true
},
"include": ["src/**/*", "src/**/*.json"]
"include": ["src/**/*", "src/**/*.json", "template/**/*"]
}
1 change: 1 addition & 0 deletions code/frameworks/ember/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"types": "dist/types/index.d.ts",
"files": [
"dist/**/*",
"template/**/*",
"README.md",
"*.js",
"*.d.ts"
Expand Down
1 change: 1 addition & 0 deletions code/frameworks/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"types": "dist/index.d.ts",
"files": [
"dist/**/*",
"template/**/*",
"types/**/*",
"README.md",
"*.js",
Expand Down
7 changes: 7 additions & 0 deletions code/frameworks/nextjs/template/cli/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"rules": {
"import/no-extraneous-dependencies": "off",
"import/extensions": "off",
"react/no-unknown-property": "off"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ export const Header = ({ user, onLogin, onLogout, onCreateAccount }) => (
);

Header.propTypes = {
user: PropTypes.shape({}),
user: PropTypes.shape({
kasperpeulen marked this conversation as resolved.
Show resolved Hide resolved
name: PropTypes.string.isRequired,
}),
onLogin: PropTypes.func.isRequired,
onLogout: PropTypes.func.isRequired,
onCreateAccount: PropTypes.func.isRequired,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import type { ComponentStoryFn, ComponentMeta } from '@storybook/react';

import { Button } from './Button';
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/nextjs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"resolveJsonModule": true,
"skipLibCheck": true
},
"include": ["src/**/*"],
"include": ["src/**/*", "template/**/*"],
"exclude": ["src/**/*.test.*", "src/**/__testfixtures__/**"]
}
49 changes: 0 additions & 49 deletions code/lib/cli/rendererAssets/aurelia/1-Button.stories.ts

This file was deleted.

28 changes: 0 additions & 28 deletions code/lib/cli/rendererAssets/aurelia/button.ts

This file was deleted.

20 changes: 0 additions & 20 deletions code/lib/cli/rendererAssets/marionette/index.stories.js

This file was deleted.

24 changes: 0 additions & 24 deletions code/lib/cli/rendererAssets/marko/1-Button.stories.js

This file was deleted.

13 changes: 0 additions & 13 deletions code/lib/cli/rendererAssets/marko/Button.marko

This file was deleted.

22 changes: 0 additions & 22 deletions code/lib/cli/rendererAssets/mithril/Button.js

This file was deleted.

43 changes: 0 additions & 43 deletions code/lib/cli/rendererAssets/mithril/Button.stories.js

This file was deleted.

Loading