|
| 1 | +<!-- |
| 2 | +# |
| 3 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 4 | +# or more contributor license agreements. See the NOTICE file |
| 5 | +# distributed with this work for additional information |
| 6 | +# regarding copyright ownership. The ASF licenses this file |
| 7 | +# to you under the Apache License, Version 2.0 (the |
| 8 | +# "License"); you may not use this file except in compliance |
| 9 | +# with the License. You may obtain a copy of the License at |
| 10 | +# |
| 11 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | +# |
| 13 | +# Unless required by applicable law or agreed to in writing, |
| 14 | +# software distributed under the License is distributed on an |
| 15 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 16 | +# KIND, either express or implied. See the License for the |
| 17 | +# specific language governing permissions and limitations |
| 18 | +# under the License. |
| 19 | +# |
| 20 | +--> |
| 21 | + |
| 22 | +# Development |
| 23 | + |
| 24 | +## Setup |
| 25 | + |
| 26 | +1. Install npm dependencies. |
| 27 | + |
| 28 | + ```bash |
| 29 | + npm install |
| 30 | + ``` |
| 31 | + |
| 32 | +## Updating the parser |
| 33 | + |
| 34 | +If there's a problem parsing, you will want to edit the grammar under `lib/parser/pbxproj.pegjs`. |
| 35 | +
|
| 36 | +Tests under the `test/parser` directory will compile the parser from the grammar. The other tests will use the prebuilt parser (`lib/parser/pbxproj.js`). |
| 37 | +
|
| 38 | +To build the parser js file after editing the grammar, run: |
| 39 | +
|
| 40 | +```bash |
| 41 | +npm run build |
| 42 | +``` |
| 43 | +
|
| 44 | +## Unit Testing |
| 45 | +
|
| 46 | +Our projects include unit tests, which can be run with: |
| 47 | +
|
| 48 | +```bash |
| 49 | +npm test |
| 50 | +``` |
| 51 | +
|
| 52 | +## Linting |
| 53 | +
|
| 54 | +During development, you should run the linter to ensure the code follows our coding standards: |
| 55 | +
|
| 56 | +```bash |
| 57 | +npm run lint |
| 58 | +``` |
| 59 | +
|
| 60 | +> [!NOTE] |
| 61 | +> Running `npm test` will also execute the linter before running the tests. |
| 62 | +
|
| 63 | +### Fixing Lint Issues |
| 64 | +
|
| 65 | +In many cases, lint warnings can be fixed automatically with: |
| 66 | +
|
| 67 | +```bash |
| 68 | +npm run lint:fix |
| 69 | +``` |
| 70 | +
|
| 71 | +If an issue cannot be resolved automatically, it will require manual review and correction. |
| 72 | +
|
| 73 | +## Building from Source |
| 74 | +
|
| 75 | +1. **Clone the repository** locally. |
| 76 | +
|
| 77 | +2. **Change to the repository directory.** |
| 78 | +
|
| 79 | +3. **Install dependencies:** |
| 80 | +
|
| 81 | + ```bash |
| 82 | + npm install |
| 83 | + ``` |
| 84 | +
|
| 85 | + Installs all production and development dependencies required for using and developing the package. |
| 86 | +
|
| 87 | +4. **Update sub-dependencies:** |
| 88 | +
|
| 89 | + ```bash |
| 90 | + npm update |
| 91 | + ``` |
| 92 | +
|
| 93 | + Over time, `package-lock.json` can become stale and may trigger audit warnings. `npm update` refreshes dependencies within the pinned versions. |
| 94 | +
|
| 95 | + Under normal circumstances, users install the published package from the npm registry, which does **not** include its own `package-lock.json`. Instead, npm resolves and installs the latest compatible dependency versions at install time, which may result in no audit warnings. |
| 96 | +
|
| 97 | + Running `npm update` locally can provide a more accurate representation of current npm audit results for the project. |
| 98 | +
|
| 99 | +5. **Generate a tarball:** |
| 100 | +
|
| 101 | + ```bash |
| 102 | + npm pack |
| 103 | + ``` |
| 104 | +
|
| 105 | + Creates a `.tgz` tarball file in the `.asf-release` directory. |
0 commit comments