Remove legacy react generators
This commit is contained in:
parent
cde1995a6a
commit
2c8da33706
11 changed files with 0 additions and 128 deletions
|
@ -1,14 +0,0 @@
|
|||
Description:
|
||||
Explain the generator
|
||||
|
||||
Example:
|
||||
|
||||
rails generate react:component name
|
||||
|
||||
This will create:
|
||||
Creates a new React component named Name in javascripts/component/name.ts along with a corresponding Jest test
|
||||
|
||||
rails generate react:component parent_dir/name
|
||||
|
||||
This will create:
|
||||
Creates a new React component named Name in javascripts/component/parent_dir/name.ts along with a corresponding Jest test
|
|
@ -1,12 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
|
||||
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
|
||||
class React::ComponentGenerator < Rails::Generators::NamedBase
|
||||
source_root File.expand_path('templates', __dir__)
|
||||
|
||||
def copy_file_to_component
|
||||
template 'component.tsx.erb', File.join('javascripts/src/components', *(class_path + ["#{file_name.camelize}.tsx"]))
|
||||
template 'component.spec.tsx.erb', File.join('javascripts/src/components', *(class_path + ["#{file_name.camelize}.spec.tsx"]))
|
||||
end
|
||||
end
|
|
@ -1,10 +0,0 @@
|
|||
// License: LGPL-3.0-or-later
|
||||
import * as React from 'react';
|
||||
import 'jest';
|
||||
import <%= file_name.camelize %> from './<%= file_name.camelize%>'
|
||||
|
||||
describe('<%= file_name.camelize %>', () => {
|
||||
test('your test here', () => {
|
||||
expect(false).toBe(true)
|
||||
})
|
||||
})
|
|
@ -1,20 +0,0 @@
|
|||
// License: LGPL-3.0-or-later
|
||||
import * as React from 'react';
|
||||
import { observer } from 'mobx-react';
|
||||
import {InjectedIntlProps, injectIntl} from 'react-intl';
|
||||
|
||||
export interface <%= file_name.camelize %>Props
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
class <%= file_name.camelize %> extends React.Component<<%= file_name.camelize %>Props & InjectedIntlProps, {}> {
|
||||
render() {
|
||||
return <div></div>;
|
||||
}
|
||||
}
|
||||
|
||||
export default injectIntl(observer(<%= file_name.camelize %>))
|
||||
|
||||
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
Description:
|
||||
Generates a basic Typescript module
|
||||
|
||||
Example:
|
||||
rails generate react:lib name
|
||||
|
||||
This will create:
|
||||
Creates a new class-based module in javascripts/lib/name.ts along with a corresponding Jest test
|
||||
|
||||
rails generate react:lib parent_dir/name
|
||||
|
||||
This will create:
|
||||
Creates a new class-based module in javascripts/lib/parent_dir/name.ts along with a corresponding Jest test
|
|
@ -1,9 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class React::LibGenerator < Rails::Generators::NamedBase
|
||||
source_root File.expand_path('templates', __dir__)
|
||||
def copy_file_to_lib
|
||||
template 'module.ts.erb', File.join('javascripts/src/lib/', *(class_path + ["#{file_name.underscore}.ts"]))
|
||||
template 'module.spec.ts.erb', File.join('javascripts/src/lib/', *(class_path + ["#{file_name.underscore}.spec.ts"]))
|
||||
end
|
||||
end
|
|
@ -1,9 +0,0 @@
|
|||
// License: LGPL-3.0-or-later
|
||||
import 'jest';
|
||||
import * as Lib from './<%= file_name.underscore%>'
|
||||
|
||||
describe('<%= file_name.camelize %>', () => {
|
||||
test('your test here', () => {
|
||||
expect(false).toBe(true)
|
||||
})
|
||||
})
|
|
@ -1,5 +0,0 @@
|
|||
// License: LGPL-3.0-or-later
|
||||
|
||||
export default class <%= file_name.camelize %> {
|
||||
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
Description:
|
||||
Used for generating a new packroot for a page on Webpack
|
||||
|
||||
Example:
|
||||
rails generate react:packroot Name
|
||||
|
||||
This will create:
|
||||
A file named javascripts/app/name.ts which refers to a newly created component at
|
||||
javascript/src/components/name/name.tsx (uses the react:component generator)
|
|
@ -1,13 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
|
||||
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
|
||||
module React
|
||||
class PackrootGenerator < Rails::Generators::NamedBase
|
||||
source_root File.expand_path('templates', __dir__)
|
||||
def copy_file_to_app
|
||||
template 'page.tsx.erb', "javascripts/app/#{file_name.underscore}.tsx"
|
||||
generate 'react:component', "#{file_name.underscore}/#{file_name.camelize}"
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,14 +0,0 @@
|
|||
// License: LGPL-3.0-or-later
|
||||
// require a root component here. This will be treated as the root of a webpack package
|
||||
import Root from "../src/components/common/Root"
|
||||
import <%=file_name.camelize %> from "../src/components/<%= file_name.underscore%>/<%= file_name.camelize%>"
|
||||
|
||||
import * as ReactDOM from 'react-dom'
|
||||
import * as React from 'react'
|
||||
|
||||
function LoadReactPage(element:HTMLElement) {
|
||||
ReactDOM.render(<Root><<%=file_name.camelize %>/></Root>, element)
|
||||
}
|
||||
|
||||
|
||||
(window as any).LoadReactPage = LoadReactPage
|
Loading…
Reference in a new issue