Skip to content

Commit

Permalink
Merge pull request #700 from Freemius/develop
Browse files Browse the repository at this point in the history
Version 2.7.0
  • Loading branch information
swashata authored Apr 7, 2024
2 parents ea3a288 + 7e3b11e commit 9fc7bd5
Show file tree
Hide file tree
Showing 92 changed files with 37,173 additions and 18,949 deletions.
4 changes: 4 additions & 0 deletions .example.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generate from here: https://app.transifex.com/user/settings/api/
TRANSIFEX_API="..."
TRANSIFEX_ORGANIZATION=freemius
TRANSIFEX_PROJECT=sdk-testing
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ phpcs.xml export-ignore
phpcompat.xml export-ignore
phpstan.neon export-ignore
.editorconfig export-ignore
/assets/scripts/ export-ignore
/patches/ export-ignore
/gulptasks/ export-ignore
.example.env export-ignore
CONTRIBUTING.md export-ignore
package-lock.json export-ignore

# Declare files that will always have CRLF line endings on checkout.
#*.php text eol=crlf
Expand Down
35 changes: 31 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run CI tests via Github.
name: PHPCS and Static Analysis.
name: Static Analysis and Build

on:
pull_request:
Expand All @@ -8,9 +8,9 @@ on:
- master

jobs:
run:
staticAnalysis:
runs-on: ubuntu-latest
name: PHPCS
name: PHP Static Analysis
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -43,4 +43,31 @@ jobs:
run: composer phpstan

- name: Run PHPCS
run: composer phpcs:ci
run: composer phpcs:ci

canBuild:
runs-on: ubuntu-latest
name: Can Build

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 'lts/*'

- name: Log debug information
run: |
node --version
npm --version
- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Create POT file
run: npm run pot
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ node_modules
transifex-config.json
*.orig
npm-debug.log
package-lock.json
vendor
.DS_Store
error-phpstan.xml
error-phpcs.log
error-phpcs.log
.env
/assets/css/**/*.css.map
58 changes: 58 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Contributing to Freemius SDK for WordPress

We love to receive contributions from our community — you! There are many ways to contribute, from writing tutorials or blog posts, improving the documentation, submitting bug reports and feature requests or writing code which can be incorporated into Freemius SDK for WordPress itself.
Please be sure to read our [contributing guide](https://freemius.com/help/documentation/wordpress-sdk/freemius-sdk-contribute/) before making a pull request.

## Setup Node.js

We make use of several Node.js packages to build and test the SDK. To install them, you need to have Node.js installed on your machine. We recommend using
[nvm](https://github.com/nvm-sh/nvm). Once you have it installed, run the following commands to install the correct version of Node.js and the dependencies:

```bash
# Make sure to use the latest LTS version of Node.js.
nvm install --lts
nvm use --lts

# Install with a frozen lockfile.
npm ci
````

Now you may check the available commands by running:

```bash
npm run
```

## Translations

We use a custom build to extract translations and generate the POT file. The prerequisites are:

- You must be a team member of Freemius.
- You must have access to our [Transifex](https://app.transifex.com/freemius/wordpress-sdk/dashboard/) project.
- You have set the `.env` file in the project with the needed variables. Check the `.env.example` file for reference.

Now, you can run the following commands:


```bash
# Run the script to extract translations and generate the POT file.
npm run translate
```

## Development and Build

To compile SASS and JS during development, run

```bash
npm run dev
```

This will watch for changes and compile changed files. The system is also hooked with
live-reload, so you don't need to refresh the page to see the changes. Simply install the
[LiveReload browser extension](https://chromewebstore.google.com/detail/livereload++/ciehpookapcdlakedibajeccomagbfab) and enable it.
To build the SDK for production, run
```bash
npm run build
```
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,3 +280,7 @@ The free version is the one that you should give your users to download. Therefo
Copyright (c) Freemius®, Inc.

Licensed under the GNU general public license (version 3).

## Contributing

Please see our [contributing guide](CONTRIBUTING.md).
2 changes: 1 addition & 1 deletion assets/css/admin/account.css
100644 → 100755

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion assets/css/admin/account.css.map

This file was deleted.

Loading

0 comments on commit 9fc7bd5

Please sign in to comment.