Giter Club home page Giter Club logo

framework-info's Introduction

Important Notice

This repository was moved into the mono repository of github.com/netlify/build The package name and the versions are preserved!

npm version Coverage Status Build Downloads

Framework detection utility.

Detects which framework a specific website is using. The framework's build/dev commands, directories and server port are also returned.

The following frameworks are detected:

  • Static site generators: Gatsby, Hugo, Jekyll, Next.js, Nuxt, Hexo, Gridsome, Docusaurus, Eleventy, Middleman, Phenomic, React-static, Stencil, Vuepress, Assemble, DocPad, Harp, Metalsmith, Roots, Wintersmith
  • Front-end frameworks: create-react-app, Vue, Sapper, Angular, Ember, Svelte, Expo, Quasar
  • Build tools: Parcel, Brunch, Grunt, Gulp

If you're looking for a way to run framework-info via CLI check the build-info project.

Additions and updates are welcome!

Example (Node.js)

import { listFrameworks, hasFramework, getFramework } from '@netlify/framework-info'

console.log(await listFrameworks({ projectDir: './path/to/gatsby/website' }))
// [
//   {
//     id: 'gatsby',
//     name: 'Gatsby',
//     category: 'static_site_generator',
//     dev: {
//       commands: ['gatsby develop'],
//       port: 8000,
//       pollingStrategies: [{ name: 'TCP' }, { name: 'HTTP' }]
//     },
//     build: {
//       commands: ['gatsby build'],
//       directory: 'public'
//     },
//     staticAssetsDirectory: "static",
//     env: { GATSBY_LOGGER: 'yurnalist' },
//     plugins: []
//   }
// ]

console.log(await listFrameworks({ projectDir: './path/to/vue/website' }))
// [
//   {
//     id: 'vue',
//     name: 'Vue.js',
//     category: 'frontend_framework',
//     dev: {
//       commands: ['npm run serve'],
//       port: 8080,
//       pollingStrategies: [{ name: 'TCP' }, { name: 'HTTP' }]
//     },
//     build: {
//       commands: ['vue-cli-service build'],
//       directory: 'dist'
//     },
//     env: {},
//     plugins: []
//   }
// ]

console.log(await hasFramework('vue', { projectDir: './path/to/vue/website' }))
// true

console.log(await getFramework('vue', { projectDir: './path/to/vue/website' }))
// {
//   id: 'vue',
//   name: 'Vue.js',
//   category: 'frontend_framework',
//   dev: {
//     commands: ['npm run serve'],
//     port: 8080,
//     pollingStrategies: [{ name: 'TCP' }, { name: 'HTTP' }]
//   },
//   build: {
//     commands: ['vue-cli-service build'],
//     directory: 'dist'
//   },
//   env: {},
//   plugins: []
// }

Installation

npm install @netlify/framework-info

Usage (Node.js)

listFrameworks(options?)

options: object?
Return value: Promise<object[]>

Options

projectDir

Type: string
Default value: process.cwd()

Path to the website's directory.

Return value

This returns a Promise resolving to an array of objects describing each framework. The array can be empty, contain a single object or several objects.

Each object has the following properties.

id

Type: string

Id such as "gatsby".

name

Type: string

Framework name such as "Gatsby".

category

Type: string

Category among "static_site_generator", "frontend_framework" and "build_tool".

dev

Type: object

Information about the dev command.

commands

Type: string[]

Dev command. There might be several alternatives.

port

Type: number

Server port.

pollingStrategies

Type: object[]

Polling strategies to use when checking if the dev server is ready.

build

Type: object

Information about the build command.

commands

Type: string[]

Build command. There might be several alternatives.

directory

Type: string

Relative path to the directory where files are built.

staticAssetsDirectory

Type: string

Directory where the framework stores static assets. Can be undefined.

env

Type: object

Environment variables that should be set when calling the dev command.

plugins

Type: string[]

A list of recommend Netlify build plugins to install for the framework.

hasFramework(frameworkId, options?)

options: object?
Return value: Promise<boolean>

Same as listFramework() except only for a specific framework and returns a boolean.

getFramework(frameworkId, options?)

options: object?
Return value: Promise<object>

Same as listFramework() except the framework is passed as argument instead of being detected. A single framework object is returned.

Usage (CLI)

$ framework-info [projectDirectory]

This prints the ids of each framework.

If known is found, unknown is printed.

Available flags:

  • --long: Show more information about each framework. The output will be a JSON array.

Add or update a framework

Each framework is a JSON file in the /src/frameworks/ directory. For example:

{
  "id": "gatsby",
  "name": "Gatsby",
  "category": "static_site_generator",
  "detect": {
    "npmDependencies": ["gatsby"],
    "excludedNpmDependencies": [],
    "configFiles": ["gatsby-config.js"]
  },
  "dev": {
    "command": "gatsby develop",
    "port": 8000,
    "pollingStrategies": [{ "name": "TCP" }, { "name": "HTTP" }]
  },
  "build": {
    "command": "gatsby build",
    "directory": "public"
  },
  "staticAssetsDirectory": "static",
  "env": { "GATSBY_LOGGER": "yurnalist" },
  "plugins": []
}

All properties are required.

id

Type: string

Id of the framework.

name

Type: string

Name of the framework.

category

Type: string

One of "static_site_generator", "frontend_framework" or "build_tool".

detect

Type: object

Information used to detect this framework

npmDependencies

Type: string[]

Framework's npm packages. Any project with one of those packages in their package.json (dependencies or devDependencies) will be considered as using the framework.

If empty, this is ignored.

excludedNpmDependencies

Type: string[]

Inverse of npmDependencies. If any project is using one of those packages, it will not be considered as using the framework.

If empty, this is ignored.

configFiles

Type: string[]

Framework's configuration files. Those should be paths relative to the project's directory. Any project with one of configuration files will be considered as using the framework.

If empty, this is ignored.

dev

Type: object

Parameters to detect the dev command.

command

Type: string

Default dev command.

port

Type: number

Local dev server port.

pollingStrategies

Type: object[]

Polling strategies to use when checking if the dev server is ready.

build

Type: object

Parameters to detect the build command.

command

Type: string

Default build command.

directory

Type: string

Directory where built files are written to.

staticAssetsDirectory

Type: string

Directory where the framework stores static assets where relevant for the framework.

env

Type: object

Environment variables that should be set when running the dev command.

plugins

Type: object[]

A list of Netlify build plugins package names and conditions. If a condition is met for a plugin it will be returned in the framework's plugin's list.

For example

{
  "plugins": [
    {
      "packageName": "@netlify/plugin-nextjs",
      "condition": { "minNodeVersion": "10.13.0" }
    }
  ]
}

framework-info's People

Contributors

arnaudligny avatar ascorbic avatar benmccann avatar charliegerard avatar danez avatar danielroe avatar dependabot[bot] avatar dthyresson avatar dustincrogers avatar dwkns avatar ehmicky avatar erezrokah avatar ericapisani avatar github-actions[bot] avatar henrifrancois avatar jgantunes avatar jlengstorf avatar lukeocodes avatar netlify-bot avatar nickytonline avatar nielsdb97 avatar renovate-bot avatar renovate[bot] avatar skn0tt avatar token-generator-app[bot] avatar xenonym avatar xhmikosr 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  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

framework-info's Issues

Allow frameworks to specify the minimum Node.js version

All Node.js-based frameworks have a specific minimum Node.js version.
At the moment, if a user runs a framework on Netlify with a Node.js version that's too old, the framework will most likely fail at require()-time with some cryptic error message due to some unsupported JavaScript feature or missing Node.js core method. Users might be confused and think this is a bug in Netlify.

Since we detect frameworks, we could use that knowledge to infer the minimum Node.js version. We could do this by adding a new nodeVersionRange field to the frameworks declarations:

  • The value would be a semver range like ^10 || >=12 or >=12.20.0 since some frameworks support Node.js version range that are more complex than just >=version.
  • The minimal version can still be inferred (for example to use as a default Node.js version) using node-semver minVersion() method.

We could use that information to either:

  • Warn users when using the wrong Node.js version, for example by printing a message in the build logs.
  • Choose the default Node.js version run in builds

I would personally favor only warning users and not overriding the Node.js version based on that information because:

  • The logic to decide on the default Node.js version is already quite complicated as mentioned by @ingride
  • Users might not expect that Node.js version unless documented, and documenting it clearly might be difficult if it's framework-specific.
  • When using multiple frameworks, their ranges might be in conflict. This could be fixed by using an intersection, but I am wondering whether that intersection might be empty in some cases.
  • It is consistent with our current strategy for Build plugins. For Build plugins, we not only warn users but fail the build altogether when the Node.js version is incompatible. We do this based on the engines.node field in package.json. This is also consistent with how npm and yarn behave during npm install (although one warns only while the other fails).

That being said, I could also see an argument being made that Netlify users might expect the platform to just use the right Node.js version so things "just work" with their chosen framework.

Note: this discussion was brought up due to Nuxt supporting only Node.js >=12.20.0.

I would be very curious to learn more about what you all think about this idea, especially @ingride @JGAntunes @erezrokah @verythorough @lukeocodes @ascorbic. Thanks!

Feature: provide default implementations of browser contexts

See conversation here.

Following this PR, browser consumers would need to provide a context with the content of package.json and a pathExists function.

We could potentially simplify this by providing a provider name (e.g. GitHub), a token and a repo and have this library handle getting package.json and implementing pathExists. We might need to also provide an API url (for GitHub enterprise).

This can be implemented in this library, or in a separate one (I personally think it belongs in a separate one).

Over-eager detection of next-nx?

Please correct me if I'm wrong as I'm not 100% sure how framework-info works, but from previous explanations and the docs I believe it uses the build and serve commands to detect frameworks. If so, this detector is inaccurate:

https://github.com/netlify/framework-info/blob/main/src/frameworks/next-nx.json#L11

nx is a separate framework that usually works with Angular. There is a next-nx plugin, but not all instances of nx build or nx serve are instances of next-nx.

Update the Remix dev command

Which problem is this feature request solving?

The Remix dev command has changed. It's now remix dev

Describe the solution you'd like

Update the Remix dev command to remix dev

Describe alternatives you've considered

N/A

Can you submit a pull request?

Yes

feature: add support for Zola framework

Which problem is this feature request solving?

Support for Zola

Describe the solution you'd like

Add a json file to detect Zola

Describe alternatives you've considered

N/A

Can you submit a pull request?

Yes

Eleventy v2.0 supports new filenames for config files.

Describe the bug

Eleventy supports new filenames for config files. Previously only .eleventy.js was used. Now it can be eleventy.config.js or eleventy.config.cjs as well.

See: https://www.11ty.dev/docs/config/#default-configuration-filenames

netlify dev doesn't automatically detect these new files.

Configuration
System:
OS: macOS 13.0
CPU: (10) arm64 Apple M1 Max
Memory: 962.53 MB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.17.1 - /opt/homebrew/opt/node@16/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 8.15.0 - /opt/homebrew/opt/node@16/bin/npm

Pull requests

Feature: add static assets directory

Related to the discussion here and to #94

Which problem is this feature request solving?

The CLI watches _redirects and _headers files in both the project directory and the dist directory:
https://github.com/netlify/cli/blob/078a28bfc81e8a2630886e80f3c8528e3b9f4e70/src/utils/rules-proxy.js#L58
https://github.com/netlify/cli/blob/078a28bfc81e8a2630886e80f3c8528e3b9f4e70/src/utils/proxy.js#L266

The meaning of a framework dist directory in the CLI can change based on the framework.
For example, for create-react-app we use public which is where pre-build static files are located (those files are tracked by source control):
https://github.com/netlify/cli/blob/078a28bfc81e8a2630886e80f3c8528e3b9f4e70/src/detectors/create-react-app.js#L29

For eleventy we use _site which is where built files are put (not tracked by source control):
https://github.com/netlify/cli/blob/078a28bfc81e8a2630886e80f3c8528e3b9f4e70/src/detectors/eleventy.js#L18

The differentiation is coming from how frameworks work in dev mode.
Some (like create-react-app) will not generate build files in dev and some (like eleventy) will.

At the moment framework-info returns only the build directory.

Describe the solution you'd like

framework-info should return a staticAssetsDirectory property when applicable

Describe alternatives you've considered

Having that logic in the CLI

Can you submit a pull request?

Yes

[security] Enforce Branch Protections

This is an issue generated by (for-internal-use-only)github-tools

Description

This repository has exceeded the development grace period, and the repo owner must decide if branch protections should be enforced.
If this repository houses code used in production in any capacity, branch protections must be enforced. Read (for-internal-use-only)here for more details

What do I need to do?

  • You can control whether or not branch protections are enforced by exclusively creating either of the labels:
    'enforce-branch-protections: true' or 'enforce-branch-protections: false'
  • If there is no branch protection control label, this issue will be recreated.
  • Once you have created either label, you can close this issue.
  • If you have issues or questions, please reach out to #internal-security-n-compliance on slack.

Qwik excluded npm dependency for Vite framework info has a typo

Thanks for reporting this bug!

Please search other issues to make sure this bug has not already been reported.

Then fill in the sections below.

The current excluded dependency for qwik framework in the vite framework info has a typo. Currently it's @builderio/qwik, but it should be @builder.io/qwik.

Currently this causes multiple framework infos to be found when the Netlify CLI runs.

With the typo, the user is presented with the following options.

❯ ntl dev
Debugger attached.
◈ Netlify Dev ◈
◈ Ignored general context env var: LANG (defined in process)
? Multiple possible start commands found (Use arrow keys or type to search)
❯ [Qwik] 'npm run build.client' 
  [Qwik] 'npm run build.ssr' 
  [Qwik] 'npm run dev.client' 
  [Qwik] 'npm run dev.debug' 
  [Qwik] 'npm run dev.ssr' 
  [Vite] 'npm run build.client' 
  [Vite] 'npm run build.ssr' 
(Move up and down to reveal more choices)

When they should only be presented with one framework, Qwik.

Configuration

Please enter the following command in a terminal and copy/paste its output:

npx envinfo --system --binaries --npmPackages @netlify/framework-info

Pull requests

Pull requests are welcome! If you would like to help us fix this bug, please check our
contributions guidelines.

Add SolidJS framework configuration

Which problem is this feature request solving?

We currently detect Solid Start, but not Solid JS

Describe the solution you'd like

Currently we only have a configuration for Solid Start. See https://github.com/netlify/framework-info/blob/main/src/frameworks/solid-start.json.

We'd need to add a solid-js.json configuration for SolidJS.

We’d need to do is look for the solid-js npm dependency and have solid-start in the excluded npm dependencies for a “vanilla” SolidJS app.

e.g.

{
  "id": "solid-js",
  "name": "SolidJS",
  "category": "static_site_generator",
  "detect": {
    "npmDependencies": ["solid-js"],
    "excludedNpmDependencies": ["solid-start"],
    "configFiles": []
  },
  "dev": {
    "command": "nom run dev",
    "port": 3000,
    "pollingStrategies": [{ "name": "TCP" }]
  },
  "build": {
    "command": "npm run build",
    "directory": "netlify"
  },
  "logo": {
    "default": "/logos/solid-js/default.svg",
    "light": "/logos/solid-js/default.svg",
    "dark": "/logos/solid-js/default.svg"
  },
  "env": {},
  "plugins": []
}

We'd also need SolidJS logos.

And we’d need to exclude the solid-js dependency from the vite framework info.

Describe alternatives you've considered

N/A

Can you submit a pull request?

Yes

ntl dev hangs and times out waiting for port 3000 when a project uses vite as a build tool

Thanks for reporting this bug!

Please search other issues to make sure this bug has not already been reported.

Then fill in the sections below.

Describe the bug

  1. From a shell, create a new project using vite by running npm create vite@latest
  2. Use the default project name vite-project or enter a new one.
➜ npm create vite@latest
✔ Project name: … vite-project
? Select a framework: › - Use arrow-keys. Return to submit.
❯   vanilla
    vue
    react
    preact
    lit
    svelte
  1. It doesn't matter which project type you choose, but I chose React
  2. change to the new folder, e.g. vite-project
  3. run npm run dev
  4. a React vite based app loads uo
  5. Stop the server by pressing CTRL + C
  6. run ntl dev
  7. the vite based server starts up, but the Netlify CLI is hanging waiting for port 3000
➜ ntl dev
◈ Netlify Dev ◈
◈ Ignored general context env var: LANG (defined in process)
◈ Starting Netlify Dev with Vite

> [email protected] dev
> vite


  VITE v3.0.2  ready in 5255 ms

  ➜  Local:   http://127.0.0.1:5173/
  ➜  Network: use --host to expose
⠧ Waiting for framework port 3000. This can be configured using the 'targetPort' property in the netlify.toml

Configuration

N/A

Pull requests

Pull requests are welcome! If you would like to help us fix this bug, please check our
contributions guidelines.

Add Remix detection

Which problem is this feature request solving?

Add support for detecting the Remix framework.

Describe the solution you'd like

Add a Remix configuration file to https://github.com/netlify/framework-info/tree/main/src/frameworks

Describe alternatives you've considered

Having users manually configure Remix

Other Context

This will probably be a breaking change for this library, as we'll make dev.port and dev.commands optional:

required: ['command', 'port', 'pollingStrategies'],

Based on netlify/cli#3654 (comment)
Related to netlify/cli#3655

Svelte should not assume dev server is available

Describe the bug

Adding Svelte to an already existing project causes netlify dev to misbehave. It looks for and fails to find a "framework server" at targetPort 5000.

*** Without Svelte ***

netlify dev returns:

◈ Netlify Dev ◈
◈ Ignored general context env var: LANG (defined in process)
◈ Injected .env file env var: ALLOW_ORIGIN
◈ Injected .env file env var: DATABASE_ADMIN_PASSWORD
◈ Injected .env file env var: DATABASE_NAME
◈ Injected .env file env var: DB_CONNECTION_STRING
◈ Injected .env file env var: IS_CROSS_SITE
◈ Injected .env file env var: JWT_SECRET
◈ Injected .env file env var: SIMPLE_COMMENT_API_URL
◈ Injected .env file env var: SIMPLE_COMMENT_MODERATOR_CONTACT_EMAIL
◈ Injected .env file env var: SIMPLE_COMMENT_MODERATOR_ID
◈ Injected .env file env var: SIMPLE_COMMENT_MODERATOR_PASSWORD
◈ No app server detected. Using simple static server
◈ Running static server from "simple-comment/dist"
◈ Loaded function auth.
◈ Loaded function comment.
◈ Loaded function gauth.
◈ Loaded function topic.
◈ Loaded function user.
◈ Loaded function verify.
◈ Functions server is listening on 39073
◈ Setting up local development server

────────────────────────────────────────────────────────────────
  Netlify Build                                                 
────────────────────────────────────────────────────────────────

❯ Version
  @netlify/build 27.20.6

❯ Flags
  {}

❯ Current directory
  /home/rendall/workspace/rendall/simple-comment

❯ Config file
  /home/rendall/workspace/rendall/simple-comment/netlify.toml

❯ Context
  dev

────────────────────────────────────────────────────────────────
  1. Run command for local development                          
────────────────────────────────────────────────────────────────


◈ Static server listening to 3999

(dev.command completed in 4ms)

   ┌─────────────────────────────────────────────────┐
   │                                                 │
   │   ◈ Server now ready on http://localhost:8888   │
   │                                                 │
   └─────────────────────────────────────────────────┘

Request from ::ffff:127.0.0.1: GET /.netlify/functions/topic/http-localhost-8888
Response with status 200 in 271 ms.

while the same project with only a svelte dependency gets:

◈ Netlify Dev ◈
◈ Ignored general context env var: LANG (defined in process)
◈ Injected .env file env var: ALLOW_ORIGIN
◈ Injected .env file env var: DATABASE_ADMIN_PASSWORD
◈ Injected .env file env var: DATABASE_NAME
◈ Injected .env file env var: DB_CONNECTION_STRING
◈ Injected .env file env var: IS_CROSS_SITE
◈ Injected .env file env var: JWT_SECRET
◈ Injected .env file env var: SIMPLE_COMMENT_API_URL
◈ Injected .env file env var: SIMPLE_COMMENT_MODERATOR_CONTACT_EMAIL
◈ Injected .env file env var: SIMPLE_COMMENT_MODERATOR_ID
◈ Injected .env file env var: SIMPLE_COMMENT_MODERATOR_PASSWORD
◈ Loaded function auth.
◈ Loaded function comment.
◈ Loaded function gauth.
◈ Loaded function topic.
◈ Loaded function user.
◈ Loaded function verify.
◈ Functions server is listening on 35189
◈ Setting up local development server

────────────────────────────────────────────────────────────────
  Netlify Build                                                 
────────────────────────────────────────────────────────────────

❯ Version
  @netlify/build 27.20.6

❯ Flags
  {}

❯ Current directory
  /home/rendall/workspace/rendall/simple-comment

❯ Config file
  /home/rendall/workspace/rendall/simple-comment/netlify.toml

❯ Context
  dev

────────────────────────────────────────────────────────────────
  1. Run command for local development                          
────────────────────────────────────────────────────────────────

◈ Starting Netlify Dev with Svelte
$ rimraf ./functions && rimraf ./dist/js && mkdir ./dist/js
$ yarn run build:backend && yarn run build:frontend
⠹ Waiting for framework port 5000. This can be configured using the 'targetPort' property in the netlify.toml◈ Removed function auth.
◈ Removed function comment.
◈ Removed function gauth.
◈ Removed function topic.
◈ Removed function user.
◈ Removed function verify.
$ yarn run build:netlify
$ webpack --config ./webpack.netlify.functions.js
asset auth.js 2.77 MiB [emitted] (name: auth)
asset gauth.js 2.77 MiB [emitted] (name: gauth)
asset topic.js 2.77 MiB [emitted] (name: topic)
asset verify.js 2.77 MiB [emitted] (name: verify)
asset user.js 2.77 MiB [emitted] (name: user)
asset comment.js 2.76 MiB [emitted] (name: comment)
orphan modules 102 KiB [orphan] 63 modules
runtime modules 8.24 KiB 36 modules
modules by path ./node_modules/ 2.16 MiB 524 modules
modules by path ./src/ 90.4 KiB
  modules by path ./src/functions/*.ts 19.8 KiB
    ./src/functions/auth.ts 3.99 KiB [built] [code generated]
    ./src/functions/comment.ts 2.82 KiB [built] [code generated]
    + 4 modules
  modules by path ./src/lib/*.ts 69.3 KiB
    ./src/lib/MongodbService.ts 48.9 KiB [built] [code generated]
    ./src/lib/utilities.ts 15.6 KiB [built] [code generated]
    ./src/lib/messages.ts 2.63 KiB [built] [code generated]
    + 2 modules
  ./src/policy.ts 1.26 KiB [built] [code generated]
+ 21 modules

... some warnings removed ...

8 warnings have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

webpack 5.75.0 compiled with 8 warnings in 8064 ms
$ webpack
asset hello.js 217 KiB [emitted] (name: hello)
asset all-comments.js 111 KiB [emitted] (name: all-comments)
asset simple-comment.js 102 KiB [emitted] (name: simple-comment)
runtime modules 1.96 KiB 9 modules
cacheable modules 117 KiB
  modules by path ./src/dist/js/*.ts 40.4 KiB
    ./src/dist/js/simple-comment.ts 1.39 KiB [built] [code generated]
    ./src/dist/js/all-comments.ts 4.54 KiB [built] [code generated]
    ./src/dist/js/ui.ts 25.8 KiB [built] [code generated]
    ./src/dist/js/apiClient.ts 8.67 KiB [built] [code generated]
  ./src/dist/hello.svelte 625 bytes [built] [code generated]
  ./node_modules/svelte/internal/index.mjs 75.9 KiB [built] [code generated]
webpack 5.75.0 compiled successfully in 4798 ms
⠋ Waiting for framework port 5000. This can be configured using the 'targetPort' property in the netlify.toml◈ "yarn build" exited with code 0. Shutting down Netlify Dev server
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Configuration

  System:
    OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
    CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
    Memory: 9.77 GB / 15.48 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
    Yarn: 1.22.19 - ~/workspace/rendall/simple-comment/node_modules/.bin/yarn
    npm: 8.19.2 - ~/.nvm/versions/node/v18.12.1/bin/npm

and netlify -v gets us:

netlify-cli/11.8.3 linux-x64 node-v18.12.1

Pull requests

https://github.com/rendall/simple-comment/pull/72/files

No PRs (yet), but this link shows the diff between the working without-svelte branch and the not-working with-svelte branch. As is clear, the only real addition is svelte. yarn build does output svelte. The only issue here is that the netlify-cli frontend server does not start and then exits.

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined

Feature: add SvelteKit support

Which problem is this feature request solving?

Support for SvelteKit

Describe the solution you'd like

Add a json file to detect SvelteKit

Describe alternatives you've considered

N/A

Can you submit a pull request?

Yes

Related to netlify/cli#2504

Dependency Dashboard

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

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update navikt/github-app-token-generator digest to a3831f4
  • fix(deps): update dependency ajv to v8.12.0
  • 🔐 Create all rate-limited PRs at once 🔐

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/fossa.yml
  • actions/checkout v3
.github/workflows/labeler.yml
  • netlify/pr-labeler-action v1.1.0
.github/workflows/pre-release.yml
  • actions/checkout v3
  • actions/setup-node v3
.github/workflows/release-please.yml
  • navikt/github-app-token-generator a9cd374e271b8aef573b8c16ac46c44fb89b02db
  • GoogleCloudPlatform/release-please-action v3
  • actions/checkout v3
  • actions/setup-node v3
.github/workflows/workflow.yml
  • actions/checkout v3
  • actions/setup-node v3
  • codecov/codecov-action v2
npm
package.json
  • ajv ^8.0.0
  • filter-obj ^3.0.0
  • find-up ^6.3.0
  • fs-extra ^10.1.0
  • is-plain-obj ^4.0.0
  • locate-path ^7.0.0
  • p-filter ^3.0.0
  • p-locate ^6.0.0
  • process ^0.11.10
  • read-pkg-up ^9.0.0
  • semver ^7.3.4
  • url ^0.11.0
  • @netlify/eslint-config-node ^6.0.0
  • ava ^4.0.0
  • babel-loader ^8.2.2
  • c8 ^7.11.0
  • cpy ^9.0.0
  • cpy-cli ^4.0.0
  • del ^6.0.0
  • husky ^7.0.4
  • path-browserify ^1.0.1
  • rollup-plugin-node-polyfills ^0.2.1
  • test-each ^4.0.0
  • tmp-promise ^3.0.2
  • vite ^3.1.6
  • node ^14.14.0 || >=16.0.0

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

Feature: make this library browser compatible

Which problem is this feature request solving?

We would like to be able to use this library from the Browser.
This is currently not possible since it uses Node.js specific APIs:

const getOptions = function({ projectDir = process.cwd(), ignoredWatchCommand } = {}) {

return configFiles.length === 0 || (await locatePath(configFiles, { type: 'file', cwd: projectDir })) !== undefined

const result = await readPkgUp({ cwd: projectDir, normalize: false })

if (await pathExists(`${dirname(packageJsonPath)}/yarn.lock`)) {

Describe the solution you'd like

Ability to run the detection from the Browser - fs related operations can be refactored to accepts files lists/operations from the caller.

Describe alternatives you've considered

Duplicate the logic in another codebase

Can you submit a pull request?

Yes

Add missing framework info for Remix

Description

Add the missing framework info for Remix.

{
  "id": "remix",
  "name": "Remix",
  "category": "static_site_generator",
  "detect": {
-    "npmDependencies": ["remix", "@remix-run/netlify"],
+    "npmDependencies": ["remix", "@remix-run/netlify", "@remix-run/netlify-edge"],
    "excludedNpmDependencies": [],
    "configFiles": ["remix.config.js"]
  },
  "dev": {
    "command": "remix watch"
  },
  "build": {
    "command": "remix build",
    "directory": "public"
  },
  "logo": {
    "default": "/logos/remix/default.svg",
    "light": "/logos/remix/light.svg",
    "dark": "/logos/remix/dark.svg"
  },
  "env": {},
  "plugins": []
}

Cypress tests on Firefox are failing

Cypress tests on Firefox are currently failing.
The following PR is skipping them, but we should re-enable them: #715

They started failing with the following PR: #691. The problem seems to be related to using dependencies using pure ES modules, not to p-filter. I based this statement from some debugging where I tried to upgrade p-locate first instead (#692), and the result was the same.

Also, this appears to be a problem only with our tests. In production, Firefox works well with framework-info.

Finally, this is not a problem with using pure ES modules in framework-info itself, since we migrated to ES modules before upgrading p-filter and the tests on Firefox were successful.

Use pure ES modules

See background at https://github.com/netlify/team-dev/issues/36

Once #450 is done and released, we should use pure ES modules and make a major release.

This is more than just switching from CommonJS to import/export. See this list for other changes which might be involved. This should be broken in many PRs, as much as possible, to lower the risk. Also, non-breaking changes (such as adding file extensions in imports, or loading JSON files differently) should be done before the breaking changes (such as using import/export statements).

At the moment, framework-info is only used by:

  • build-info: so support for pure ES modules should be added first there: netlify/build-info#181
  • netlify-cli: same thing for Netlify CLI: netlify/cli#3514
  • netlify-react-ui: will this be a problem when importing this module from netlify-react-ui? Do we bundle code to make ES modules work in netlify-react-ui? Or maybe we now only support browsers with ES modules support? @nasivuela Do you know what the situation is?

SvelteKit framework info is out of date

Thanks for reporting this bug!

Please search other issues to make sure this bug has not already been reported.

Then fill in the sections below.

Describe the bug

The SvelteKit framework info is out of date. The configuration should be change to this.

    "configFiles": []
  },
  "dev": {
-    "command": "svelte-kit dev",
-   "port": 3000,
+  "command": "vite dev",
+  "port": 5173,
    "pollingStrategies": [{ "name": "TCP" }, { "name": "HTTP" }]
  },
  "build": {
-    "command": "svelte-kit build",
-    "directory": "build"
+    "command": "vite build",
+    "directory": ".svelte-kit"
  },
  "logo": {
    "default": "/logos/svelte-kit/default.svg",
    "light": "/logos/svelte-kit/default.svg",
    "dark": "/logos/svelte-kit/default.svg"
  },
  "staticAssetsDirectory": "static",
  "env": {},
  "plugins": []
}

Configuration

Please enter the following command in a terminal and copy/paste its output:

npx envinfo --system --binaries --npmPackages @netlify/framework-info

Pull requests

Pull requests are welcome! If you would like to help us fix this bug, please check our
contributions guidelines.

Update site to return list of frameworks

Which problem is this feature request solving?

The site that this project is hosting is only returning a JSON object of a detected framework for a hard coded project.

Describe the solution you'd like

Would like to update this behaviour to return the list of frameworks that the tool automatically detects

feature: support frameworks with identical configuration file names and no dependencies

Which problem is this feature request solving?

Some frameworks don't have any local dependencies and might have the same configuration file.
See #326 (review)

We should find a way to support such use cases.

Describe the solution you'd like

A possible solution would be to allow pattern matching in files' content.

Describe alternatives you've considered

Keep things as is, which will result in reporting multiple frameworks in some cases.

Can you submit a pull request?

Yes

We should consider that this should be supported for both Node.js and the browser

feature: handle command arguments with spaces

Which problem is this feature request solving?

At the moment we return a dev/build command as a single string, e.g. npm run <some-script>.
This might cause issues if <some-script> contains spaces.
We should support this use case.

Related to netlify/cli#2857 (comment)

Describe the solution you'd like

Handle spaces in command arguments, via quoting the arguments or escaping the spaces.

Describe alternatives you've considered

N/A

Can you submit a pull request?

Yes

Feature: return strategies to known when framework dev server is ready

Related to netlify/cli#1817

When detecting the dev command and port, we should also provide a list of polling strategies to know when the framework dev server is ready.

The CLI uses waitPort and HEAD requests to detect when the server is ready, but for Next.js that doesn't work very well so we only use waitPort.

cc @eduardoboucas

A future improvement can be to add an stdOut strategy where the caller starts the framework dev server and looks for a specific pattern in the command output.

feature: read frameworks ports from configuration files

Which problem is this feature request solving?

Some frameworks can have their port configured by a file. e.g.

It would be great to read the port from the configuration file and use it instead of the default.

Describe the solution you'd like

When relevant, parse the framework configuration file and read the port setting

Describe alternatives you've considered

Keep reporting the default port

Can you submit a pull request?

Yes

Upgrade minimal Node.js version to Node 12

See background at https://github.com/netlify/team-dev/issues/34

We should upgrade the minimal Node.js version to Node >=12.20.0 and make a major release.

At the moment, framework-info is only used by:

  • build-info: so support for Node 10 should be dropped first in build-info: netlify/build-info#180
  • netlify-cli: same thing for Netlify CLI: netlify/cli#3512
  • netlify-react-ui: I believe framework-info is imported from the browser, using the browser-specific code, so Node.js support should be irrelevant. @nasivuela Could you please confirm this is correct? Thanks!

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.