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

Update plugin for latest NX, refactor, implement prompts, shorthands #57

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

JakeAi
Copy link
Contributor

@JakeAi JakeAi commented Jul 11, 2022

Updated plugin which fixes multiple issues that were presented with an NX update.
Fixes #51

Implements shorthands. For example
nx build nativescript-app android or nx run nativescript-app:build android
nx build nativescript-app android -c=production or nx run nativescript-app:build:production android
nx run nativescript-app android or nx run nativescript-app:run android

Implements warnings when proceeding without a specific platform (although defaults to iOS)
Added a prompt to pick a platform.

Implements warnings when proceeding without a configuration.
Added a prompt to pick a configuration.

Implements -s or --silent to skip prompts.

Split up {N} cli switch schema to become their own schemas which gets built when running npm run build

Project.json follows a more traditional angular-like project.json. For example

{
  "$schema": "..\\..\\node_modules\\nx\\schemas\\project-schema.json",
  "projectType": "application",
  "sourceRoot": "apps/nativescript-app/src",
  "prefix": "my-repo",
  "generators": {
    "@schematics/angular:component": {
      "styleext": "scss"
    }
  },
  "targets": {
    "build": {
      "executor": "@nativescript/nx:build",
      "options": {
        "noHmr": true,
        "uglify": true,
        "forDevice": true,
        "android": {
          "copyTo": "../../dist/apps/app.apk",
          "keyStorePath": "E:\\Android\\android.keystore",
          "keyStoreAlias": "app",
          "keyStorePassword": "pass",
          "keyStoreAliasPassword": "pass"
        },
        "ios": {
          "copyTo": "../../dist/apps/app.ipa"
        }
      },
      "configurations": {
        "production": {
          "production": true,
          "release": true,
          "android": {
            "keyStorePassword": "productionpw"
          },
          "fileReplacements": [
            {
              "replace": "./src/environments/environment.ts",
              "with": "./src/environments/environment.prod.ts"
            }
          ]
        }
      }
    },
    "prepare": {
      "executor": "@nativescript/nx:prepare",
      "options": {
        "noHmr": true,
        "production": true,
        "uglify": true,
        "release": true,
        "forDevice": true,
        "prepare": true
      }
    },
    "debug": {
      "executor": "@nativescript/nx:debug",
      "options": {
        "noHmr": true,
        "uglify": false,
        "release": false,
        "forDevice": true,
        "prepare": true
      }
    },
    "clean": {
      "executor": "@nativescript/nx:clean",
      "options": {}
    },
    "lint": {
      "executor": "@nrwl/linter:eslint",
      "options": {
        "lintFilePatterns": [
          "apps/nativescript-app/**/*.ts",
          "apps/nativescript-app/src/**/*.html"
        ]
      }
    },
    "test": {
      "executor": "@nativescript/nx:test",
      "outputs": [
        "coverage/apps/nativescript-app"
      ],
      "options": {
        "coverage": true
      },
      "configurations": {}
    }
  },
  "tags": []
}

@cla-bot cla-bot bot added the cla: yes label Jul 11, 2022
@NathanWalker
Copy link
Contributor

The plan is to release this alongside Nx 17 support (their next major version target - no date set yet) but we'll begin integrating this into everything to become the default with a migration to handle project.json adjustments.

@NathanWalker
Copy link
Contributor

Nx 17 was released and we're working on the migration here to make this the standard going forward in these tools.

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

Successfully merging this pull request may close these issues.

🚨 Having trouble with 'nx build nativescript-{yourapp}'? See...
2 participants