Skip to content

Commit

Permalink
fix dependencies from the package.json lists
Browse files Browse the repository at this point in the history
  • Loading branch information
JayaKrishnaNamburu committed Oct 17, 2024
1 parent 6420553 commit 07e6f1d
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,13 @@ const generateDynamicNode: NodeToHTML<UIDLDynamicReference, Promise<HastNode | H
propDefinitions,
stateDefinitions
): Promise<HastNode | HastText> => {
if (node.content.referenceType === 'locale') {
const localeTag = HASTBuilders.createHTMLNode('span')
const commentNode = HASTBuilders.createComment(`Content for locale ${node.content.id}`)
HASTUtils.addChildNode(localeTag, commentNode)
return localeTag
}

const usedReferenceValue = getValueFromReference(
node.content.id,
node.content.referenceType === 'prop' ? propDefinitions : stateDefinitions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ Object {
"content": "import React, { useEffect } from 'react'
import Head from 'next/head'
import { useTranslations } from 'next-intl'
import Header from '../components/header'
import Hero from '../components/hero'
import Footer from '../components/footer'
const Home = (props) => {
const translate = useTranslations()
useEffect(() => import('@lottiefiles/lottie-player'), [])
return (
<>
Expand All @@ -36,6 +39,18 @@ const Home = (props) => {
</div>
}
></Hero>
<span
dangerouslySetInnerHTML={{
__html: translate.raw('text_S5OU83'),
}}
></span>
<h1>
<span
dangerouslySetInnerHTML={{
__html: translate.raw('text_S5OU83'),
}}
></span>
</h1>
<Footer></Footer>
</div>
<style jsx>
Expand Down Expand Up @@ -75,6 +90,16 @@ const Home = (props) => {
}
export default Home
export async function getStaticProps(context) {
const messages = (await import('../locales/' + context.locale + '.json'))
.default
return {
props: {
messages,
},
}
}
",
"fileType": "js",
"name": "index",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('React Next Project Generator', () => {
expect(outputFolder.files[0].name).toBe('package')
expect(appFile).toBeDefined()
expect(appFile?.content).not.toContain(`import "antd/dist/antd.css`)
expect(appFile?.content).toContain(`import "./style.css"`)
expect(appFile?.content).toContain(`import './style.css'`)
})

it('runs without crashing and adding external dependencies', async () => {
Expand Down Expand Up @@ -85,7 +85,7 @@ describe('React Next Project Generator', () => {
expect(styleSheet).toBeDefined()
expect(styleSheet?.content).toContain(`--greys-500: #595959`)
expect(appFile).toBeDefined()
expect(appFile?.content).toContain(`import "./style.css"`)
expect(appFile?.content).toContain(`import './style.css'`)
})

it('creates a default route if a page is marked as fallback', async () => {
Expand Down
4 changes: 3 additions & 1 deletion packages/teleport-project-generator-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"build": "tsc -p tsconfig.json && tsc -p tsconfig.json --module commonjs --outDir dist/cjs"
},
"dependencies": {
"@babel/generator": "^7.5.5",
"@babel/types": "^7.5.5",
"@teleporthq/teleport-component-generator": "^0.36.5",
"@teleporthq/teleport-component-generator-react": "^0.36.5",
Expand All @@ -38,7 +39,8 @@
"@teleporthq/teleport-postprocessor-prettier-js": "^0.36.0",
"@teleporthq/teleport-project-generator": "^0.36.5",
"@teleporthq/teleport-shared": "^0.36.0",
"@teleporthq/teleport-types": "^0.36.0"
"@teleporthq/teleport-types": "^0.36.0",
"@teleporthq/teleport-uidl-resolver": "^0.36.1"
},
"gitHead": "b185c3fdb7dc94ff8c7eed63f7edba055fffa8d0"
}
3 changes: 3 additions & 0 deletions packages/teleport-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@
"clean": "rimraf dist",
"build": "tsc -p tsconfig.json && tsc -p tsconfig.json --module commonjs --outDir dist/cjs"
},
"devDependencies": {
"@babel/types": "^7.5.5"
},
"gitHead": "b185c3fdb7dc94ff8c7eed63f7edba055fffa8d0"
}

0 comments on commit 07e6f1d

Please sign in to comment.