Skip to content

Commit 22ce46c

Browse files
committed
Merge remote-tracking branch 'nativescript/main'
2 parents 75dd54c + 08167fb commit 22ce46c

File tree

147 files changed

+50343
-23322
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+50343
-23322
lines changed

.eslintrc.json

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,31 @@
11
{
22
"root": true,
33
"ignorePatterns": ["**/*"],
4-
"parser": "@typescript-eslint/parser",
5-
"parserOptions": {
6-
"ecmaFeatures": {
7-
"jsx": true
8-
},
9-
"ecmaVersion": 2020,
10-
"sourceType": "module",
11-
"project": "tsconfig.eslint.json",
12-
"warnOnUnsupportedTypeScriptVersion": false
13-
},
4+
"plugins": ["@nx"],
145
"overrides": [
6+
{
7+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
8+
"rules": {
9+
"@nx/enforce-module-boundaries": [
10+
"error",
11+
{
12+
"enforceBuildableLibDependency": true,
13+
"allow": [],
14+
"depConstraints": [
15+
{
16+
"sourceTag": "*",
17+
"onlyDependOnLibsWithTags": ["*"]
18+
}
19+
]
20+
}
21+
]
22+
}
23+
},
1524
{
1625
"files": ["*.ts", "*.tsx"],
17-
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
26+
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier", "plugin:@nx/typescript"],
1827
"rules": {
1928
"no-empty": "off",
20-
"prefer-const": "warn",
2129
"no-useless-escape": "off",
2230
"no-inner-declarations": "off",
2331
"no-prototype-builtins": "off",
@@ -31,16 +39,16 @@
3139
"@typescript-eslint/no-this-alias": "warn",
3240
"@typescript-eslint/no-namespace": "off",
3341
"@typescript-eslint/no-inferrable-types": "off",
34-
"@typescript-eslint/no-unsafe-function-type": "off",
35-
"@typescript-eslint/no-require-imports": "off",
36-
"@typescript-eslint/no-wrapper-object-types": "warn",
37-
"prettier/prettier": "warn"
42+
"@typescript-eslint/no-extra-semi": "error",
43+
"no-extra-semi": "off"
3844
}
3945
},
4046
{
4147
"files": ["*.js", "*.jsx"],
48+
"extends": ["plugin:@nx/javascript"],
4249
"rules": {
43-
"prettier/prettier": "warn"
50+
"@typescript-eslint/no-extra-semi": "error",
51+
"no-extra-semi": "off"
4452
}
4553
},
4654
{
@@ -52,9 +60,7 @@
5260
{
5361
"files": "*.json",
5462
"parser": "jsonc-eslint-parser",
55-
"rules": {
56-
"prettier/prettier": "warn"
57-
}
63+
"rules": {}
5864
}
5965
]
6066
}

.github/workflows/apps_automated_android.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ permissions:
44
pull-requests: write
55

66
on:
7+
push:
8+
branches:
9+
- main
10+
- 'ci/**'
711
pull_request:
812
workflow_dispatch:
913

.github/workflows/apps_automated_ios.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ permissions:
44
pull-requests: write
55

66
on:
7+
push:
8+
branches:
9+
- main
10+
- 'ci/**'
711
pull_request:
812
workflow_dispatch:
913

.github/workflows/npm_release_core.yml

Lines changed: 30 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -4,89 +4,54 @@ permissions:
44
pull-requests: write
55

66
on:
7+
push:
8+
branches: [ 'main' ]
9+
paths:
10+
- 'packages/core/**'
711
workflow_dispatch:
8-
inputs:
9-
release_type:
10-
type: choice
11-
default: auto
12-
description: What kind of version upgrade
13-
options:
14-
- auto
15-
- patch
16-
- minor
17-
- major
18-
- none
1912

13+
env:
14+
NPM_TAG: 'next'
15+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
2016

2117
jobs:
2218
release:
2319
runs-on: ubuntu-latest
20+
2421
steps:
2522
- name: Harden the runner (Audit all outbound calls)
2623
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
2724
with:
2825
egress-policy: audit
2926

30-
- name: Checkout repository
31-
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
32-
with:
33-
fetch-depth: "0"
34-
submodules: true
27+
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
3528

36-
- name: setup node
37-
uses: actions/setup-node@v4
38-
with:
39-
node-version: lts/*
40-
registry-url: 'https://registry.npmjs.org'
41-
42-
- uses: oNaiPs/secrets-to-env-action@v1
43-
with:
44-
secrets: ${{ toJSON(secrets) }}
29+
- name: Setup
30+
run: npm run setup
4531

46-
- uses: oleksiyrudenko/gha-git-credentials@8bb1fe6d543b2233ef1856cd3b0181f5abbd4d6a # v2.1.2
32+
- name: Derive appropriate SHAs for base and head for `nx affected` commands
33+
uses: nrwl/nx-set-shas@826660b82addbef3abff5fa871492ebad618c9e1 # v4.3.3
4734
with:
48-
token: '${{ secrets.GITHUB_TOKEN }}'
49-
name: Martin Guillon
50-
51-
52-
- name: "NPM Identity"
53-
env:
54-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
55-
run: |
56-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
35+
main-branch-name: 'main'
5736

58-
- name: Enable CorePack
37+
- name: Generate Version
38+
working-directory: packages/core
5939
run: |
60-
corepack enable
61-
yarn config get globalFolder # the yarn command will ensure the correct yarn version is downloaded and installed
40+
echo NPM_VERSION=$(node -e "console.log(require('./package.json').version);")-$NPM_TAG-$(date +"%m-%d-%Y")-$GITHUB_RUN_ID >> $GITHUB_ENV
6241
63-
- name: Get yarn cache directory path
64-
id: yarn-cache-dir-path
65-
run: echo "::set-output name=dir::$(yarn config get globalFolder)"
42+
- name: Bump Version
43+
working-directory: packages/core
44+
run: npm version $NPM_VERSION
6645

67-
- name: Install deps
68-
uses: bahmutov/npm-install@v1
69-
with:
70-
install-command: yarn install --silent
71-
env:
72-
YARN_ENABLE_IMMUTABLE_INSTALLS: false
73-
46+
# TODO: build ui-mobile-base first
47+
- name: Build @nativescript/core
48+
run: npx nx build core
7449

75-
- name: bump release auto
76-
if: github.event.inputs.release_type == 'auto'
77-
run: |
78-
npm run core:changelog --
79-
80-
- name: publish
81-
if: github.event.inputs.release_type != 'auto' && github.event.inputs.release_type != 'none'
82-
run: |
83-
npm run core:changelog -- --release-as ${{ github.event.inputs.release_type }}
84-
85-
- name: publish
86-
run: |
87-
npm run core:publish -- --no-verify-access --no-private --no-commit-hooks --force-publish --yes
88-
git push --tags
50+
- name: Publish @nativescript/core
51+
working-directory: dist/packages/core
8952
env:
90-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
91-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
54+
run: |
55+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
56+
echo "Publishing @nativescript/core@$NPM_VERSION to NPM with tag $NPM_TAG..."
57+
npm publish --tag $NPM_TAG --access public
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: 'tns-core-modules -> npm'
2+
permissions:
3+
contents: read
4+
pull-requests: write
5+
6+
on:
7+
push:
8+
branches: [ 'tns-core-modules' ]
9+
paths:
10+
- 'nativescript-core/**'
11+
workflow_dispatch:
12+
13+
env:
14+
NPM_TAG: 'tns-next'
15+
16+
jobs:
17+
release:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Harden the runner (Audit all outbound calls)
22+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
23+
with:
24+
egress-policy: audit
25+
26+
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
27+
28+
- name: Setup
29+
run: npm install
30+
31+
- name: Generate Version
32+
run: |
33+
echo NPM_VERSION=$(node -e "console.log(require('./package.json').version);")-$NPM_TAG-$(date +"%m-%d-%Y")-$GITHUB_RUN_ID >> $GITHUB_ENV
34+
35+
- name: Bump Versions
36+
run: |
37+
# bump root version
38+
npm version --no-git-tag-version $NPM_VERSION
39+
40+
# bump @nativescript/core
41+
cd nativescript-core
42+
npm version --no-git-tag-version $NPM_VERSION
43+
cd ..
44+
45+
# bump tns-core-modules version & @nativescript/core dep
46+
cd tns-core-modules-package
47+
npm version --no-git-tag-version $NPM_VERSION
48+
cat <<EOT > _bump_core.js
49+
const {readFileSync: read, writeFileSync: write} = require('fs'),
50+
p = 'package.json',
51+
pkg = read(p).toString()
52+
ver = process.argv.splice(2).join(' ');
53+
u = pkg.replace(/("@nativescript\/core": ")(?:.+)(")/g, \`\$1\${ver}\$2\`);
54+
console.log(u)
55+
write(p, u);
56+
EOT
57+
node _bump_core.js $NPM_VERSION
58+
59+
# for debugging - just show diff
60+
git diff package.json
61+
cd ..
62+
63+
- name: Build @nativescript/core
64+
run: npm run build-core
65+
66+
- name: Build tns-core-modules
67+
run: npm run build-compat
68+
69+
- name: Publish @nativescript/core
70+
working-directory: dist
71+
env:
72+
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
73+
run: |
74+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ../.npmrc
75+
76+
ls -al
77+
78+
echo "Publishing @nativescript/core@$NPM_VERSION to NPM with tag $NPM_TAG..."
79+
# npm publish nativescript-core-$NPM_VERSION.tgz --tag $NPM_TAG --dry-run
80+
81+
echo "Publishing tns-core-modules@$NPM_VERSION to NPM with tag $NPM_TAG..."
82+
# npm publish tns-core-modules-$NPM_VERSION.tgz --tag $NPM_TAG --dry-run

.github/workflows/npm_release_types.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
# run: npm version $NPM_VERSION
4242
#
4343
# - name: Build @nativescript/types
44-
# run: npm run run core:build
44+
# run: npx nx run core:build
4545
#
4646
# - name: Publish @nativescript/types
4747
# working-directory: dist/packages

.github/workflows/npm_release_webpack.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
name: '@akylas/nativescript-webpack -> npm'
1+
name: '@nativescript/webpack -> npm'
2+
permissions:
3+
contents: read
4+
pull-requests: write
25

36
on:
47
push:
@@ -33,14 +36,14 @@ jobs:
3336
working-directory: packages/webpack
3437
run: npm version $NPM_VERSION
3538

36-
- name: Build @akylas/nativescript-webpack
37-
run: npm run run webpack:build
39+
- name: Build @nativescript/webpack
40+
run: npx nx run webpack:build
3841

39-
- name: Publish @akylas/nativescript-webpack
42+
- name: Publish @nativescript/webpack
4043
working-directory: dist/packages/webpack5
4144
env:
4245
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
4346
run: |
4447
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ../../.npmrc
45-
echo "Publishing @akylas/nativescript-webpack@$NPM_VERSION to NPM with tag $NPM_TAG..."
48+
echo "Publishing @nativescript/webpack@$NPM_VERSION to NPM with tag $NPM_TAG..."
4649
npm publish --tag $NPM_TAG --dry-run

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,9 @@ Thumbs.db
5656
# types
5757
ios-typings-prj
5858

59-
/packages/core/platforms/android/core.aar
60-
.nx
59+
.nx/cache
60+
.nx/workspace-data
6161
vite.config.*.timestamp*
6262
vitest.config.*.timestamp*
63-
6463
.cursor/rules/nx-rules.mdc
6564
.github/instructions/nx.instructions.md

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx lint-staged --allow-empty

.prettierignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.github
12
.gitignore
23
.npmignore
34
*.yml
@@ -25,4 +26,5 @@ package.json
2526
*.sh
2627
!packages/webpack/templates/*.js
2728

28-
/.nx
29+
/.nx/cache
30+
/.nx/workspace-data

0 commit comments

Comments
 (0)