Giter Site home page Giter Site logo

nuxt / assets Goto Github PK

View Code? Open in Web Editor NEW
267.0 11.0 32.0 5.35 MB

๐ŸŽจ Unified Assets and Templates for Nuxt

Home Page: https://nuxt-ui-templates.vercel.app

License: MIT License

JavaScript 0.43% HTML 69.85% TypeScript 28.62% Shell 1.10%
nuxt

assets's Introduction

๐ŸŽจ Nuxt Assets

Unified Assets & Templates for Nuxt.

๐Ÿ“ฆ Packages

Pre-compiled html templates for internal pages. Demo on templates.ui.nuxtjs.org

Shared assets and resources.

๐Ÿ’ป Development

  • Clone repository
  • Enable Corepack using corepack enable (use npm i -g corepack for Node.js < 16.10)
  • Install dependencies using pnpm install

License

MIT. Design resources are published under CC-BY-ND-4.0.

assets's People

Contributors

andreyyolkin avatar antfu avatar atinux avatar bobbiegoede avatar clemcode avatar danielroe avatar flosciante avatar liconver avatar mario-neuhold avatar masnormen avatar neilmispelaar avatar patrickdorival avatar pi0 avatar posva avatar renovate[bot] avatar rrmesquita avatar sebastienleonce avatar soroushcoder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

assets's Issues

`spa-loading-icon.d.ts` malformed

The current spa-loading-icon.d.ts of the @nuxt/ui-templates package seems to be malformed:

export type DefaultMessages = Record<, string | boolean | number >
declare const template: (data: Partial<DefaultMessages>) => string
export { template }

Which makes it difficult to use the package due to compiler errors:

node_modules/@nuxt/ui-templates/dist/templates/spa-loading-icon.d.ts:1:38 - error TS1110: Type expected.

1 export type DefaultMessages = Record<, string | boolean | number >
                                       ~

Found 1 error.

Build System and Packaging

As of now, we use vanilla inlined css and svg inside error templates (with duplicates), poi for loading-screen and a mixed design for youch.

Desired output from nice is a set of html templates (lodash template), compiled styles and minimal runtime scripts.

I had been looking into parcel and posthtml since it seems a perfect stack for building such output. Parcel would make bundling a template much easier and built-in posthtml support brings
opportunities like template support, easy development and inlining assets which is far easier than alternatives like rollup or webpack or vanilla if we want to use...

Only issue i couldn't resolve was that posthtml seems to be prod only. So we might find a way to enable it in development of parcel or use with programmatic API...

Wrong string interpolation in NuxtWelcome component

Environment

Nuxt project info: 20:41:00


  • Operating System: Darwin
  • Node Version: v14.18.3
  • Nuxt Version: 3.0.0-rc.8
  • Package Manager: [email protected]
  • Builder: vite
  • User Config: typescript
  • Runtime Modules: -
  • Build Modules: -

Reproduction

1- Nothing special, just create a new project using pnpm:

pnpm dlx nuxi init nuxt3-app-rc8
cd nuxt3-app-rc8
pnpm install --shamefully-hoist

2- Edit the app.vue page to pass version as a props to the NuxtWelcome component:

<template>
  <div>
    <NuxtWelcome :version="version" />
  </div>
</template>

<script setup>
const props = defineProps({
  version: {
    type: String,
    default: 'v3.0.0-rc.8'
  }
})
</script>

P.S. The version prop according the definition is a String, so a value like v3.0.0-rc.8 should be accepted.
3- Finally run the project:

pnpm dev

Describe the bug

Current behavior:

The generated url looks like this:

https://github.com/nuxt/framework/releases/tag/%7B%7B%20version%20%7D%7D

and when you click on the link, you'll be redirected to the 404 page.

Expected behavior:

The generated url should be like this:

https://github.com/nuxt/framework/releases/tag/v3.0.0-rc.8

Although in both cases the generated HTML looks like this:

<a href="https://github.com/nuxt/framework/releases/tag/v3.0.0-rc.8" target="_blank" rel="noopener" class="flex justify-end pb-1 sm:pb-2" data-v-e12da2d6="">v3.0.0-rc.8</a>

Additional context

A quick -dirty- fix would be to edit /node_modules/.pnpm/@[email protected]/node_modules/@nuxt/ui-templates/dist/templates/welcome.vue like so:

<a :href="`https://github.com/nuxt/framework/releases/tag/${version}`" target="_blank" rel="noopener" class="flex justify-end pb-1 sm:pb-2" v-text="version" />

This would apply the string interpolation correctly, and here is the original generated source:

<a href="https://github.com/nuxt/framework/releases/tag/{{version}}" target="_blank" rel="noopener" class="flex justify-end pb-1 sm:pb-2" v-text="version" />

I couldn't find the original template, since welcome.vue is generated using the magic on the fly, and I know this may have no impact to the framework it self, since it's just a welcome component example, but this may solve another similar issue in some other places.

Logs

No response

Design System

We need to choose a CSS design system for nice project. I'm aware of nuxt/ui development, and it would be also totally perfect to adopt it just need to ensure it won't block project development and also we have a way to extract/inline and use css to redistribute (i think it was using css-in-js within vue components but not sure about latest state)

Other alternatives are in-house designs with or without tailwind css. What matters in the end is that we can distribute or inline stylesheets.

/cc @Atinux @alexchopin

A small CSS fix

Hello, this may be a bit trivial but I noticed on the welcome page that inside the third element, the twitter one, the text doesn't quite line up with the previous two anchor tags ( https://templates.ui.nuxtjs.org/templates/welcome )

I looked and the CSS classes are a little bit different on that one so I was thinking I could just make them all uniform.

But also with that being done all 3 elements would be the same and you could use "v-for" and then populate their individual data from an array perhaps, like you did with the {{messages}} text.

I've never contributed to a project like this before would this be something I could do a pull request for?

fix(templates): invalid html for `spa-loading-icon`

Environment


  • Operating System: Linux
  • Node Version: v16.20.0
  • Nuxt Version: 3.6.5
  • Nitro Version: 2.5.2
  • Package Manager: [email protected]
  • Builder: vite
  • User Config: app, devtools, modules, htmlValidator
  • Runtime Modules: @nuxtjs/[email protected]
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-7umkre?file=nuxt.config.ts

Describe the bug

The nuxt/assets/spa-loading-icon template's style tag is rendered inside a div tag by default, which is invalid html.

Run npm install && npm run generate in the linked reproduction and see @nuxtjs/html-validator's error.

Additional context

It could be a solution to provide a full html page with a properly placed <style> tag in nuxt/assets, but I'm not sure if that would keep the idea of the loading icon only being a loading icon.

Also, see nuxt-modules/html-validator#402.

Logs

ERROR  HTML validation errors found for /200.html                                                9:45:28 PM

inline
  6:250  error  <style> element is not permitted as content under <div>  element-permitted-content

โœ– 1 problem (1 error, 0 warnings)

More information:
  https://html-validate.org/rules/element-permitted-content.html

Can I copy this library

I would like to ask whether this library can be copied as the underlying UI framework development, and I will indicate the source

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Repository problems

These problems occurred while renovating this repository. View logs.

  • WARN: Using npm packages for Renovate presets is now deprecated. Please migrate to repository-based presets instead.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v4
  • actions/setup-node v4
npm
package.json
  • @nuxtjs/eslint-config-typescript ^12.1.0
  • eslint ^8.57.0
  • jiti ^1.21.0
  • lerna ^8.1.2
  • prettier ^3.2.5
  • typescript ^5.4.4
  • vitest ^1.4.0
  • pnpm 8.15.6
packages/assets/package.json
packages/templates/package.json
  • @types/html-minifier ^4.0.5
  • @types/lodash.template ^4.5.3
  • @unocss/reset ^0.58.9
  • critters 0.0.22
  • execa ^8.0.1
  • globby ^14.0.1
  • html-minifier ^4.0.0
  • jiti ^1.21.0
  • knitwork ^1.1.0
  • lodash.template ^4.5.0
  • scule ^1.3.0
  • unocss ^0.58.9
  • upath ^2.0.1
  • vite ^5.2.8

  • Check this box to trigger a request for Renovate to run again on this repository

Default nuxt error page bleeds CSS styles

Environment


  • Operating System: Windows_NT
  • Node Version: v16.13.2
  • Nuxt Version: 3.0.0-27485997.c426f3e
  • Package Manager: [email protected]
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

Repo:
https://github.com/Aareksio/nuxt3-issues/tree/error-style-bleed

CodeSandbox:
https://codesandbox.io/s/eloquent-cartwright-gkr2ll?file=/app.vue

TL;DR:

<div>
  <nuxt-page/>
  <nuxt-link to="/404">404</nuxt-link>
</div>
nuxt-error-css-bleed.mp4

Describe the bug

After visiting default 404 page, global style is applied

Additional context

No response

Logs

No response

Add config option to disable build-time css animations and other fancy stuff

As discussed in nuxt/ui#159 this is a drain on people working on machine without 3d acceleration for css animations.

Current solution implemented is to click on a hidden button on the top right corner while the animation is running. Obviously this is not the best solution as during that time the computer is extremely laggy so it's hard to move the mouse anyways on top of a css-animated background.

Additionally the button is hidden, so people have to go to github issues to find out.

Either there should be FPS measurement to figure out if animations should be used, or please enable a nuxt.config.js option to disable this for the whole project.

Thank you!

I have such doubts.

I don't know whether the expectation of this project will be the same as that of element UI. There will be more possibilities. And for all users. I have such doubts.

Add a color to <p> elements on Nuxt error pages

Describe the feature

While debugging my app, I noticed that errors displayed alongside a 500 page were black on a black background, making the errors unreadable. After I inspected the element I realised I was actually setting a color for paragraphs in my own CSS and that Nuxt's own stylesheet was not setting the color on the paragraph but on the parent div via the text-black class.

I believe it would be best if Nuxt's colors were applied on a more granular level (so on P or any text elements directly) to avoid this edge case.

Screenshot 2024-04-21 at 12 52 12 Screenshot 2024-04-21 at 12 52 39 Screenshot 2024-04-21 at 13 12 50 Screenshot 2024-04-21 at 13 12 56 Screenshot 2024-04-21 at 13 13 01 Screenshot 2024-04-21 at 13 13 12

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?

Final checks

Serving Assets

For nuxt 2 we don't have any issues but also not have much opportunities to have a more complex and beautiful design because of size and single file limitation and it is somehow tricky for loading-screen as we need a whole conntect stack to serve static assets.

One solution to this would be serving assets from a CDN (like jsdelivr) including js libraries we use. This could make development and distribution much easier since final templates are html/string only can be embeded into any bundle also in production

Project goals

Since beginning we were pushing nuxt as a framework with best developer experience and over the time designs got inconsistent and spread into several projects, places and build pipelines (if any). Current components to focus are:

  • Production error page (app)
  • Production error page (server fatal)
  • Development error page
  • Loading screen page
  • Build indicator
  • SPA loading indicators

Usage of unified design might be extended to new places like:

  • Nuxt components documentation
  • Nuxt Devtools
  • Content module editor
  • Config explorer

Meanwhile it is totally fine with what we have for nuxt2, new projects like Nitro and Nuxt 3 might need a standard template library otherwise we need to duplicate them all and use inline css in places that need.

Production bundles

Random idea, but what do you think about producing production bundles that are fully JS for pnp support? cc: @pi0

import template from '@nuxt/design/404'
import messages from '@nuxt/design/messages/en'
// possibly even for static assets?
import vfs from '@nuxt/design/assets'

const html = template(messages)

FPS drop during loading: Loading animation very slow

Environment

Nuxt CLI v3.0.0-rc.8

  • Operating System: Linux
  • Node Version: v18.6.0
  • Nuxt Version: 3.0.0-rc.8
  • Package Manager: [email protected]
  • Builder: vite
  • User Config: build, runtimeConfig
  • Runtime Modules: -
  • Build Modules: -

Reproduction

Start nuxt app and navigate to http://localhost:3000

A Nuxt logo will be shown with CSS gradient animations which follow your mouse pointer.

Describe the bug

The animation is very laggy on my machine (16gb ram, 8 cores Intel(R) Core(TM) i7-3720QM CPU @ 2.60GHz).
My browser has significant FPS drop, and loading animation takes more resources than nuxt building process.

Additional context

Please add an option to not show CSS animations during the loading.

Logs

No response

Are these components nuxt only

From what I have seen these components should be working without nuxt in bare Vue3 project, However this is not clear in documentation. Either yes or no, it will be nice to mention in the readme and if supported then will be great to have some simple instruction on how to use this with vue only project

Publish/release updates to npm?

Issue 207 fixed a broken link in the welcome.vue page that is displayed every time some n00b like me tries nuxt for the first time.

It hasn't yet been published to npm, so 150k+ people a week continue to download the welcome page with the broken link.

Is there a timeline for updating from 1.1.1 on npm?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.