NativeScript / nx

NativeScript for Nx.
Other
61 stars 15 forks source link

nx g @nativescript/nx:app does not create app with new workspace/project json schematics #44

Closed JakeAi closed 2 years ago

JakeAi commented 2 years ago

nx g @nativescript/nx:app generated

    "nativescript-test-app": {
      "projectType": "application",
      "root": "apps/nativescript-test-app/",
      "sourceRoot": "apps/nativescript-test-app/src",
      "prefix": "mm-mono",
      "targets": {
        "build": {
          "executor": "@nativescript/nx:build",
          "options": {
            "noHmr": true,
            "production": true,
            "uglify": true,
            "release": true,
            "forDevice": true
          },
          "configurations": {
            "prod": {
              "fileReplacements": [
                {
                  "replace": "./src/environments/environment.ts",
                  "with": "./src/environments/environment.prod.ts"
                }
              ]
            }
          }
        },
        "ios": {
          "executor": "@nativescript/nx:build",
          "options": {
            "platform": "ios"
          },
          "configurations": {
            "build": {
              "copyTo": "./dist/build.ipa"
            },
            "prod": {
              "combineWithConfig": "build:prod"
            }
          }
        },
        "android": {
          "executor": "@nativescript/nx:build",
          "options": {
            "platform": "android"
          },
          "configurations": {
            "build": {
              "copyTo": "./dist/build.apk"
            },
            "prod": {
              "combineWithConfig": "build:prod"
            }
          }
        },
        "clean": {
          "executor": "@nativescript/nx:build",
          "options": {
            "clean": true
          }
        },
        "lint": {
          "executor": "@nrwl/linter:eslint",
          "options": {
            "lintFilePatterns": [
              "apps/nativescript-test-app/**/*.ts",
              "apps/nativescript-test-app/src/**/*.html"
            ]
          }
        },
        "test": {
          "executor": "@nrwl/jest:jest",
          "options": {
            "jestConfig": "apps/nativescript-test-app/jest.config.js",
            "tsConfig": "apps/nativescript-test-app/tsconfig.spec.json",
            "passWithNoTests": true,
            "setupFile": "apps/nativescript-test-app/src/test-setup.ts"
          }
        }
      }
    }

I expected

"nativescript-test-app": {
  "projectType": "application",
  "root": "apps/nativescript-test-app/",
  "sourceRoot": "apps/nativescript-test-app/src",
  "prefix": "",
  "targets": {
    "build": {
      "builder": "@nativescript/nx:build",
      "options": {
        "noHmr": true,
        "production": true,
        "uglify": true,
        "release": true,
        "forDevice": true
      },
      "configurations": {
        "prod": {
          "fileReplacements": [
            {
              "replace": "./src/environments/environment.ts",
              "with": "./src/environments/environment.prod.ts"
            }
          ]
        }
      }
    },
    "ios": {
      "builder": "@nativescript/nx:build",
      "options": {
        "platform": "ios"
      },
      "configurations": {
        "build": {
          "provision": "AppStore Profile",
          "copyTo": "./dist/build.ipa"
        },
        "prod": {
          "combineWithConfig": "build:prod"
        }
      }
    },
    "android": {
      "builder": "@nativescript/nx:build",
      "options": {
        "platform": "android"
      },
      "configurations": {
        "build": {
          "aab": true,
          "keyStorePath": "./tools/keystore.jks",
          "keyStorePassword": "your-password",
          "keyStoreAlias": "keystore-alias",
          "keyStoreAliasPassword": "keystore-alias-password",
          "copyTo": "./dist/build.aab"
        },
        "prod": {
          "combineWithConfig": "build:prod"
        }
      }
    },
    "test": {
      "executor": "@nativescript/nx:test",
      "outputs": ["coverage/apps/nativescript-test-app"],
      "options": {
        "coverage": false
      },
      "configurations": {
        "android": {},
        "ios": {}
      }
    },
    "clean": {
      "builder": "@nativescript/nx:build",
      "options": {
        "clean": true
      }
    }
  }
}
JakeAi commented 2 years ago

Did not see this comment due to gmail putting replies and updates into spam. Feel free to close if you think its necessary, or leave open for people like me who didn't see it lol

https://github.com/NativeScript/nx/issues/8#issuecomment-997230284

NathanWalker commented 2 years ago

Thanks @JakeAi - yep we're clearing Angular 13 and then will adjust all the generators to add the proper test config. Additionally we'll probably add a generator to add the testing config with v3 runner for existing workspaces that have apps without it.

mahmoudajawad commented 2 years ago

@NathanWalker, while you are it, what's the plan for Nx 13 compatibility? I'm asking here because I beleive those are all related.

JakeAi commented 2 years ago

Thanks @JakeAi - yep we're clearing Angular 13 and then will adjust all the generators to add the proper test config. Additionally we'll probably add a generator to add the testing config with v3 runner for existing workspaces that have apps without it.

Any update on this? Will we still need to add our monorepo libs to the ns-app tsconfig file?

NathanWalker commented 2 years ago

Nx 13 works well with current release - regarding test target I'll close this and use this ticket for handling that: https://github.com/NativeScript/nx/issues/32#issuecomment-1106956411