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

Don't require dependencies to be in the scripts section #644

Closed
aomarks opened this issue Jan 18, 2023 · 1 comment · Fixed by #653
Closed

Don't require dependencies to be in the scripts section #644

aomarks opened this issue Jan 18, 2023 · 1 comment · Fixed by #653
Assignees

Comments

@aomarks
Copy link
Member

aomarks commented Jan 18, 2023

We're quite strict about every dependency being a real npm script, but sometimes it's nice to have intermediate scripts that are purely defined in the wireit section, even if they can't be invoked directly. This should be allowed.

@filimon-danopoulos-stratsys
Copy link

filimon-danopoulos-stratsys commented Jan 19, 2023

This might be a bit backwards in relation to this issue but I believe it is related.

Assuming I can have "pure" wireit scripts I would like the ability to run the same scripts too but without having to expose them in scripts. That way my package.json scripts section can be kept very high level, build, lint, test etc without having to care about specifics and dependencies between scripts.

{ 
  "scripts": {
    "build": "yarn wireit:build",
  },
  "wireit": {
    "wireit:build": {
      "command": "esbuild src/index.ts",
      "clean": "if-file-deleted",
      "files": [
        "./src/**/*"
      ],
      "output": [
        "./dist/**"
      ],
      "dependencies": [
        {
          "script": "wireit:tsc",
          "cascade": false
        }
      ]
    },
    "wireit:tsc": {
      "command": "tsc --project tsconfig.json",
      "clean": true,
      "files": [
        "./src/**/*",
        "tsconfig.json"
      ],
      "output": [
        "./typings/**/*"
      ]
    }
  },
}

However when need I would like to tap in to the wireit scripts too, wireit run wireit:tsc.

aomarks added a commit that referenced this issue Jan 30, 2023
Allows defining a script in the `wireit` section even if it doesn't have an entry in `scripts`. Such scripts can be used as dependencies of other wireit scripts, but can't be run directly.

This is nice for intermediate scripts that are created only for internal organization, and would not really make sense to invoke directly.

Fixes #644
@github-project-automation github-project-automation bot moved this from 📋 Triaged to ✅ Done in Lit Project Board Jan 30, 2023
joshkraft pushed a commit to joshkraft/wireit that referenced this issue Feb 21, 2023
Allows defining a script in the `wireit` section even if it doesn't have an entry in `scripts`. Such scripts can be used as dependencies of other wireit scripts, but can't be run directly.

This is nice for intermediate scripts that are created only for internal organization, and would not really make sense to invoke directly.

Fixes google#644
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants