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

feat: post-install compilation #135

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/nodejs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inputs:
node-version:
description: Node.js version
required: false
default: 16.x
default: 20.x
frozen-lockfile:
description: Install dependencies from lock file
required: false
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/publish/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Publish packages
description: Publishes all the packages from libs to the npm

inputs:
token:
description: 'NPM token'
required: true
tag:
description: 'Tag to publish'
required: true

runs:
using: node20
main: ./index.js
24 changes: 24 additions & 0 deletions .github/actions/publish/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const {input, error, info} = require('@actions/core');
const { readdirSync } = require('fs');
const {npmPublish} = require('@jsdevtools/npm-publish');
const token = input('token');
const tag = input('tag');

const publish = async () => {
for (const lib of readdirSync('dist/libs')) {
const pkgJsonPath = `dist/libs/${lib}/package.json`;
try {
const result = await npmPublish({
package: pkgJsonPath,
access: 'public',
tag,
token,
});
info(`Published ${pkgJsonPath} with tag ${tag}. ${result.id}`);
} catch (e) {
error(e);
}
}
};

publish();
18 changes: 4 additions & 14 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,14 @@ jobs:
run: |
npx lerna version ${{ steps.bumpVersion.outputs.newVersion }} --yes --force-publish --message="chore(release): publish %v [ci skip]" --no-push

- name: Prepare
run: npx nx run-many --target=prepare --all
- name: Build
run: npx nx run-many --target=build --all

- name: Publish on npm ui5-angular
uses: JS-DevTools/npm-publish@v1
- name: Publish Packages
uses: ./.github/actions/publish
with:
package: dist/libs/ui5-angular/package.json
token: ${{ secrets.NPM_TOKEN }}
tag: ${{ steps.bumpVersion.outputs.releaseTag }}
access: public

- name: Publish on npm ui5-angular-theming
uses: JS-DevTools/npm-publish@v1
with:
package: dist/libs/ui5-angular-theming/package.json
token: ${{ secrets.NPM_TOKEN }}
tag: ${{ steps.bumpVersion.outputs.releaseTag }}
access: public

- name: Push changes
if: env.IS_MANUAL == 'false'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/on-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ jobs:
run: npx nx run-many --target=sync --all
- name: Test
run: npx nx run-many --target=test --all
- name: Run prepare
run: npx nx run-many --target=prepare --all
- name: Run build
run: npx nx run-many --target=build --all
18 changes: 12 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,24 @@ node_modules
.settings/
*.sublime-workspace

libs/ui5-angular/fiori/
libs/ui5-angular/compat/
libs/ui5-angular/main/
libs/ui5-angular/generic-cva/
libs/ui5-angular/utils/
libs/ui5-angular/fiori/**/*
libs/ui5-angular/compat/**/*
libs/ui5-angular/main/**/*
libs/ui5-angular/generic-cva/**/*
libs/ui5-angular/utils/**/*
libs/ui5-angular/theming/supported-themes.ts
libs/ui5-angular-theming/src/theming/supported-themes.ts
libs/ui5-angular/index.ts
libs/ui5-angular/ui5-webcomponents.module.ts
libs/ui5-angular/.ngx-generation-result.json
libs/ui5-angular/.ngx-theming-result.json

libs/fundamental-styles/directives/
libs/fundamental-styles/index.ts
libs/fundamental-styles/theming/theming.config.ts
libs/fundamental-styles/fundamental-styles-components.module.ts
libs/fundamental-styles/.fd-components.json
libs/fundamental-styles/.supported-themes.json

# IDE - VSCode
.vscode/*
Expand Down Expand Up @@ -62,4 +68,4 @@ Thumbs.db
!.yarn/sdks
!.yarn/versions

.nx/cache
.nx/cache
8 changes: 0 additions & 8 deletions .nxignore

This file was deleted.

3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
/dist
/coverage

/.nx/cache
/.nx/cache
.angular
9 changes: 5 additions & 4 deletions apps/documentation/api-json.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {ComponentData, GeneratedFile, TransformerConfig} from "@ui5/webcomponents-transformer";
import { ComponentData, GeneratedFile } from "@ui5/webcomponents-transformer";
import { customElementSchemaParser } from '@ui5/webcomponents-schema-parser';
import {stringify} from 'flatted';
import { stringify } from 'flatted';

export default {
gatherer: () => customElementSchemaParser({
Expand All @@ -17,5 +17,6 @@ export default {
getCode: () => stringify(c)
} as GeneratedFile
])
]
} as Partial<TransformerConfig<ComponentData>>;
],
logOutputFileNames: '.api-json-log.json'
};
8 changes: 3 additions & 5 deletions apps/documentation/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
"outputs": ["{options.outputFile}"]
},
"sync": {
"executor": "@ui5/webcomponents-nx:sync",
"options": {
"configFiles": ["apps/documentation/api-json.config.ts"]
},
"command": "ts-node {projectRoot}/sync.ts",
"outputs": ["{projectRoot}/src/api-json.json"]
},
"serve": {
Expand Down Expand Up @@ -46,7 +43,8 @@
"quiet": true,
"docs": true
}
}
},
"dependsOn": ["sync"]
}
},
"tags": []
Expand Down
3 changes: 3 additions & 0 deletions apps/documentation/src/.api-json-log.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"api-json.json"
]
11 changes: 11 additions & 0 deletions apps/documentation/sync.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { fsTransformer } from "@ui5/webcomponents-transformer";
import apiJsonConfig from "./api-json.config";
import { join } from "path";

fsTransformer({
basePath: join('apps', 'documentation', 'src'),
conf: [
apiJsonConfig
],

});
2 changes: 1 addition & 1 deletion apps/playground/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {Ui5ThemingModule} from '@ui5/theming-ngx';
import {FundamentalStylesComponentsModule} from "@fundamental-styles/theming-ngx";
import {Ui5FundamentalThemingModule} from "@fundamental-styles/theming-ngx/theming";
import {Ui5WebcomponentsThemingModule} from "@ui5/webcomponents-ngx/theming";
import {Ui5WebcomponentsThemingModule} from "libs/ui5-angular-theming/src/theming";
import {Ui5WebcomponentsIconsModule} from "@ui5/webcomponents-ngx/icons";
import {Ui5WebcomponentsModule} from '@ui5/webcomponents-ngx';
import {Ui5WebcomponentsConfigModule} from '@ui5/webcomponents-ngx/config';
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"packages": ["libs/*", "libs/*/*"],
"packages": ["libs/*"],
"version": "0.3.0-rc.8",
"conventionalCommits": true,
"tagVersionPrefix": "v",
Expand Down
18 changes: 0 additions & 18 deletions libs/angular-generator/.eslintrc.json

This file was deleted.

Loading
Loading